Gemini Image MCP
Provides integration with Google's Gemini API for generating and editing images using Gemini image models. Supports text-to-image generation, image editing and composition with reference images, and full control over generation parameters such as resolution, aspect ratio, seed, and search grounding.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Gemini Image MCPGenerate a photorealistic image of a golden retriever puppy playing in a field of sunflowers at golden hour"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Gemini Image MCP

An MCP server for generating and editing
images with Google's Gemini image models (Nano Banana, Nano Banana 2, Nano
Banana Pro). It exposes one tool, generate_image, which AI tools like Claude,
Codex, and Cline can call using your own API key.
What it does
generate_imagehandles text-to-image, plus editing and composition when you pass it reference images (local file paths or base64).Every generation knob is exposed per call:
temperature(1),topP(0.95),topK,maxOutputTokens(65536 for flash/lite, 32768 for pro),seed,stopSequences,presencePenalty,frequencyPenalty,systemInstruction,thinkingLevel(minimal/high),thinkingBudget,enableGoogleSearch(default true),imageSize(512/1K/2K/4K),aspectRatio("auto" default + standard ratios),personGeneration.Ships an
instructionsblock and per-parameter descriptions, so MCP clients figure out how to use the tool without extra prompting.Saves images to disk and returns file paths. No base64 in the response, so a 4K image won't eat the client's context window.
Errors come back with hints (bad key, rate limit, safety block, unknown model) instead of a raw API dump.
stdio transport, the usual setup for local MCP servers.
Requirements
Bun 1.0+
A Gemini API key from https://aistudio.google.com/apikey
Install
bun installConfiguration
Three environment variables, normally set in the MCP client's config:
Variable | Required | Default | What it does |
| Yes (or | Your Gemini API key. If both are set, | |
| No |
| Model used when a call doesn't specify one. |
| No |
| Where images go. Created if it doesn't exist. |
Models you can pick:
Model | Max Output Tokens | Thinking Level | Google Search | Max Size | Notes |
| 65536 | minimal / high | Supported | 2K | Nano Banana 2. Fast, cheap, general purpose. The default. |
| 65536 | minimal / high | Supported | 2K | Lightweight, high-throughput model. |
| 32768 | (none) | Supported | 4K | Nano Banana Pro. Best quality and in-image text, and the only one that does 4K. |
Models can also be specified with the models/ prefix (e.g.
models/gemini-3.1-flash-image).
Client setup
Claude Desktop
Add this to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"gemini-image": {
"command": "bun",
"args": ["run", "/absolute/path/to/gemini-image-mcp/index.ts"],
"env": {
"GEMINI_API_KEY": "YOUR_KEY_HERE"
}
}
}
}Cline (VS Code)
cline_mcp_settings.json:
{
"mcpServers": {
"gemini-image": {
"command": "bun",
"args": ["run", "/absolute/path/to/gemini-image-mcp/index.ts"],
"env": {
"GEMINI_API_KEY": "YOUR_KEY_HERE"
}
}
}
}Codex
~/.codex/config.toml:
[mcp_servers.gemini-image]
command = "bun"
args = ["run", "/absolute/path/to/gemini-image-mcp/index.ts"]
env = { GEMINI_API_KEY = "YOUR_KEY_HERE" }From npm (bunx/npx)
Once the package is published, point your client at bunx instead:
{
"mcpServers": {
"gemini-image": {
"command": "bunx",
"args": ["gemini-image-mcp"],
"env": { "GEMINI_API_KEY": "YOUR_KEY_HERE" }
}
}
}generate_image parameters
Only prompt is required. Everything else defaults to something sensible for
image generation.
Parameter | Type | Default | Description |
| string | — (required) | Narrative description of the image, or of the edit when |
| string | env / | Gemini image model (see table above). Accepts |
| array (≤14) | — | Source images for editing/composition: |
|
|
| Output resolution: 512 (fastest, lightweight), 1K (default), 2K, 4K (requires |
| enum |
|
|
| enum |
|
|
| enum |
|
|
| boolean |
| Enables Google Search grounding tool for real-time web knowledge and accuracy across all models. |
| int | — | Explicit thinking budget (0 = off, -1 = auto). |
| number 0–2 |
| Sampling randomness. |
| number 0–1 |
| Nucleus sampling. |
| int | — | Top-k sampling. |
| int 1–65536 | 65536 (flash) / 32768 (pro) | Output token cap. |
| int | — | Best-effort reproducibility. |
| string[] (≤5) | — | Stop sequences for the text portion. |
| number -2..2 | — | Token penalties. |
| string | — | Style/behavior steering, e.g. "flat vector style". |
| string | env / | Where to save. |
| string |
| Base file name (extension auto from MIME type). |
The tool returns a text summary with the saved file path(s), the model, the effective config, and token usage. It never returns image data inline; open the file to see the result.
Things you can ask your AI
"Generate a 16:9 hero image of a rainy Tokyo street at night, cinematic neon lighting."
"Edit
/tmp/product.png: put it on a marble table with soft morning light" (this usesreferenceImages)."Generate a 4K poster with the exact headline 'LAUNCH DAY' using gemini-3-pro-image."
Development
bun test # unit tests (config, schema, request/response parsing)
bun run typecheck # tsc --noEmit
bun run inspector # interactive MCP inspector (needs GEMINI_API_KEY)
bun run start # run the server on stdioTroubleshooting
"Missing Gemini API key": put
GEMINI_API_KEYin theenvblock of the client's MCP config. Setting it in your shell isn't enough for GUI apps like Claude Desktop, since they don't read your shell environment.Safety blocks: rephrase the prompt. If people are involved, check
personGeneration.429 / quota exceeded: wait and retry, or stick to
gemini-3.1-flash-image, which has the higher quota.Logs: the server writes logs to stderr only. stdout carries the MCP protocol, so don't add
console.loganywhere.
Author
Thomi Jasir dev@venobi.com
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server for NanoBanana AI image generation and editing
MCP server for Google Veo AI video generation
MCP server for Flux AI image generation
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/thomijasir/gemini-image-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server