Gemini Image & Video Generation MCP

Gemini Image & Video Generation MCP

gemini-image-gen-mcp•bycollactivelabs

A Model Context Protocol server that lets Claude and other LLMs generate images and videos with Google's Gemini models.

License: ISC•Runtime: Awaiting documentation review•Category: media design

WHAT IT DOES

  • •Generates images from text prompts using Gemini 2.0 Flash image generation.
  • •Generates videos from text prompts using Veo 2.0.
  • •Animates an input image into a video using Veo 2.0.
  • •Saves generated content locally and exposes parameter controls for temperature, topK and topP.

BEST FOR

  • •Claude Desktop users who want image and video generation tools invoked directly from Claude.
  • •Generating images and videos from text prompts through an MCP server.

ABOUT GEMINI-IMAGE-GEN-MCP

Gemini Image & Video Generation MCP is cataloged as an MCP server attributed to collactivelabs. A Model Context Protocol server that lets Claude and other LLMs generate images and videos with Google's Gemini models. It is categorized under media design. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: ISC. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Gemini Image & Video Generation MCP are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Does the server support generating videos from an existing image?

Yes, it offers image-to-video generation that animates images into videos with Veo 2.0.

Can generated media be stored automatically?

Yes, generated content is automatically saved to a local output directory.

上游原版 README

在 GitHub 查看同一版本原文

README.md · e333d16a85ff · 采集于 2026-11-13 11:44:30 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

Gemini Image & Video Generation MCP

A production-ready Model Context Protocol (MCP) server that enables Claude and other LLMs to generate images and videos using Google's Gemini AI models (Gemini 2.0 Flash and Veo 2.0).

🌟 Features

Core Capabilities

  • ✨ Image Generation - Create images using Gemini 2.0 Flash (gemini-2.0-flash-preview-image-generation)
  • 🎬 Video Generation - Generate videos using Veo 2.0 (veo-2.0-generate-001)
  • 🎨 Image-to-Video - Animate images into videos with Veo 2.0
  • 💾 Local Storage - Automatically save generated content
  • ⚙️ Parameter Control - Fine-tune temperature, topK, and topP

Production Features

  • 🔒 Optional Authentication - Token-based API security
  • ⚡ Response Caching - 30-minute TTL cache for repeated prompts
  • 📊 Rate Limiting - Prevent API abuse (100/15min general, 20/15min generation)
  • ✅ Input Validation - Comprehensive request validation
  • 📄 Pagination - Efficient gallery browsing with sorting
  • 🔐 Configurable CORS - Environment-based origin control
  • 📚 OpenAPI Documentation - Interactive Swagger UI at /api-docs
  • 🧪 Test Suite - 17 automated tests with Jest
  • 🐳 Docker Support - Easy containerized deployment

📋 Prerequisites

  • Node.js 18 or higher
  • Google API Key with access to:
    • Gemini 2.0 Flash (image generation)
    • Veo 2.0 (video generation)
  • Docker (optional, for containerized deployment)

🚀 Quick Start

Installation

# Clone the repository
git clone https://github.com/your-org/gemini-image-gen-mcp.git
cd gemini-image-gen-mcp

# Install dependencies
npm install

# Configure environment
cp .env.example .env
# Edit .env and add your GEMINI_API_KEY

Running the Server

Option 1: Node.js (Development)

# MCP server only (for Claude integration)
npm start

# Web server with REST API + UI
npm run web

# Or use the start script
./start-server.sh --both      # Both servers
./start-server.sh --mcp-only  # MCP only
./start-server.sh --web-only  # Web only

Option 2: Docker (Production)

docker-compose up -d

The web interface will be available at http://localhost:3070

🎯 API Endpoints

Generation Endpoints

  • POST /api/generate-image - Generate an image from a text prompt
  • POST /api/generate-video - Generate a video from a text prompt
  • POST /api/generate-video-from-image - Generate a video from an initial image
  • GET /api/images?page=1&limit=20 - List generated images (paginated)
  • GET /api/videos?page=1&limit=20 - List generated videos (paginated)

System Endpoints

  • GET /health - Health check
  • GET /api-docs - Interactive Swagger UI documentation
  • GET /api-docs.json - OpenAPI JSON specification
  • GET /api/cache/stats - View cache statistics
  • POST /api/cache/clear - Clear response cache (requires auth)

📖 API Documentation

Interactive API documentation is available at:

The Swagger UI provides:

  • Complete endpoint documentation
  • Request/response schemas
  • Try-it-now functionality
  • Authentication testing
  • Parameter descriptions and examples

🔐 Authentication

Authentication is optional and can be enabled by setting the API_AUTH_TOKEN environment variable:

# In .env file
API_AUTH_TOKEN=your-secure-token-here

Using Authentication

Bearer Token (Recommended):

curl -H "Authorization: Bearer your-secure-token-here" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "A sunset over mountains"}' \
  http://localhost:3070/api/generate-image

Query Parameter (Alternative):

curl -X POST \
  "http://localhost:3070/api/generate-image?token=your-secure-token-here" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "A sunset over mountains"}'

⚙️ Configuration Options

All configuration is done via environment variables in .env:

