Nano Banana Pro MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Nano Banana Pro MCP Server
MCP server for Google Gemini's Nano Banana Pro image generation model (gemini-3-pro-image-preview).
Supports both STDIO (local Cursor integration) and HTTP/SSE (remote deployment) transports.
Features
Text-to-Image Generation: Create high-fidelity images from text descriptions
Image Editing: Edit existing images with conversational text prompts
Multiple Aspect Ratios: Support for 1:1, 16:9, 9:16, 4:3, 3:4
Batch Generation: Generate up to 4 images at once
High Resolution: 2K-4K output with Nano Banana Pro
Dual Transport: STDIO for local use, HTTP/SSE for remote deployment
Related MCP server: Nano Banana Pro MCP
Quick Start
Prerequisites
Python 3.11+
Gemini API key from Google AI Studio
📖 Full Deployment Guide: See DEPLOY.md for detailed deployment instructions for all platforms.
Installation
git clone https://github.com/bcharleson/nano-banana-mcp.git
cd nano-banana-mcp
pip install -r requirements.txtLocal Usage (STDIO)
1. Configure Cursor
Add to .cursor/mcp.json:
{
"mcpServers": {
"nano-banana": {
"command": "python3",
"args": [
"/absolute/path/to/nano-banana-mcp/server.py"
],
"env": {
"GEMINI_API_KEY": "your-api-key-here"
}
}
}
}2. Restart Cursor
The server will be available via MCP tools.
Remote Deployment (HTTP/SSE)
Option 1: Docker
# Build
docker build -t nano-banana-mcp .
# Run
docker run -p 8000:8000 -e GEMINI_API_KEY=your-api-key nano-banana-mcpOption 2: Docker Compose
# Create .env file
echo "GEMINI_API_KEY=your-api-key" > .env
# Run
docker-compose up -dOption 3: Fly.io
# Install flyctl
brew install flyctl
# Login
flyctl auth login
# Set secret
flyctl secrets set GEMINI_API_KEY=your-api-key
# Deploy
flyctl launchOption 4: Railway
Click:
Add
GEMINI_API_KEYenvironment variableDeploy!
Option 5: Render
Create new Web Service
Connect this repo
Set environment variable:
GEMINI_API_KEYDeploy command:
python server.py --http
Option 6: DigitalOcean App Platform
Via doctl CLI:
# Install doctl
brew install doctl
# Authenticate
doctl auth init
# Create app from spec
doctl apps create --spec .do/app.yaml
# Set secret
doctl apps update YOUR_APP_ID --spec .do/app.yamlVia DigitalOcean Console:
Click "Create App"
Connect your GitHub repo:
bcharleson/nano-banana-mcpDigitalOcean will auto-detect the
.do/app.yamlconfigurationAdd environment variable:
GEMINI_API_KEY(mark as secret)Click "Create Resources"
One-Click Deploy:
Pricing:
Basic plan: $5/month (512MB RAM, 1 vCPU)
Pro plan: $12/month (1GB RAM, 1 vCPU)
Quick Deploy Script:
# One-command deployment
./scripts/deploy-digitalocean.sh
# Test deployment
./scripts/test-deployment.sh https://your-app.ondigitalocean.appConnect to Remote Server
In .cursor/mcp.json:
{
"mcpServers": {
"nano-banana-remote": {
"url": "https://your-deployment-url.com"
}
}
}API Usage
Generate Image
# Via MCP tool
generate_image(
prompt="A professional headshot of a tech entrepreneur in a modern office",
output_path="/path/to/output.png",
aspect_ratio="16:9",
num_images=1
)Parameters:
prompt(str): Text description of the image to generateoutput_path(str, optional): File path to save the imageaspect_ratio(str): One of:1:1,16:9,9:16,4:3,3:4num_images(int): Number of images to generate (1-4)
Edit Image
# Via MCP tool
edit_image(
prompt="Change the background to a futuristic data center",
reference_image_path="/path/to/input.jpg",
output_path="/path/to/edited.png",
aspect_ratio="16:9"
)Parameters:
prompt(str): Text description of the edit to makereference_image_path(str): Path to the reference image fileoutput_path(str, optional): File path to save the edited imageaspect_ratio(str): One of:1:1,16:9,9:16,4:3,3:4
Development
Run Locally (STDIO mode)
python server.pyRun Locally (HTTP mode)
python server.py --httpServer runs on http://localhost:8000 by default. Override with PORT environment variable:
PORT=3000 python server.py --httpTest HTTP Endpoint
curl http://localhost:8000/healthNano Banana Pro Capabilities
Improved text rendering: ~94% correctness across multiple languages
Multi-reference: Process up to 14 reference images simultaneously
Identity consistency: Maintain consistency across up to 5 human subjects
High resolution: 4K output for professional use
Advanced reasoning: Complex instruction following
Enhanced world knowledge: Better diagrams and infographics
Precise control: Lighting and camera angle control
Environment Variables
Variable | Required | Description |
| Yes | Your Gemini API key from Google AI Studio |
| No | HTTP server port (default: 8000) |
Supported Image Formats
Input: PNG, JPEG, WebP
Output: PNG (base64 or file)
API Details
The server uses the Gemini API with the key appended as a URL parameter:
https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-image-preview:generateContent?key=YOUR_API_KEYNotes
All generated images include SynthID watermark for provenance
Maximum generation timeout: 120 seconds
API rate limits apply based on your Gemini API tier
Examples
Generate YouTube Thumbnail
generate_image(
prompt="Professional YouTube thumbnail for a data quality video. Bold text 'QUALITY DATA 2026'. Tech entrepreneur pointing at screen. Clean modern design. 16:9 aspect ratio.",
output_path="/Users/you/Desktop/thumbnail.png",
aspect_ratio="16:9",
num_images=1
)Edit Headshot Background
edit_image(
prompt="Replace the background with a modern tech office with data visualizations on screens. Keep the person in focus. Professional lighting.",
reference_image_path="/path/to/headshot.jpg",
output_path="/path/to/edited.png",
aspect_ratio="1:1"
)Generate Multiple Variations
generate_image(
prompt="Minimalist logo for AI automation company. Blue and orange colors. Clean geometric shapes.",
output_path="/path/to/logo_1.png",
aspect_ratio="1:1",
num_images=4 # Generates logo_1.png, logo_2.png, logo_3.png, logo_4.png
)Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License - see LICENSE file for details.
Links
Gemini API: https://ai.google.dev/gemini-api/docs
FastMCP: https://github.com/jlowin/fastmcp
Author
Brandon Charleson
GitHub: @bcharleson
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Generate and edit images (PNG, transparent, GIF, SVG) with GPT Image and Nano Banana models.
Generate images with GPT Image 2, Nano Banana Pro and more, placed on your Banana Art Lab canvas.
Make images, videos and speech: Nano Banana, GPT Image, Seedance, Kling, Wan and Gemini TTS.
Generate images and videos with Seedream, GPT Image, Nano Banana, Kling and Seedance on one key.
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.299 npm10MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to generate, edit, and analyze images using Google's Gemini image generation models including Nano Banana Pro (gemini-3-pro-image-preview).201 npm18MIT
- FlicenseAqualityDmaintenanceEnables AI image generation, editing, and composition using Google's Gemini image models (Nano Banana Pro and Nano Banana). Supports text-to-image generation, multi-image composition, flexible aspect ratios, high-resolution output up to 4K, and real-time information grounding.4-
- 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.-