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.
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | Path to the image | |
| question | No | Specific question about the image | |
| systemInstruction | No | System instruction to guide the model's behavior |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It discloses the default model (gemini-2.5-flash), which is useful, but does not mention that it sends image data to an external API, potential rate limits, or that it performs no modification (read-only behavior). The description is not misleading but lacks depth.
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?
A single, focused sentence that front-loads the purpose and adds the crucial default model detail. No redundant words or 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?
The tool is relatively simple with 3 params (1 required) and no output schema. The description states the return type (text description) and model, which is sufficient for an AI agent to invoke it generally. However, it doesn't mention the optional question/systemInstruction behaviors, but these are self-explanatory from the schema. Given the simplicity, the description is nearly complete.
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 description coverage is 100%, so baseline is 3. The description adds no extra parameter-specific semantics beyond what the schema already provides. The default model note is not parameter-related, so the tool description does not enhance parameter understanding.
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?
Description clearly states the verb (get) and resource (text description of an image), and it implicitly differentiates from siblings generate_image/edit_image by focusing on analysis of an existing image. The addition of the default model further clarifies scope.
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?
Usage is implied (use when you need a text description of an image), but no explicit mention of when not to use it or alternatives. The presence of question parameter is not explained, so the description doesn't guide on whether to use this for specific queries or just general description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | Image size (512, 1K, 2K, 4K) | |
| prompt | Yes | What to change in the image | |
| filePath | Yes | Path to the source image | |
| aspectRatio | No | Aspect ratio of the output image | |
| negativePrompt | No | Things to exclude from the edited image | |
| systemInstruction | No | System instruction to guide the model's behavior | |
| additionalFilePaths | No | Additional image paths for multi-image editing (up to 9) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. It discloses output behavior (thumbnail preview, full-res saved to /root/nano-banana-output), the multi-image limit (up to 10 total), and the default model, going beyond basic operation. It does not mention potential side effects like overwriting, but the output path suggests new files.
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 concise, front-loaded with the core purpose, and then provides specific details about model, multi-image support, and output. Every sentence adds value with no waste.
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 absence of output schema and annotations, the description sufficiently explains what the tool does and what the user gets (thumbnail preview, full-res saved to path). It is complete for a basic edit tool, though it lacks error handling details or explicit prerequisites.
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 description coverage is 100%, so the parameters are already well-documented. The description adds context about multi-image input (up to 10 total) which maps to additionalFilePaths, but this is inferable from the schema. No significant extra semantics are provided.
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 the tool's function with a specific verb ('Edit'), resource ('existing image'), and method ('text instruction'). It distinguishes itself from siblings (generate_image, describe_image) by focusing on modification rather than generation or description.
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 when to use the tool ('Edit an existing image') and provides context about multi-image input and output behavior. However, it does not explicitly reference alternative sibling tools or state exclusions, so it stops short of full usage guidelines.
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 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.
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | Number of images to generate (1-4, default 1) | |
| size | No | Image size (512, 1K, 2K, 4K) | |
| prompt | Yes | Text description of the image to generate | |
| aspectRatio | No | Aspect ratio of the generated image | |
| negativePrompt | No | Things to exclude from the generated image | |
| systemInstruction | No | System instruction to guide the model's behavior |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It adds valuable context by specifying the default model (gemini-3.1-flash-image-preview), batch generation capability, and the response format (thumbnail preview) plus the full-resolution save location (/root/nano-banana-output). This goes beyond the basic function and discloses the side effect of saving a file to disk.
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 three sentences long, each earning its place: the first states the core purpose, the second gives the default model and batch support, and the third explains output behavior. It is front-loaded with the most important information and contains no filler or repetition.
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 there is no output schema, the description adequately covers return values by stating that a thumbnail preview is returned and the full-resolution image is saved to a specific path. It also provides the default model and batch range. It could be more complete by mentioning potential errors or limitations, but for a generation tool this is a solid level of context.
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 already provides detailed descriptions for all 6 parameters (100% coverage), so the description does not need to explain parameter syntax. It does touch on batch generation (n=1-4), which aligns with the schema, but adds no semantic nuance beyond what the schema already offers. The baseline of 3 is appropriate since the schema handles the heavy lifting.
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 the tool's function with a specific verb and resource: 'Generate an image from a text prompt using Google Gemini.' This not only describes what it does but also naturally distinguishes it from its siblings (edit_image, describe_image), as those involve modifying or analyzing images rather than creating them.
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 the tool is for generating new images from prompts, which provides clear context for when to use it. However, it does not explicitly mention alternatives or exclusions, such as 'for editing existing images use edit_image' or 'use describe_image to analyze an image.' The usage guidance is therefore implied rather than explicitly stated.
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
describe_image - First observed
edit_image - First observed
generate_image
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 NanoBanana AI image generation and editing
MCP server for Qwen Image 3 AI image generation
MCP server for Flux AI image 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.6403 npmMIT
- AlicenseBqualityCmaintenanceMCP server for generating images and audio using Google's Gemini AI models.22MIT
- AlicenseBqualityBmaintenanceAn MCP server for AI-powered image generation, editing, analysis, and transformation using Google's Gemini and Imagen 4 models.192AGPL 3.0
- AlicenseAqualityDmaintenanceMCP server for Google Gemini image generation with configurable model support, enabling text-to-image generation, image editing, and iterative refinement.640MIT