An MCP (Model Context Protocol) server exposing Google's Gemini API β image generation (Imagen), image editing (Imagen 3), video generation (Veo 3.1), and image analysis (Gemini vision) β as tools for Claude and other MCP clients.
Deployed on Val Town via the MCP Streamable HTTP transport.
π Add GEMINI_API_KEY here: https://www.val.town/x/noppo0152/imagen-mcp-server/environment-variables?key=GEMINI_API_KEY
Get a key from Google AI Studio.
{ "mcpServers": { "gemini": { "url": "https://noppo0152--fead52e689ac11f1be121607ee4eb77e.web.val.run", "transport": "http" } } }
Text-to-image generation with Google Imagen.
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | string | β | Image description (English, max 480 tokens) |
model | string | β | imagen-4.0-generate-001 (default), imagen-4.0-fast-generate-001, imagen-3.0-generate-002 |
sampleCount | number | β | 1β4 images. Default: 1 |
aspectRatio | string | β | 1:1, 16:9, 9:16, 4:3, 3:4 |
personGeneration | string | β | dont_allow, allow_adult, allow_all |
imageSize | string | β | 1K or 2K (only Imagen 4) |
seed | number | β | Reproducible generation seed |
Image-to-image editing with Google Imagen 3.
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | string | β | Edit description |
image | string | β | Base64-encoded source image (no data URI prefix) |
mimeType | string | β | image/png, image/jpeg, image/webp |
model | string | β | Defaults to imagen-3.0-generate-002 |
sampleCount | number | β | 1β4. Default: 1 |
aspectRatio | string | β | 1:1, 16:9, 9:16, 4:3, 3:4 |
personGeneration | string | β | dont_allow, allow_adult, allow_all |
Text-to-video generation with Google Veo 3.1 (8s clips with native audio).
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | string | β | Detailed scene description with camera, dialogue, sound |
model | string | β | veo-3.1-generate-preview (default) |
aspectRatio | string | β | 16:9 (landscape, default) or 9:16 (portrait) |
resolution | string | β | 720p (default), 1080p, 4k |
β±οΈ This is a long-running operation (1β5 min). The server polls until completion and returns base64-encoded MP4 data.
Image analysis and prompt engineering with Gemini vision models.
| Parameter | Type | Required | Description |
|---|---|---|---|
image | string | β | Base64-encoded image (no data URI prefix) |
mimeType | string | β | image/png, image/jpeg, image/webp, image/heic, image/heif |
prompt | string | β | Question or instruction. Default: describe image + suggest enhanced generation prompt |
model | string | β | gemini-2.5-flash (default), gemini-2.0-flash, gemini-1.5-pro |
Implements the MCP Streamable HTTP transport (JSON-RPC 2.0):
- POST β
initialize,tools/list,tools/call,ping - GET β SSE endpoint for server-to-client streaming
main.ts β MCP protocol handler (JSON-RPC, HTTP transport)
tools.ts β Tool definitions + Google API integrations
Imagen models are deprecated and will shut down on August 17, 2026. Google recommends migrating to Nano Banana (gemini-2.5-flash-image) for future image generation needs.