@nanobanana/mcp
Provides tools for generating and editing images using Google's Gemini image models (Nano Banana).
Click on "Deploy 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., "@@nanobanana/mcpgenerate an image of a cat wearing a wizard hat"
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.
@nanobanana/mcp ๐
A lean MCP server for Google's Nano Banana (Gemini) image models and Veo video models. It generates and edits images and generates video from any MCP client (Claude Code, Claude Desktop, Cursor) and hands back file paths instead of base64, so your agent's context stays small.
Six tools and nothing else:
generate_image,edit_image,generate_video,extend_video,get_video_result,list_modelsDefaults to Nano Banana 2 (
gemini-3.1-flash-image) and Veo 3.1 Fast (veo-3.1-fast-generate-preview). Switch models per call or via env. If a pinned model id ever goes stale,list_modelsshows what your key can actually use.Multi-image editing: pass reference images for style transfer, characters, or compositing
Control over aspect ratio (
1:1through21:9, out to1:4and8:1) and resolution (512,1K,2K,4K)Google Search grounding for images that need real-world accuracy, like infographics
Video as a job, not a blocked call: generation takes 1โ6 min, so
generate_videoreturns a job id andget_video_resultpolls within every client's 60s timeoutSafe output paths. The server never writes to
/when a desktop MCP client spawns it there.Auth lives in env vars only, so your API key never passes through chat context
Quick start
Get a free Gemini API key at aistudio.google.com/apikey.
Claude Code
claude mcp add nanobanana -e GEMINI_API_KEY=your_key -- npx -y @nanobanana/mcpAlso listed in the MCP Registry as io.github.getjoystick/nanobanana-mcp.
Claude Desktop / Cursor: add this to claude_desktop_config.json or .cursor/mcp.json:
{
"mcpServers": {
"nanobanana": {
"command": "npx",
"args": ["-y", "@nanobanana/mcp"],
"env": { "GEMINI_API_KEY": "your_key" }
}
}
}Related MCP server: nano-banana-claude
Tools
generate_image
Param | Required | Description |
| โ | Image description |
| Gemini image model id (default | |
|
| |
|
| |
| Ground with Google Search for factual accuracy | |
|
| |
| Save directory (default | |
| Base filename without extension |
edit_image
Same params, plus:
Param | Required | Description |
| โ | Input file path(s): png, jpg, webp, heic, or pdf. The first is the base; the rest are references. |
Both tools save to disk and return the file path.
list_models
Takes no params. Lists the image and video model ids your API key can use, in two sections. Handy when a pinned model id stops working, which is how earlier Nano Banana servers broke โ and Veo's ids are previews that will be renamed.
Video
Veo generation takes 1โ6 minutes, and MCP clients kill a tool call at ~60s. So video is a job: you start one, then poll.
generate_video โ "Video job started: <jobId>"
get_video_result โ "Still processing (<jobId>)โฆ" โ blocks up to 45s, then call again
get_video_result โ "Saved: /path/to/clip.mp4 (veo-3.1-fast-generate-preview)
Veo URI (needed for extend_video; expires ~2 days): https://โฆ"get_video_result does the waiting for you โ each call blocks up to waitSeconds
(45 by default, the most that fits inside a client's 60s timeout). Call it right
away and call it again the moment it returns; there is no need to pause in between,
which matters because an agent has no way to sleep.
The job id carries everything the server needs, so it keeps working even if the
server process restarts in between. Download promptly: Google deletes generated
videos server-side after ~2 days โ and that server-side copy is the only thing
extend_video can extend, so keep the Veo URI if you plan to continue the shot.
Animating an image you just generated? Give generate_image an aspectRatio of
16:9 or 9:16 first. Veo only outputs those two ratios and crops the frame you
hand it, so a square image loses its edges โ and you pay for the clip either way.
generate_video
Param | Required | Description |
| โ | Scene, motion, camera, and any dialogue or SFX โ Veo generates native audio |
| Image path used as the starting frame (image-to-video). Veo crops it to | |
| Image paths for character/object/style consistency: up to 3 for | |
|
| |
| Veo model id (default | |
|
| |
|
| |
|
| |
| What should not appear | |
|
|
Frames (image, referenceImages) must be png or jpg.
extend_video
Extends a Veo-generated clip by ~7s, continuing from its final second. Input up to ~141s, output up to ~148s across at most 20 extensions, always 720p. Not supported by Lite.
Extension runs on Google's copy of the video, not on your local file โ pass the
Veo URI that get_video_result prints. It expires with the video after ~2 days.
Param | Required | Description |
| โ | What happens next |
| โ | The Veo URI from |
| Veo model id (default | |
| What should not appear |
get_video_result
Param | Required | Description |
| โ | The id returned by |
| How long this call blocks waiting for the job (default | |
| Save directory (default | |
| Base filename without extension |
Saves the finished video as .mp4 and returns the absolute path, plus the Veo URI
of the server-side copy that extend_video needs.
Configuration
Env var | Description |
| Required. Gemini API key ( |
| Default image model override |
| Default video model override |
| Default output directory override |
Models
Model id | Notes |
| Default. Nano Banana 2: 4K output, strong text rendering |
| Nano Banana Pro, for complex scenes that need deeper reasoning |
| The original Nano Banana (legacy; Google retires it 2026-10-02) |
Video models
Veo has no free tier โ you need a billing-enabled API key, and you are charged per second of output.
Model id | Price | 8s clip | Notes |
| $0.10/s | ~$0.80 | Default. Full feature set; best quality-per-dollar |
| $0.40/s | ~$3.20 | Full feature set; highest fidelity |
| $0.05/s | ~$0.40 | Cheapest; text- and image-to-video only โ no extension, no reference images, 1080p max |
All three do text-to-video, image-to-video, and native audio. Extension,
reference images, and 4k are Veo 3.1 and 3.1 Fast only. Clips are 4, 6, or 8
seconds, in 16:9 or 9:16.
Development
npm install
npm run build
GEMINI_API_KEY=your_key npm run smoke # end-to-end test against the live API
GEMINI_API_KEY=your_key SMOKE_VIDEO=1 npm run smoke # also generates a 4s clip (~$0.20)Acknowledgements
Inspired by other Nano Banana MCPs. Built with Claude Code.
License
MIT
Available Tools
3 toolsedit_imageA
Edit or combine images per a text prompt. First image is the base; any others are references (style, characters, objects). Saves to disk and returns the file path.
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | Output resolution | |
| model | No | Gemini image model id (default: gemini-3.1-flash-image) | |
| images | Yes | Input image file path(s) | |
| prompt | Yes | Edit instruction | |
| filename | No | Base filename without extension | |
| grounding | No | Ground with Google Search for factual accuracy | |
| outputDir | No | Save directory (default: ./nano-banana) | |
| aspectRatio | No | e.g. 1:1, 16:9, 9:16, 21:9, up to 1:4 or 8:1 | |
| thinkingLevel | No | Model reasoning effort; high helps complex or text-heavy images |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must disclose behavioral traits. It states 'Saves to disk and returns the file path,' which is a key behavior. However, it does not mention whether original input images are modified, overwriting behavior, or output format requirements, leaving gaps in transparency.
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?
The description is two sentences, starting with the core action and then the output behavior. It uses concise, direct language with no unnecessary 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 9 parameters and no output schema, the description covers the essential flow: input images, prompt, save, and return. It would benefit from an explicit note about using generate_image for new images, but overall it is adequate for an agent to understand the tool's purpose and 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?
Schema coverage is 100%, so the description is not required to repeat parameter details. It adds meaning by clarifying the `images` parameter (first is base, others references) and the `prompt` as a 'text prompt,' which enriches the schema definitions.
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?
The description begins with 'Edit or combine images per a text prompt,' which clearly identifies the tool's function as image editing/combination. It also mentions the base/reference role of images, distinguishing it from sibling generate_image which likely creates new images from scratch.
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?
It explains that the first image is the base and others are references, giving clear guidance on how to structure the images array. However, it does not explicitly state when to use this tool over generate_image, so it lacks an explicit exclusion clause.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
generate_imageA
Generate an image from a text prompt. Saves to disk and returns the file path.
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | Output resolution | |
| model | No | Gemini image model id (default: gemini-3.1-flash-image) | |
| prompt | Yes | Image description | |
| filename | No | Base filename without extension | |
| grounding | No | Ground with Google Search for factual accuracy | |
| outputDir | No | Save directory (default: ./nano-banana) | |
| aspectRatio | No | e.g. 1:1, 16:9, 9:16, 21:9, up to 1:4 or 8:1 | |
| thinkingLevel | No | Model reasoning effort; high helps complex or text-heavy images |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description must disclose behaviors, and it does mention saving to disk and returning a file path, which is a key side effect. Yet it omits other important behaviors such as overwrite behavior, permissions, or error handling, leaving gaps in transparency.
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?
The description is two sentences, concise, and front-loaded with the core purpose and return value. It contains no unnecessary words and is well-structured.
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?
For a tool with 8 parameters and no annotations or output schema, the description covers the essential flow: generate, save to disk, and return the file path. It does not provide guidance on model/size selection or potential edge cases, but it is adequate for the tool's simplicity.
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?
The schema provides descriptions for all 8 parameters, so the baseline is 3. The tool description does not add additional meaning beyond the schema's parameter details, so it remains at the baseline.
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?
The description clearly states it generates an image from a text prompt, which is a specific verb+resource combination. It distinguishes from sibling tools edit_image and list_models by focusing on creation from text.
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?
The description provides clear context that this tool is for generating new images from text. However, it does not explicitly state when not to use it or mention alternatives like edit_image for existing images, so it lacks explicit exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_modelsA
List Gemini image model ids usable with generate_image/edit_image.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description only states that it lists IDs, without disclosing any behavioral details such as whether the list is comprehensive, sorted, or if it might return empty. The description is straightforward but does not go beyond the obvious.
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?
The description is a single, focused sentence with no redundant wording. It front-loads the action and resource.
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?
For a simple, no-parameter listing tool, the description adequately conveys its purpose and relationship to sibling tools. Although no output schema exists, the phrase 'List ... ids' sufficiently indicates the return type is a collection of model IDs.
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?
There are zero parameters, so the schema already covers all inputs. The description adds no parameter semantics, but none are needed. Per the baseline for 0-param tools, this scores 4.
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?
The description uses a specific verb 'List' and clearly specifies the resource as 'Gemini image model ids' and its purpose 'usable with generate_image/edit_image'. This distinguishes it from its siblings which perform generation/editing.
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?
The description implies it is used to obtain model ids for generate_image and edit_image, but does not explicitly state when to call it or when not to. It provides clear context but lacks explicit alternative guidance or exclusions.
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.
3 tool updates
v0.2.0- First observed
edit_image - First observed
generate_image - First observed
list_models
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: list_models for available model IDs, generate_image for text-to-image, and edit_image for image editing/combining with references. Descriptions are precise, leaving no ambiguity.
All tool names follow a consistent verb_noun pattern: list_models, generate_image, edit_image. This makes the API predictable and easy to navigate.
With 3 tools, the server is appropriately scoped for image generation and editing. Each tool covers a distinct step in the workflow, and no excessive or redundant tools exist.
The tool set covers the full lifecycle: discovering models, generating images from scratch, and editing/combining existing images. No critical operations are missing for the stated purpose.
Maintenance
Related MCP Connectors
MCP server for NanoBanana AI image generation and editing
MCP server for Qwen Image 3 AI image generation
MCP server for Flux AI image generation
MCP server for Grok Imagine AI video generation
Related MCP Servers
- FlicenseBqualityDmaintenanceAn MCP server that enables image generation using Google's Gemini Nano Banana Pro model via the Google AI Studio API. Users can generate and save images locally by providing text prompts through MCP-compatible clients.1-
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides image generation using Google's Nano Banana Gemini models, with additional tools for background removal, upscaling, and format conversion via deterministic post-processing.1MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for Google's Nano Banana image generation models (Gemini). Generate and edit images via natural language.7 npm1MIT
- AlicenseAqualityDmaintenanceMCP server for generating and editing images using Google Gemini API, with support for multi-turn iterative refinement.325 npmMIT