Nano Banana MCP
This MCP server lets you generate and edit images using Google Gemini models via natural-language prompts.
Generate new images from text prompts with optional aspect ratios (1:1, 16:9, 9:16, etc.).
Edit a specific existing image file by providing its path and an edit prompt.
Iteratively refine the last generated/edited image with
continue_editingwithout specifying a path.Use optional reference images for style transfer or combining elements during edits.
Configure the Gemini API token at runtime and check whether it is configured.
Check metadata for the last image, such as path and size, to support follow-up edits.
Use configurable Gemini model selection via the
GEMINI_MODELenvironment variable.
Provides tools for generating and editing images using Google Gemini models, with configurable model selection and aspect ratios.
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., "@Nano Banana MCP A futuristic city skyline at sunset with flying cars"
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.
Want images like this generated on autopilot? Join CC Strategic AI +: my 27-day Claude Code mastery program with a 1-click install setup file, and you work with us to land your first AI client in 90 days, or your money back.
Step-by-step guide and setup walkthrough: Nano Banana guide on charlieautomates.com
What is this?
A fork of nano-banana-mcp with one critical upgrade: configurable model selection via environment variable.
The original package hardcodes gemini-2.5-flash-image-preview (shut down January 2026). This fork defaults to gemini-3.1-flash-image-preview and lets you swap models without touching code.
Related MCP server: Gemini Gen MCP
Features
Generate images from text prompts
Edit existing images with natural language
Iterative editing (continue refining the last image)
Multi-image reference support (style transfer, combining elements)
Configurable aspect ratio (1:1, 16:9, 9:16, 3:2, 2:3, 4:3, 3:4, 4:5, 5:4, 21:9, and more)
Configurable Gemini model via
GEMINI_MODELenv var
Setup
Claude Code / Cursor
Add to your .mcp.json:
{
"mcpServers": {
"nano-banana": {
"type": "stdio",
"command": "node",
"args": ["/path/to/nanobanana-mcp/dist/index.js"],
"env": {
"GEMINI_API_KEY": "your-api-key-here",
"GEMINI_MODEL": "gemini-3.1-flash-image-preview"
}
}
}
}Install Dependencies
git clone https://github.com/charlesdove977/nanobanana-mcp.git
cd nanobanana-mcp
npm installGet a Gemini API Key
Go to Google AI Studio
Create a new API key
Add it to your MCP config as
GEMINI_API_KEY
Models
Set GEMINI_MODEL in your env to any of these (or omit it to use the default):
Model ID | Tier | Price | Best For |
| Flash (default) | ~$0.045/img | Speed + quality balance |
| Pro | ~$0.134/img | Highest quality, best text rendering |
| Legacy Flash | ~$0.039/img | Budget, high-volume |
All models support both generation and editing through the same API.
Tools
Tool | Description |
| Create a new image from a text prompt (optional |
| Modify an existing image file with a prompt (optional |
| Keep refining the last generated/edited image (optional |
| Check the path and size of the last image |
| Set API key at runtime |
| Check if API key is configured |
Aspect Ratios
All image tools accept an optional aspectRatio parameter. Supported values:
1:1 2:3 3:2 3:4 4:3 4:5 5:4 9:16 16:9 21:9 1:4 1:8 4:1 8:1
Examples
Generate (default 1:1):
"A futuristic city skyline at sunset with flying cars"
Generate (16:9 widescreen):
prompt: "A futuristic city skyline at sunset with flying cars", aspectRatio: "16:9"
Edit:
Edit
photo.png: "Remove the background and replace with a gradient"
Continue editing:
"Make the colors more vibrant and add lens flare"
Image Storage
Generated images are saved to ./generated_imgs/ in your working directory (macOS/Linux) or ~/Documents/nano-banana-images/ (Windows).
Credits
Forked from ConechoAI/Nano-Banana-MCP. Updated with configurable model support and latest Gemini models.
License
MIT
Available Tools
6 toolsconfigure_gemini_tokenA
Configure your Gemini API token for nano-banana image generation
Inputs: apiKey (required).
continue_editingA
Continue editing the LAST image that was generated or edited in this session, optionally using additional reference images. Use this for iterative improvements, modifications, or changes to the most recent image. This automatically uses the previous image without needing a file path.
Inputs: prompt (required), aspectRatio, referenceImages.
edit_imageA
Edit a SPECIFIC existing image file, optionally using additional reference images. Use this when you have the exact file path of an image to modify.
Inputs: prompt (required), imagePath (required), aspectRatio, referenceImages.
generate_imageA
Generate a NEW image from text prompt. Use this ONLY when creating a completely new image, not when modifying an existing one.
Inputs: prompt (required), aspectRatio (required).
get_configuration_statusA
Check if Gemini API token is configured
Inputs: no named parameters.
get_last_image_infoA
Get information about the last generated/edited image in this session (file path, size, etc.). Use this to check what image is currently available for continue_editing.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose: configuration, generation, file-specific editing, last-image editing, status check, and info retrieval. The descriptions explicitly clarify boundaries, especially between edit_image (specific file) and continue_editing (last image).
All tool names follow a consistent verb_noun pattern in snake_case (configure_gemini_token, generate_image, edit_image, get_configuration_status, continue_editing, get_last_image_info). Minor variation like 'continue_editing' still starts with a verb, maintaining a predictable style.
With 6 tools, the set is well-scoped for an image generation/editing server. It covers configuration, creation, editing, iteration, and status/info queries without unnecessary bloat or missing essentials.
The core lifecycle is covered: configure, generate, edit, continue editing, and retrieve info. Minor gaps exist, such as no explicit list or delete operations for generated images, but these are peripheral to the primary generation/editing workflow.
Related MCP Connectors
MCP server for Qwen Image 3 AI image generation
MCP server for Google Veo AI video generation
MCP server for Flux AI image generation
MCP server for Grok Imagine AI video generation
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP server for image generation using the Gemini API.1160 npm2MIT
- AlicenseBqualityDmaintenanceMCP server for generating images and audio using Google's Gemini AI models.2106 PyPI2MIT
- AlicenseAqualityDmaintenanceMCP server for generating and editing images using Google Gemini API, with support for multi-turn iterative refinement.3135 npmMIT
- AlicenseNot gradedqualityDmaintenanceMCP server for AI image generation using Google Gemini models with intelligent model selection between Flash and Pro, supporting aspect ratios and search grounding.MIT