Enables text-to-image generation, image editing, and multi-image composition using Google's Gemini AI image generation models (Nano Banana Pro and Nano Banana), with support for various aspect ratios, resolutions up to 4K, text rendering, and real-time Google Search grounding for current events and weather information.
Nano Banana MCP Server
An MCP (Model Context Protocol) server for Google's Nano Banana Pro (Gemini 3 Pro Image) and Nano Banana (Gemini 2.5 Flash Image) AI image generation models.
Features
🎨 Text-to-Image Generation - Create images from natural language descriptions
✏️ Image Editing - Modify existing images with text prompts
🖼️ Multi-Image Composition - Combine up to 14 reference images
📐 Flexible Aspect Ratios - 10 aspect ratio options (1:1, 16:9, 9:16, etc.)
🔍 High Resolution - Up to 4K output with Nano Banana Pro
🔤 Text Rendering - Generate images with accurate, legible text
🌐 Google Search Grounding - Real-time information for current events/weather
Prerequisites
Node.js 18 or higher
Google AI API key from Google AI Studio
Installation
From Source
Configuration
Set your API key as an environment variable:
Usage
As stdio Server (for Claude Desktop, etc.)
Or directly:
As HTTP Server
The server will listen at http://localhost:3000/mcp.
Claude Desktop Configuration
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
Available Tools
nanobanana_generate_image
Generate images from text descriptions.
Parameters:
Name | Type | Required | Description |
| string | Yes | Text description of the image |
| string | No | Model ID (default:
) |
| string | No | Aspect ratio (e.g.,
,
) |
| string | No | Resolution:
,
,
(Pro only) |
| boolean | No | Enable real-time info grounding (Pro only) |
Example:
nanobanana_edit_image
Edit an existing image using text prompts.
Parameters:
Name | Type | Required | Description |
| string | Yes | Description of the edit |
| string | Yes | Base64-encoded image data |
| string | Yes | MIME type (e.g.,
) |
| string | No | Model ID |
| string | No | Output aspect ratio |
| string | No | Output resolution (Pro only) |
Example:
nanobanana_compose_images
Compose images using multiple reference images (Nano Banana Pro only).
Parameters:
Name | Type | Required | Description |
| string | Yes | Description of composition |
| array | Yes | Array of
objects (max 14) |
| string | No | Output aspect ratio |
| string | No | Output resolution |
Example:
nanobanana_list_models
List available models and their capabilities.
Parameters:
Name | Type | Required | Description |
| string | No |
(default) or
|
Models
Nano Banana Pro (gemini-3-pro-image-preview)
Google's most advanced image generation model. Best for:
Professional asset production
Images with accurate text rendering
Complex compositions
High-resolution output (up to 4K)
Real-time information grounding
Nano Banana (gemini-2.5-flash-image)
Fast, low-latency image generation. Best for:
Quick experimentation
Batch processing
Iterative design
Cost-effective generation
Aspect Ratios
Ratio | Use Case |
| Square, social media posts |
| Landscape, presentations, YouTube thumbnails |
| Portrait, mobile screens, Stories |
| Classic photo format |
| DSLR photo format |
| Ultra-wide, cinematic |
Tips for Best Results
Prompting
Be Descriptive: Include details about style, lighting, composition, colors, and mood
Use Photography Terms: For photorealistic images, mention camera angles, lens types, lighting setups
Specify Style: "Oil painting", "3D render", "watercolor", "photorealistic", etc.
Include Context: Describe the environment, atmosphere, and mood
Example Prompts
Photorealistic:
Stylized:
Logo:
Error Handling
Common errors and solutions:
Error | Solution |
"GEMINI_API_KEY is required" | Set the environment variable |
Rate limit exceeded | Wait and retry, or reduce request frequency |
Content policy violation | Modify prompt to comply with Google's policies |
Invalid image format | Use supported formats: PNG, JPEG, GIF, WebP |
Development
License
MIT
Links
Google AI Studio - Get your API key
Gemini API Docs - Official documentation
MCP Protocol - Learn about MCP