nano-banana
Generates images using Google's Gemini image models, saving output locally as JPEG.
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-bananagenerate an image of a cat wearing a 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.
Nano Banana MCP Server
A local stdio MCP server for Gemini-powered image generation.
Features
Simple MCP to generate images with Google's Gemini image models
Save generated output to local disk as JPEG
Return both user-facing content and structured tool output for clients
Run locally via stdio (no HTTP transport in this project)
Related MCP server: Nano Banana MCP Server
Prerequisites
Node.js 20+
Gemini API key from Google AI Studio
Install
git clone https://github.com/priorwave/nano_banana_mcp_server/
cd nano-banana-mcp
npm install
npm run buildConfiguration
Set an API key in your shell profile:
export GEMINI_API_KEY="your-key-here"
# GOOGLE_API_KEY is also supportedOptional model override:
export GEMINI_IMAGE_MODEL="gemini-2.5-flash-image"Configure your MCP client to run this server locally via stdio:
{
"mcpServers": {
"nano-banana": {
"command": "node",
"args": ["/absolute/path/to/nano_banana_mcp_server/dist/index.js"],
"env": {
"GEMINI_API_KEY": "${GEMINI_API_KEY}"
}
}
}
}Tool: generate_image
Parameter | Required | Description |
| Yes | Prompt text for generation (1-4000 chars) |
| No | Optional output path (absolute or relative). If directory, a timestamped |
The tool returns:
Text status content
Image content
Structured output with
file_path,mime_type,model, and optionaltext
Development
Build:
npm run buildStart:
npm startTest:
npm test
Available Tools
1 toolgenerate_imageGenerate ImageA
Generate an image from a text prompt using Google Gemini and save the JPEG to disk.
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | Descriptive text prompt for generating the image | |
| save_path | No | Optional path to save the JPEG image. Supports absolute or relative paths. If omitted, the server saves to IMAGE_OUTPUT_DIR or a default local output directory. |
Output Schema
| Name | Required | Description |
|---|---|---|
| text | No | Optional text response from the model |
| model | Yes | Gemini model used for generation |
| file_path | Yes | Absolute path where the generated image was saved |
| mime_type | Yes | MIME type for generated image bytes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already indicate the tool is not read-only and has side effects. The description adds context by naming the external service (Google Gemini) and the side effect of saving a JPEG to disk. It also clarifies the output format, going beyond what annotations provide.
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 sentence that is directly relevant and front-loaded with the main action. It avoids unnecessary detail and clearly communicates the purpose and key behavior.
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's simplicity (2 parameters, output schema present, annotations provided), the description is sufficiently complete. It mentions the key side effect (saving to disk) and the technology (Gemini). A minor gap is the lack of any error handling or rate-limit information, but this is not critical for a straightforward generation tool.
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 input schema provides full descriptions for both 'prompt' and 'save_path', covering 100% of parameters. The description itself does not add extra semantics about parameters beyond what is in the schema, so it aligns with the baseline for high coverage.
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 action ('Generate an image from a text prompt using Google Gemini') and the output ('save the JPEG to disk'). It is specific and leaves no ambiguity about what the tool does. Even without siblings, it distinguishes itself by naming the model and output format.
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 implicitly tells when to use this tool: whenever an image needs to be generated from a text prompt and saved to disk. It does not explicitly mention exclusions or alternatives because there are no sibling tools, so this is acceptable. It provides clear functional context.
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.
1 tool update
v1.0.0- First observed
generate_image
TDQS
Scored across 1 tool
Only one tool exists, so there is no possibility of confusing it with other tools. Its purpose is clearly defined.
With a single tool, the naming is inherently consistent and follows a clear verb_noun pattern (generate_image).
A single tool feels thin for a server, but it may be appropriate if the server's entire purpose is image generation. Still, it is borderline and likely lacks broader functionality.
The tool provides the core image generation capability with no obvious dead ends, though a more complete surface might include options like output path or resolution controls. Minor gaps exist but are workable.
Maintenance
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.
MCP server for Flux AI image generation
Related MCP Servers
- AlicenseBqualityCmaintenanceAn MCP server for image generation using the Gemini API.133 npm2MIT
- 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-
- AlicenseAqualityDmaintenanceA minimal MCP server that wraps Google Gemini image generation, enabling users to generate images via a single tool prompt in Claude Code or other MCP hosts, with automatic filename collision handling.1MIT
- FlicenseAqualityDmaintenanceMCP server that generates images using Gemini models via an OpenAI-compatible gateway.19-