nano-banana-mcp
Generates images using Google Gemini models, supporting multiple model variants (e.g., gemini-2.5-flash-image, gemini-3.1-flash-image-preview, gemini-3-pro-image-preview).
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., "@nano-banana-mcpgenerate an image of a cat wearing a hat and save it to ~/Desktop/cat.png"
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.
nano-banana-mcp
A minimal MCP server that wraps Google Gemini image generation ("Nano Banana") for use inside Claude Code or any other MCP-compatible host.
Built as part of an exploration of agentic workflows for K-12 teaching materials. The whole server is about 75 lines of Python — readable in one sitting.
What it does
Exposes a single tool:
generate_image(prompt: str, output_path: str, model: str | None = None) -> strWrites a PNG to
output_pathAuto-suffixes on collision (
foo.png→foo-1.png,foo-2.png, …) — never silently overwritesReturns the absolute path it actually wrote to
Related MCP server: Gemini Image Generation MCP
Install on a new machine
You need:
Homebrew (macOS)
A Gemini API key from Google AI Studio
Claude Code (or another MCP host)
brew install pipx
pipx ensurepath
pipx install git+https://github.com/DenialGelon/nano-banana-mcp
claude mcp add nano-banana --scope user \
--env GEMINI_API_KEY=<your-key> -- nano-banana-mcpVerify with claude mcp list — you should see nano-banana: ✓ Connected.
Use
Start a fresh Claude Code session and ask:
Generate an image of a friendly cartoon banana mascot and save it to ~/Desktop/banana.png
Claude will pick up the tool and call it. The return value tells you the final path (with a note if a collision was auto-resolved).
Models
The model argument is optional. Known values (verified 2026-05-18 at the Gemini image-generation docs):
Model string | Nickname | Use for |
| Nano Banana | Fast / cheap drafts |
| Nano Banana 2 | Higher quality, balanced |
| Nano Banana Pro | Top quality, costliest |
Update / rotate the key
Update the code:
pipx install --force git+https://github.com/DenialGelon/nano-banana-mcpRotate the API key:
claude mcp remove nano-banana --scope user
claude mcp add nano-banana --scope user \
--env GEMINI_API_KEY=<new-key> -- nano-banana-mcpLicense
MIT — see LICENSE.
Available Tools
1 toolgenerate_imageA
Generate an image with Gemini and save it to output_path.
Known model values (override via model):
gemini-2.5-flash-image (default — Nano Banana, fastest/cheapest)
gemini-3.1-flash-image-preview (Nano Banana 2, higher quality)
gemini-3-pro-image-preview (Nano Banana Pro, top quality)
If output_path already exists, a numeric suffix is appended (foo.png -> foo-1.png) and the final path is returned.
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | ||
| output_path | Yes | ||
| model | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Discloses the non-overwriting behavior (appending numeric suffix) and indicates that the final path is returned. With no annotations, this is above average transparency, though lacks detail on failure handling or authorization.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Economical two-sentence structure: first sentence gives the main action, then bullet-style model list and a clear conflict rule. No filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has an output schema (which documents return structure) and only three parameters, the description covers model selection and file conflict behavior. Missing details on error handling or input format, but sufficient for basic usage.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Adds meaning to the 'model' parameter by listing known values and their trade-offs, but 'prompt' and 'output_path' receive no extra description beyond their names. Schema coverage is 0%, so description partially compensates.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states the action ('generate an image') and the destination ('save to output_path'), with specific reference to Gemini. No siblings exist, so differentiation is not needed.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides explicit model variants with nicknames and quality/cost tiers, plus conflict resolution behavior when output path exists. No exclusions or alternatives needed due to no siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
1 tool update
v0.1.0- First observed
generate_image
TDQS
Only one tool exists, so there is no possibility of confusion between tools.
The single tool name 'generate_image' follows a clear verb_noun pattern, consistent with common conventions.
With only one tool, the server feels thin for its apparent scope (image generation), but it covers the primary action without unnecessary bloat.
The tool covers the core generation task, but lacks additional operations such as listing models, managing outputs, or deleting images, leaving minor gaps for an agent.
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
Focused MCP server for OpenAI image/audio generation (v2.0.0). Wraps endpoints via HAPI CLI.
MCP server for Qwen Image 3 AI image generation
Generate AI images and videos from any compatible MCP client.
Use AI models for chat, image, and video generation from Claude Code and other MCP hosts.
Related MCP Servers
- AlicenseAqualityDmaintenanceA local stdio MCP server for generating images using Google's Gemini image models, saving to disk as JPEG.1380MIT
- FlicenseNot gradedqualityCmaintenanceRemote MCP server that exposes a generate_image tool allowing Claude to generate images via the Google Gemini API.-
- FlicenseNot gradedqualityCmaintenanceRemote MCP server (Streamable HTTP) for generating and editing images via Google Gemini, usable as a custom connector in Claude.-
- AlicenseAqualityBmaintenanceA security-first MCP server that generates images via OpenAI's image model (gpt-image-2) and returns them as MCP image content, usable from Claude Code, Claude Desktop, and other stdio MCP clients.1MIT
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/DenialGelon/nano-banana-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server