nano-banana-mcp
Generates and edits images using Google Gemini models.
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-mcpgenerate an image of a cat on a beach"
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
Nano Banana MCP server for generating and editing images with Google Gemini. No Gemini CLI required -- just an API key.
Quick Start
Get a Gemini API key from Google AI Studio
Add to your Claude Code settings (
~/.claude/settings.json) or Claude Desktop config:
{
"mcpServers": {
"nano-banana": {
"command": "npx",
"args": ["-y", "@daniel.barta/nano-banana-mcp"],
"env": {
"GEMINI_API_KEY": "your-api-key"
}
}
}
}Restart Claude and ask it to generate an image.
Related MCP server: Gemini Gen MCP
Configuration
Environment Variable | Required | Default | Description |
| Yes | -- | Your Google AI API key |
| No |
| Gemini model for image generation/editing |
| No |
| Gemini model for image description (text-only output) |
| No | -- | Custom base URL for Gemini API (proxy support) |
| No |
| Directory for saved images |
Supported Models
Model | Notes |
| Default. Latest, fastest |
| Higher quality, slower |
| Fast, cost-effective |
Tools
generate_image
Generate an image from a text prompt. Supports batch generation (up to 4 images). Response contains a thumbnail preview; full-res image is saved to disk.
Parameter | Type | Required | Description |
| string | Yes | Text description of the image |
| string | No | Aspect ratio ( |
| string | No | Image size ( |
| number | No | Number of images to generate (1-4, default 1) |
| string | No | Things to exclude from the generated image |
| string | No | System instruction to guide the model |
edit_image
Edit an existing image based on a text instruction. Supports multi-image input (up to 10 images total). Response contains a thumbnail preview; full-res image is saved to disk.
Parameter | Type | Required | Description |
| string | Yes | What to change |
| string | Yes | Path to the source image |
| string[] | No | Additional image paths (up to 9) for multi-image editing |
| string | No | Aspect ratio ( |
| string | No | Image size ( |
| string | No | Things to exclude from the edited image |
| string | No | System instruction to guide the model |
describe_image
Get a text description of an image.
Parameter | Type | Required | Description |
| string | Yes | Path to the image |
| string | No | Specific question about the image |
| string | No | System instruction to guide the model |
Supported Input Formats
For edit_image and describe_image, the following image formats are supported:
JPEG, PNG, WebP, GIF, BMP, TIFF, SVG, HEIC/HEIF
File Path Resolution
When you provide a file path for editing or describing, the server searches for the file in this order:
Absolute path as given
Relative to the current working directory
Relative to the output directory
Basename only in the output directory
Thumbnails
To avoid hitting Claude Code's session file size limits, MCP responses contain thumbnail previews (max 512px, JPEG quality 80, ~20-50KB) instead of full-resolution images. Full-res images are always saved to disk at the path shown in the response metadata.
The first content block in generate/edit responses is a JSON metadata object:
{
"model": "gemini-3.1-flash-image-preview",
"count": 1,
"images": [
{ "filePath": "/Users/you/nano-banana-output/a-cat-1234567890.png", "mimeType": "image/png" }
]
}Development
git clone https://github.com/bartadaniel/nano-banana-mcp.git
cd nano-banana-mcp
npm install
npm run buildUse the local build in your config:
{
"mcpServers": {
"nano-banana": {
"command": "node",
"args": ["path/to/nano-banana-mcp/dist/index.js"],
"env": {
"GEMINI_API_KEY": "your-api-key"
}
}
}
}Testing
npm testRuns unit tests using Node.js built-in test runner (node:test). Tests cover error classes, all documented Gemini API response codes (BlockedReason, FinishReason), config shapes, image extraction edge cases, file operations, path security, and thumbnail generation.
License
MIT
Available Tools
3 toolsdescribe_imageA
Get a text description of an image using Google Gemini. Default model: gemini-2.5-flash.
Inputs: filePath (required), question, systemInstruction.
edit_imageA
Edit an existing image based on a text instruction using Google Gemini. Default model: gemini-3.1-flash-image-preview. Supports multi-image input (up to 10 total). Response contains a thumbnail preview; full-res image is saved to /root/nano-banana-output.
Inputs: prompt (required), filePath (required), size, aspectRatio, +3 more.
generate_imageA
Generate an image from a text prompt using Google Gemini. Default model: gemini-3.1-flash-image-preview. Supports batch generation (n=1-4). Response contains a thumbnail preview; full-res image is saved to /root/nano-banana-output.
Inputs: prompt (required), n, size, aspectRatio, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: generating a new image, editing an existing image, and describing an image. There is no overlap or ambiguity between them.
All tool names follow the consistent verb_noun pattern: generate_image, edit_image, describe_image. This makes the set highly predictable and easy to navigate.
With 3 tools, the server is well-scoped for its purpose of image generation, editing, and analysis. Each tool earns its place and the count is appropriate for the domain.
The tool surface covers the core lifecycle of image handling: create (generate), modify (edit), and understand (describe). There are no obvious gaps for the stated purpose.
Maintenance
Related MCP Connectors
MCP server for Midjourney AI image generation and editing
MCP server for Qwen Image 3 AI image generation
MCP server for Flux AI image generation
MCP server for Google Veo AI video generation
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that provides AI image generation and editing capabilities using Google's Gemini 2.5 Flash Image API. It allows users to create new images from text, modify existing files, and perform iterative edits through natural language prompts.61,595 npmMIT
- AlicenseBqualityDmaintenanceMCP server for generating images and audio using Google's Gemini AI models.272 PyPI2MIT
- AlicenseBqualityBmaintenanceAn MCP server for AI-powered image generation, editing, analysis, and transformation using Google's Gemini and Imagen 4 models.19144 PyPI2AGPL 3.0
- AlicenseAqualityCmaintenanceMCP server for Google Gemini image generation with configurable model support, enabling text-to-image generation, image editing, and iterative refinement.640MIT