VariableDescriptionDefault
GEMINI_API_KEYRequired - Google Gemini API key-
API_AUTH_TOKENOptional - API authentication token-
MCP_AUTH_TOKENOptional - MCP server authentication-
PORTWeb server port3070
OUTPUT_DIRBase directory for generated files./generated-images
LOG_LEVELLogging level (debug, info, warn, error)info
CORS_ORIGINSComma-separated allowed origins*
RATE_LIMIT_MAXMax requests per 15min per IP100
GENERATION_RATE_LIMITMax generation requests per 15min20
ENABLE_CACHEEnable response cachingtrue

🧪 Testing

# Run all tests
npm test

# Run tests in watch mode
npm run test:watch

# Run tests with coverage report
npm run test:coverage

Current Test Coverage:

  • 2 test suites
  • 17 tests passing
  • Coverage: Authentication, Tool Schemas, Input Validation

🐳 Docker Deployment

# Start services
docker-compose up -d

# View logs
docker-compose logs -f

# Stop services
docker-compose down

Manual Docker Build

# Build image
docker build -t gemini-image-gen-mcp .

# Run container
docker run -d \
  -p 3070:3070 \
  -e GEMINI_API_KEY=your_key_here \
  -v $(pwd)/generated-images:/app/generated-images \
  -v $(pwd)/generated-videos:/app/generated-videos \
  gemini-image-gen-mcp

🔌 Usage with Claude

Claude Desktop Configuration

Add to your Claude Desktop config file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "gemini-image-generation": {
      "command": "node",
      "args": ["/full/path/to/gemini-image-gen-mcp/src/mcp-server.js"],
      "env": {
        "GEMINI_API_KEY": "your-gemini-api-key-here"
      }
    }
  }
}

Claude API Usage

# Example prompt to Claude
"Please generate an image of a serene mountain landscape at sunset using the Gemini image generation tool"

Claude will automatically invoke the MCP server's generate_image tool.

🎨 Web Interface

The web interface provides three main sections:

1. Generator Tab

  • Enter text prompts for image/video generation
  • Adjust generation parameters (temperature, topP, topK)
  • Use sample prompts for quick testing
  • View generation results with enhanced prompts
  • Browse all generated images and videos
  • Pagination support (20 items per page)
  • Sorted by newest first
  • Click to view full size

3. About Tab

  • Project information
  • Feature list
  • Configuration details
  • API documentation links

📊 Performance & Optimization

Response Caching

  • Automatically caches successful generation results
  • 30-minute TTL (configurable)
  • Reduces API costs for repeated prompts
  • Cache key includes: prompt + model + parameters
  • View cache stats at /api/cache/stats

Exponential Backoff

  • Smart video polling (2s → 30s max)
  • Reduces API calls by ~60%
  • Prevents API rate limiting

Async I/O

  • Non-blocking file operations
  • Improved server responsiveness
  • Better handling of concurrent requests

Pagination

  • Constant memory usage
  • Handles galleries with thousands of items
  • Sorted by modification time

🛡️ Security Features

  • ✅ Input Validation - All parameters validated with express-validator
  • ✅ Rate Limiting - Two-tier system (general + generation specific)
  • ✅ Request Size Limits - 10MB max to prevent DoS
  • ✅ CORS Configuration - Environment-based origin control
  • ✅ Optional Authentication - Token-based API security
  • ✅ No Hardcoded Secrets - All credentials via environment variables

🔧 Troubleshooting

Common Issues

"GEMINI_API_KEY is not set" error:

# Make sure .env file exists and contains:
GEMINI_API_KEY=your_actual_key_here

Port already in use:

# Change port in .env file:
PORT=3080

Cache not working:

# Check cache is enabled in .env:
ENABLE_CACHE=true
# View cache stats:
curl http://localhost:3070/api/cache/stats

Rate limit exceeded:

# Increase limits in .env:
RATE_LIMIT_MAX=200
GENERATION_RATE_LIMIT=50

📝 Example API Requests

Generate an Image

curl -X POST http://localhost:3070/api/generate-image \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A futuristic cityscape at night with neon lights",
    "temperature": 0.8,
    "topP": 0.95,
    "topK": 40
  }'

Generate a Video

curl -X POST http://localhost:3070/api/generate-video \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A bird flying through a forest",
    "temperature": 1.0
  }'

List Images with Pagination

curl "http://localhost:3070/api/images?page=1&limit=10"

🤝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Run tests before committing: npm test
  • Follow existing code style
  • Update documentation for new features
  • Add tests for new functionality

📄 License

ISC

🙏 Acknowledgments

📞 Support

For issues and questions:

  • Open an issue on GitHub
  • Check the API Documentation
  • Review the troubleshooting section above

Made with ❤️ for the AI community

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Gemini Image & Video Generation MCP from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/gemini-image-gen-mcp)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related media design MCP Servers

Alternative and complementary servers in the same category

View all in media design →

A Rust CAD application with an MCP server for creating, inspecting and rendering drawings, either headlessly or through a connection to the desktop app.

8K
Media & Design
Liquid Composer
liquid-composer•frontedu

Liquid Composer is a browser-based Liquid Glass icon design tool that offers a local MCP server for agent-driven icon workflows.

69
Media & Design

agent-media makes short drama series and other short vertical videos from Claude, ChatGPT or Codex through one MCP connection, with OAuth sign-in and no API keys.

1
Media & Design