Nano Banana MCP Server
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.
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 MCP Server create a photorealistic sunset over mountains in 16:9 aspect ratio"
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
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
Related MCP server: Nano Banana MCP
Prerequisites
Node.js 18 or higher
Google AI API key from Google AI Studio
Installation
From Source
# Clone or download this directory
cd nanobanana-mcp-server
# Install dependencies
npm install
# Build the TypeScript
npm run buildConfiguration
Set your API key as an environment variable:
# Linux/macOS
export GEMINI_API_KEY="your-api-key-here"
# Windows (PowerShell)
$env:GEMINI_API_KEY="your-api-key-here"
# Windows (CMD)
set GEMINI_API_KEY=your-api-key-hereUsage
As stdio Server (for Claude Desktop, etc.)
npm startOr directly:
node dist/index.jsAs HTTP Server
TRANSPORT=http PORT=3000 npm startThe 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):
{
"mcpServers": {
"nanobanana": {
"command": "node",
"args": ["/path/to/nanobanana-mcp-server/dist/index.js"],
"env": {
"GEMINI_API_KEY": "your-api-key-here"
}
}
}
}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: |
| boolean | No | Enable real-time info grounding (Pro only) |
Example:
{
"prompt": "A photorealistic portrait of an astronaut on Mars at sunset, dramatic lighting, 85mm lens",
"model": "gemini-3-pro-image-preview",
"aspect_ratio": "16:9",
"resolution": "4K"
}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:
{
"prompt": "Add a wizard hat to the cat",
"image_base64": "<base64-image-data>",
"image_mime_type": "image/png"
}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 |
| string | No | Output aspect ratio |
| string | No | Output resolution |
Example:
{
"prompt": "Create a group photo of these 5 people at a beach party",
"images": [
{"base64": "<image1>", "mime_type": "image/jpeg"},
{"base64": "<image2>", "mime_type": "image/jpeg"}
],
"aspect_ratio": "16:9",
"resolution": "2K"
}nanobanana_list_models
List available models and their capabilities.
Parameters:
Name | Type | Required | Description |
| string | No |
|
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:
A photorealistic close-up portrait of an elderly Japanese ceramicist with
deep wrinkles and a warm smile, inspecting a glazed tea bowl. Soft golden
hour light from a window. Shot with 85mm portrait lens, bokeh background.Stylized:
A kawaii-style sticker of a happy red panda wearing a bamboo hat, munching
on a leaf. Bold outlines, cel-shading, vibrant colors. White background.Logo:
Create a modern, minimalist logo for a coffee shop called 'The Daily Grind'.
Clean, bold sans-serif font. Black and white. Circular design with a clever
coffee bean element.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
# Install dependencies
npm install
# Build TypeScript
npm run build
# Watch mode for development
npm run devLicense
MIT
Links
Google AI Studio - Get your API key
Gemini API Docs - Official documentation
MCP Protocol - Learn about MCP
Available Tools
4 toolsnanobanana_compose_imagesCompose Multiple Images with Nano Banana ProARead-only
Compose new images using multiple reference images with Nano Banana Pro.
Use up to 14 reference images to:
Create group compositions
Transfer styles between images
Maintain character consistency across scenes
Combine objects from different images
Limits:
Up to 6 images of objects for high-fidelity inclusion
Up to 5 images of humans for character consistency
Total maximum: 14 images
Args:
prompt (string, required): Description of how to compose the images
images (array, required): Array of image objects with:
base64 (string): Base64-encoded image data
mime_type (string): Image MIME type
model (string): Must be Nano Banana Pro (gemini-3-pro-image-preview)
aspect_ratio (string): Output aspect ratio
resolution (string): Output resolution (1K, 2K, 4K)
Returns:
success (boolean): Whether composition succeeded
imageData (string): Base64-encoded composed image
mimeType (string): Image MIME type
text (string): Any accompanying text
error (string): Error message if failed
Examples:
"Create a group photo of these 5 people at a beach"
"Apply the style of the first image to the subject in the second"
"Combine these product images into a catalog layout"
Inputs: prompt (required), images (required), model, aspect_ratio, +1 more.
nanobanana_edit_imageEdit Image with Nano BananaARead-only
Edit an existing image using text prompts with Google's Nano Banana models.
Provide an image and describe your desired changes. The model will:
Add, remove, or modify elements
Change style, lighting, or colors
Adjust composition
Apply filters or effects
The model maintains the original image's style and context while applying changes.
Args:
prompt (string, required): Description of the edit to make
image_base64 (string, required): Base64-encoded image data (no data URI prefix)
image_mime_type (string, required): MIME type of the image (e.g., 'image/png', 'image/jpeg')
model (string): Model to use. Default: Nano Banana Pro
aspect_ratio (string): Output aspect ratio. Options: 1:1, 2:3, 3:2, etc.
resolution (string): Output resolution (Pro only). Options: 1K, 2K, 4K
Returns:
success (boolean): Whether editing succeeded
imageData (string): Base64-encoded edited image
mimeType (string): Image MIME type
text (string): Any accompanying text from the model
error (string): Error message if editing failed
Examples:
"Add a small wizard hat on the cat's head"
"Change the background to a sunset beach"
"Make this image look like a Van Gogh painting"
"Remove the person in the background"
Error Handling:
Returns error if image data is invalid
Returns error if MIME type is unsupported
Returns error if content policy violated
Inputs: prompt (required), image_base64 (required), image_mime_type (required), model, +2 more.
nanobanana_generate_imageGenerate Image with Nano BananaARead-only
Generate high-quality images from text descriptions using Google's Nano Banana models.
This tool creates images from natural language prompts. For best results, be descriptive about:
Subject and composition
Style (photorealistic, illustration, painting, etc.)
Lighting and atmosphere
Colors and mood
Camera angle and lens (for photorealistic images)
Args:
prompt (string, required): Text description of the image to generate
model (string): Model to use. Options:
'gemini-3-pro-image-preview' (Nano Banana Pro) - Best quality, 4K, text rendering
'gemini-2.5-flash-image' (Nano Banana) - Fast generation Default: Nano Banana Pro
aspect_ratio (string): Image aspect ratio. Options: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9
resolution (string): Image resolution (Pro only). Options: 1K, 2K, 4K
use_google_search (boolean): Enable real-time information grounding (Pro only)
Returns:
success (boolean): Whether generation succeeded
imageData (string): Base64-encoded image data
mimeType (string): Image MIME type (usually image/png)
text (string): Any accompanying text from the model
error (string): Error message if generation failed
Examples:
"A photorealistic portrait of an astronaut on Mars at sunset"
"Kawaii-style sticker of a happy corgi with a transparent background"
"Minimalist logo for 'TechStart' in blue and white, modern sans-serif font"
Error Handling:
Returns error if GEMINI_API_KEY is not set
Returns error if API rate limit exceeded (try again later)
Returns error if content policy violated
Inputs: prompt (required), model, aspect_ratio, resolution, +1 more.
nanobanana_list_modelsList Nano Banana ModelsARead-onlyIdempotent
List available Nano Banana image generation models and their capabilities.
Returns information about:
Model IDs for API calls
Model names and descriptions
Features and capabilities
Maximum resolution supported
Args:
response_format (string): Output format. Options: 'markdown' (default), 'json'
Returns:
models: Array of model information objects with id, name, description, features, maxResolution
Inputs: response_format.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a distinct and well-defined purpose: compose_images combines multiple reference images, edit_image modifies a single image, generate_image creates from text, and list_models provides metadata. The descriptions clearly differentiate their scopes, with no overlap or ambiguity in functionality.
All tool names follow a consistent snake_case pattern with the prefix 'nanobanana_' and a clear verb_noun structure (e.g., compose_images, edit_image, generate_image, list_models). This uniformity makes the set predictable and easy to navigate.
With 4 tools, this server is well-scoped for image generation and editing tasks. Each tool serves a unique and essential function in the workflow, from listing models to creating, editing, and composing images, without being overly sparse or bloated.
The tool set covers core image operations: generation, editing, composition, and model listing. Minor gaps might include batch processing or advanced filtering, but the surface supports typical agent workflows effectively, with no dead ends in the image manipulation lifecycle.
Related MCP Connectors
Generate and edit images (PNG, transparent, GIF, SVG) with GPT Image and Nano Banana models.
Generate, extend and edit AI images and videos, then assemble clips on a timeline and render.
Make images, videos and speech: Nano Banana, GPT Image, Seedance, Kling, Wan and Gemini TTS.
Generate images with GPT Image 2, Nano Banana Pro and more, placed on your Banana Art Lab canvas.
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
- FlicenseNot gradedqualityCmaintenanceEnables image generation and editing using Google's Gemini models with support for model selection and custom aspect ratios. Users can generate high-quality images or modify existing ones through natural language prompts while controlling specific parameters like quality and dimensions.-
- AlicenseAqualityCmaintenanceEnables AI image generation and editing using Google's Gemini Multimodal Image APIs.61MIT
- AlicenseAqualityCmaintenanceEnables AI image generation and editing using Google's Gemini models via natural language, supporting multi-turn editing, search grounding, storyboards, icon sets, and video-to-image.511 npm1MIT