๐ŸŽจ Gemini Image MCP Server

AI-powered image generation and editing using Google's Gemini 2.0 Flash model. Generate images from text prompts and edit existing images with natural language instructions.

๐Ÿ› ๏ธ Available Tools

generate_image
Generate images from text prompts using Gemini 2.0 Flash image model. Returns image data with optional text description.
edit_image
Edit existing images with natural language instructions. Provide base64-encoded image data and editing prompt.
๐Ÿงช Test MCP Connection (Stage 1)

Test that your x-api-key is valid and the server accepts connections.

๐ŸŽจ Test Image Generation (Stage 2)

Test full image generation with your Gemini API key.

๐Ÿ“– API Documentation

Required Headers

x-api-key: your-mcp-api-key (Stage 1 - MCP auth)
x-gemini-api-key: your-gemini-api-key (Stage 2 - Gemini credentials)
Content-Type: application/json

Endpoints

GET/ Landing page GET/health Health check POST/ Legacy MCP endpoint GET/sse SSE stream (Streamable HTTP) POST/sse MCP request (Streamable HTTP) GET/mcp MCP endpoint (Streamable HTTP) POST/mcp MCP request (Streamable HTTP)

Example: Generate Image

curl -X POST https://gemini-image.mcp.majewscy.tech/ \ -H "Content-Type: application/json" \ -H "x-api-key: YOUR_MCP_KEY" \ -H "x-gemini-api-key: YOUR_GEMINI_KEY" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "generate_image", "arguments": { "prompt": "A cute robot painting a sunset" } } }'

โš ๏ธ Common Errors

403 - Invalid API Key (Stage 1)
Your x-api-key header is missing or incorrect.
โœ… Solution: Verify your MCP API key is correct.
-32001 - Gemini API key required
Missing x-gemini-api-key header when calling tools.
โœ… Solution: Add your Gemini API key via the x-gemini-api-key header.
-32603 - Gemini API error
The Gemini API returned an error (invalid key, quota exceeded, etc).
โœ… Solution: Check your Gemini API key and quota at console.cloud.google.com.

๐Ÿ’“ Health Status

Loading...