MCP Nano Banana
Exposes Google Gemini's image generation capabilities (Nano Banana models) for text-to-image generation, image editing, and image composition with support for various aspect ratios and resolutions up to 4K.
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., "@MCP Nano Banana generate a photorealistic image of a cyberpunk street at night with neon signs and rain"
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
An MCP (Model Context Protocol) server that exposes Google Gemini's image generation capabilities (Nano Banana / Nano Banana Pro) as tools that Claude can use.
Installation
git clone https://github.com/Pgarciapg/mcp-nano-banana.git
cd mcp-nano-banana
npm install
npm run buildRelated MCP server: Banana Image MCP
Features
Text-to-Image Generation: Generate images from text prompts
Image Editing: Edit existing images using natural language
Image Composition: Combine multiple images into new compositions
Two Models Available:
nano-banana(gemini-2.5-flash-image): Fast, efficient, 1024px resolutionnano-banana-pro(gemini-3-pro-image-preview): Advanced, up to 4K, with thinking mode
Setup
1. Get a Gemini API Key
Go to Google AI Studio
Create or select a project
Generate an API key
2. Set Your API Key
Add your Gemini API key to your shell profile (~/.zshrc or ~/.bashrc):
export GEMINI_API_KEY="your-api-key-here"Then reload your shell:
source ~/.zshrc3. Configure Claude Code
Add the server to Claude Code's MCP config. Edit ~/.claude/.mcp.json:
{
"mcpServers": {
"gemini-imagen": {
"command": "node",
"args": ["/path/to/mcp-nano-banana/dist/index.js"],
"env": {
"GEMINI_API_KEY": "${GEMINI_API_KEY}",
"IMAGEN_OUTPUT_DIR": "/path/to/output/folder"
}
}
}
}4. Restart Claude Code
After configuring, restart Claude Code to load the new MCP server.
Available Tools
generate_image
Generate an image from a text prompt.
Parameters:
prompt(required): Text description of the image to generatemodel:nano-banana(default) ornano-banana-proaspect_ratio:1:1,2:3,3:2,3:4,4:3,4:5,5:4,9:16,16:9,21:9image_size:1K,2K,4K(only for nano-banana-pro)filename: Optional output filename
edit_image
Edit an existing image using text prompts.
Parameters:
prompt(required): Description of the edit to makeimage_path(required): Path to the input imagemodel: Model to use for editingaspect_ratio: Optional aspect ratio for outputimage_size: Resolution (only for nano-banana-pro)filename: Optional output filename
compose_images
Combine multiple images into a new composition.
Parameters:
prompt(required): How to combine the imagesimage_paths(required): Array of paths to input imagesmodel: Model to use (nano-banana-pro recommended)aspect_ratio: Aspect ratio for outputimage_size: Resolution (only for nano-banana-pro)filename: Optional output filename
Usage Examples
Generate a simple image
"Generate an image of a sunset over mountains with a cabin in the foreground"Edit an existing image
"Add a wizard hat to the cat in this image" + provide image_pathCombine multiple images
"Put the dress from the first image on the model from the second image" + provide image_paths arrayPrompting Tips
Be Descriptive: Describe scenes narratively, not as keyword lists
Specify Style: Use photography terms for photorealistic images (lens type, lighting, angles)
Include Details: Mention colors, textures, lighting, and mood
Use Templates: For specific styles (product photos, logos, etc.), follow proven templates
Environment Variables
GEMINI_API_KEY(required): Your Google Gemini API keyIMAGEN_OUTPUT_DIR(optional): Directory for generated images (defaults to./generated-images)
License
MIT
Available Tools
3 toolscompose_imagesA
Combine multiple images into a new composition.
nano-banana supports up to 3 input images. nano-banana-pro supports up to 14 input images (up to 5 humans, 6 objects).
Great for:
Product mockups
Fashion photos (dress on model)
Creative collages
Style transfer from multiple references
Inputs: prompt (required), image_paths (required), model, aspect_ratio, +2 more.
edit_imageA
Edit an existing image using text prompts. Supports:
Adding/removing elements
Style transfer
Inpainting (changing specific parts)
Combining multiple images
Provide the path to an existing image and describe the changes you want.
Inputs: prompt (required), image_path (required), model, aspect_ratio, +2 more.
generate_imageA
Generate an image from a text prompt using Google Gemini's image generation.
Models available:
nano-banana (gemini-2.5-flash-image): Fast, efficient, 1024px resolution. Best for high-volume tasks.
nano-banana-pro (gemini-3-pro-image-preview): Advanced, up to 4K resolution, with thinking mode. Best for professional assets.
Tips for better results:
Describe the scene narratively, don't just list keywords
Be specific about lighting, camera angles, and styles
Use photography terms for photorealistic images
Specify aspect ratio based on your use case
Inputs: prompt (required), model, aspect_ratio, image_size, +1 more.
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: compose_images combines multiple images into a composition, edit_image modifies an existing image with text prompts, and generate_image creates a new image from a text prompt. There is no overlap in functionality, making it easy for an agent to select the correct tool.
All tool names follow a consistent verb_noun pattern (compose_images, edit_image, generate_image), using snake_case throughout. The naming is predictable and readable, with no deviations in style.
With 3 tools, the server is well-scoped for image generation and editing tasks. Each tool serves a unique and essential function in the domain, making the count appropriate and efficient for the server's purpose.
The tool set covers core image manipulation workflows: generation, editing, and composition. However, there is a minor gap in operations like deleting or managing images, which might be needed for a full lifecycle, but agents can likely work around this given the server's focus on creation and modification.
Maintenance
Related MCP Connectors
Generate and edit images (PNG, transparent, GIF, SVG) with GPT Image and Nano Banana models.
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.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to generate images from text prompts and transform existing images using Google Gemini's nano banana model through the Nanana AI service. Supports both text-to-image generation and image-to-image transformation capabilities.2154 npm10MIT
- 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.-