nano-banana
Generates images through Google's Gemini (Nano Banana) image generation API from a text prompt, supporting configurable aspect ratios and custom output filenames, with generated images saved to a local output directory.
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 Generate a 16:9 image of a futuristic city at sunset"
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.
MCP Nano Banana
MCP server for image generation using Nano Banana (Gemini). Use it with Claude Code to generate images directly from your prompts.
Setup
1. Get a Gemini API Key
Go to Google AI Studio
Create a new API key
Save it securely (you'll use it in step 3)
2. Build the server
git clone https://github.com/baiano/mcp-nano-banana.git
cd mcp-nano-banana
npm install
npm run build3. Store the API key securely
Add the key to your shell profile (~/.zshrc or ~/.bashrc):
echo 'export GEMINI_API_KEY=your_key_here' >> ~/.zshrc
source ~/.zshrcAlternatively, you can set it per-project in the Claude Code MCP config (see below).
4. Add to Claude Code
Run the following command:
claude mcp add nano-banana -- node /absolute/path/to/mcp-nano-banana/dist/index.jsOr add it manually to ~/.claude/settings.json:
{
"mcpServers": {
"nano-banana": {
"command": "node",
"args": ["/absolute/path/to/mcp-nano-banana/dist/index.js"],
"env": {
"GEMINI_API_KEY": "your_key_here"
}
}
}
}If you set GEMINI_API_KEY in your shell profile, you can omit the env block.
5. Optional: custom output directory
By default, images are saved to ~/Pictures/nano-banana/. Override it with:
{
"env": {
"GEMINI_API_KEY": "your_key_here",
"NANO_BANANA_OUTPUT_DIR": "/path/to/your/folder"
}
}Related MCP server: Gemini Image MCP Server
Usage
Once configured, just ask Claude Code to generate images naturally:
"Generate an image of a medieval knight in pixel art style"
"Create a 16:9 landscape of a futuristic city at sunset"
"Draw a cute cartoon cat with a wizard hat, save as wizard-cat.png"
Claude will recognize the intent and call the generate_image tool via MCP.
Tool: generate_image
Parameter | Required | Description |
| Yes | Detailed description of the image to generate |
| No |
|
| No | Custom filename (e.g. |
Development
npm test # Run tests
npm run build # Compile TypeScriptAvailable Tools
3 toolsgenerate_imageA
Generate an image using Nano Banana (Gemini). Saves the image to disk and returns the file path. Use this tool whenever the user asks to generate, create, draw, or make an image, picture, illustration, photo, artwork, or visual.
Inputs: prompt (required), model, filename, aspect_ratio.
list_modelsB
List all available image generation models for Nano Banana.
Inputs: no named parameters.
set_modelC
Change the active image generation model for Nano Banana.
Inputs: model (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: generate an image, list available models, and set the active model. There is no overlap or ambiguity between these operations.
All tools follow a consistent snake_case verb_noun pattern: generate_image, list_models, set_model. The convention is predictable and readable.
Three tools is well-scoped for this server's purpose. Each tool earns its place, covering generation and model management without unnecessary bloat.
The core lifecycle (generate image) and model management (list, set) are covered. A minor gap is the absence of an explicit way to query the currently active model, though list_models may implicitly indicate it.
Maintenance
Related MCP Connectors
Generate images and video from Claude with one API key.
Generate and edit images and create short videos inside Claude. Prepaid credits, no subscription.
Make any photo or video you can describe, right from Claude.
Use AI models for chat, image, and video generation from Claude Code and other MCP hosts.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables Claude and other AI assistants to generate high-quality images up to 4K resolution using Google's Gemini image models, with support for flexible aspect ratios, natural language editing, and Google Search grounding for accurate results.412MIT
- FlicenseNot gradedqualityDmaintenanceEnables image generation and prompt enhancement within Claude.ai by leveraging Google Gemini models. It allows users to create visual content in various styles like photorealistic and 3D render directly through natural language.-
- FlicenseNot gradedqualityDmaintenanceEnables Claude to generate and edit images using Google Gemini AI.-
- AlicenseNot gradedqualityDmaintenanceEnables Claude to generate images on demand using the FLUX.1-schnell model, supporting multiple aspect ratios and saving locally.MIT