Nanobanana Mcp Server — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Nanobanana Mcp Server (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
A production-ready Model Context Protocol (MCP) server that provides AI-powered image generation capabilities through Google's Gemini models with intelligent model selection.
Now featuring Nano Banana Pro - Google's latest and most powerful image generation model:
<a href="https://glama.ai/mcp/servers/@zhongweili/nanobanana-mcp-server"> <img width="380" height="200" src="https://glama.ai/mcp/servers/@zhongweili/nanobanana-mcp-server/badge" alt="nanobanana-mcp-server MCP server" /> </a>
Option 1: From MCP Registry (Recommended) This server is available in the Model Context Protocol Registry. Search for "nanobanana" or use the MCP name below with your MCP client.
mcp-name: io.github.zhongweili/nanobanana-mcp-server
Option 2: Using uvx
uvx nanobanana-mcp-server@latestOption 3: Using pip
pip install nanobanana-mcp-serverNano Banana supports two authentication methods via NANOBANANA_AUTH_METHOD:
api_key): Uses GEMINI_API_KEY. Best for local development and simple deployments.vertex_ai): Uses Google Cloud Application Default Credentials. Best for production on Google Cloud (Cloud Run, GKE, GCE).auto): Defaults to API Key if present, otherwise tries Vertex AI.#### 1. API Key Authentication (Default)
Set GEMINI_API_KEY environment variable.
#### 2. Vertex AI Authentication (Google Cloud)
Required environment variables:
NANOBANANA_AUTH_METHOD=vertex_ai (or auto)GCP_PROJECT_ID=your-project-idGCP_REGION=us-central1 (default)Prerequisites:
gcloud services enable aiplatform.googleapis.comroles/aiplatform.user to the service account.#### Option 1: Using Published Server (Recommended)
Add to your claude_desktop_config.json:
{
"mcpServers": {
"nanobanana": {
"command": "uvx",
"args": ["nanobanana-mcp-server@latest"],
"env": {
"GEMINI_API_KEY": "your-gemini-api-key-here"
}
}
}
}#### Option 2: Using Local Source (Development)
If you are running from source code, point to your local installation:
{
"mcpServers": {
"nanobanana-local": {
"command": "uv",
"args": ["run", "python", "-m", "nanobanana_mcp_server.server"],
"cwd": "/absolute/path/to/nanobanana-mcp-server",
"env": {
"GEMINI_API_KEY": "your-gemini-api-key-here"
}
}
}
}#### Option 3: Using Vertex AI (ADC)
To authenticate with Google Cloud Application Default Credentials (instead of an API Key):
{
"mcpServers": {
"nanobanana-adc": {
"command": "uvx",
"args": ["nanobanana-mcp-server@latest"],
"env": {
"NANOBANANA_AUTH_METHOD": "vertex_ai",
"GCP_PROJECT_ID": "your-project-id",
"GCP_REGION": "us-central1"
}
}
}
}Configuration file locations:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.jsonInstall and configure in VS Code:
Cmd/Ctrl + Shift + P) {
"name": "nanobanana",
"command": "uvx",
"args": ["nanobanana-mcp-server@latest"],
"env": {
"GEMINI_API_KEY": "your-gemini-api-key-here"
}
}Add to Cursor's MCP configuration:
{
"mcpServers": {
"nanobanana": {
"command": "uvx",
"args": ["nanobanana-mcp-server@latest"],
"env": {
"GEMINI_API_KEY": "your-gemini-api-key-here"
}
}
}
}Add to your config.json:
{
"mcpServers": [
{
"name": "nanobanana",
"command": "uvx",
"args": ["nanobanana-mcp-server@latest"],
"env": {
"GEMINI_API_KEY": "your-gemini-api-key-here"
}
}
]
}Configure in Open WebUI settings:
{
"mcp_servers": {
"nanobanana": {
"command": ["uvx", "nanobanana-mcp-server@latest"],
"env": {
"GEMINI_API_KEY": "your-gemini-api-key-here"
}
}
}
}# Set environment variable
export GEMINI_API_KEY="your-gemini-api-key-here"
# Run server in stdio mode
uvx nanobanana-mcp-server@latest
# Or with pip installation
python -m nanobanana_mcp_server.serverNano Banana supports two Gemini models with intelligent automatic selection:
Google's latest and most advanced image generation model
Fast, reliable model for rapid iteration
By default, the server uses AUTO mode which intelligently analyzes your prompt and requirements:
Pro Model Selected When:
resolution="4k" or resolution="high"enable_grounding=Truethinking_level="HIGH"Flash Model Selected When:
n > 2# Automatic selection (recommended)
"Generate a professional 4K product photo" # → Pro model (quality keywords + 4K)
"Quick sketch of a cat" # → Flash model (speed keyword)
"Create a diagram with clear text labels" # → Pro model (text rendering)
"Draft mockup for website hero section" # → Flash model (draft keyword)
# Explicit model selection
generate_image(
prompt="A scenic landscape",
model_tier="flash" # Force Flash model for speed
)
# Leverage Nano Banana Pro features
generate_image(
prompt="Professional product photo of vintage camera on wooden desk",
model_tier="pro", # Use Pro model
resolution="4k", # 4K resolution (Pro-only)
thinking_level="HIGH", # Enhanced reasoning
enable_grounding=True, # Use Google Search for accuracy
media_resolution="HIGH" # High-detail vision processing
)
# Pro model for high-quality text rendering
generate_image(
prompt="Infographic showing 2024 market statistics with clear labels",
model_tier="pro", # Pro excels at text rendering
resolution="4k" # Maximum clarity for text
)
# Control aspect ratio for different formats ⭐ NEW!
generate_image(
prompt="Cinematic landscape at sunset",
aspect_ratio="21:9" # Ultra-wide cinematic format
)
generate_image(
prompt="Instagram post about coffee",
aspect_ratio="1:1" # Square format for social media
)
generate_image(
prompt="YouTube thumbnail design",
aspect_ratio="16:9" # Standard video format
)
generate_image(
prompt="Mobile wallpaper of mountain vista",
aspect_ratio="9:16" # Portrait format for phones
)Control the output image dimensions with the aspect_ratio parameter:
Supported Aspect Ratios:
1:1 - Square (Instagram, profile pictures)4:3 - Classic photo format3:4 - Portrait orientation16:9 - Widescreen (YouTube thumbnails, presentations)9:16 - Mobile portrait (phone wallpapers, stories)21:9 - Ultra-wide cinematic2:3, 3:2, 4:5, 5:4 - Various photo formats# Examples for different use cases
generate_image(
prompt="Product showcase for e-commerce",
aspect_ratio="3:4", # Portrait format, good for product pages
model_tier="pro"
)
generate_image(
prompt="Social media banner for Facebook",
aspect_ratio="16:9" # Landscape banner format
)Note: Aspect ratio works with both Flash and Pro models. For best results with specific aspect ratios at high resolution, use the Pro model with resolution="4k".
Control where generated images are saved with the output_path parameter:
Three modes of operation:
generate_image(
prompt="A beautiful sunset",
output_path="/path/to/sunset.png" # Exact file location
)generate_image(
prompt="Product photo",
output_path="/path/to/products/" # Trailing slash indicates directory
)generate_image(
prompt="Random image"
# output_path defaults to None
)Multiple images (n > 1): When generating multiple images with a file path, images are automatically numbered:
/path/to/image.png/path/to/image_2.png/path/to/image_3.pngPrecedence Rules:
output_path parameter (if provided) - highest priorityIMAGE_OUTPUT_DIR environment variable~/nanobanana-images (default fallback)# Save to specific location with Pro model
generate_image(
prompt="Professional headshot",
model_tier="pro",
output_path="/Users/me/photos/headshot.png"
)
# Save multiple images to a directory
generate_image(
prompt="Product variations",
n=4,
output_path="/path/to/products/" # Each gets unique filename
)Configuration options:
# Authentication (Required)
# Method 1: API Key
GEMINI_API_KEY=your-gemini-api-key-here
# Method 2: Vertex AI (Google Cloud)
NANOBANANA_AUTH_METHOD=vertex_ai
GCP_PROJECT_ID=your-project-id
GCP_REGION=us-central1
# Model Selection (optional)
NANOBANANA_MODEL=auto # Options: flash, pro, auto (default: auto)
# Optional
IMAGE_OUTPUT_DIR=/path/to/image/directory # Default: ~/nanobanana-images
LOG_LEVEL=INFO # DEBUG, INFO, WARNING, ERROR
LOG_FORMAT=standard # standard, json, detailed"GEMINI_API_KEY not set"
"Server failed to start"
uvx nanobanana-mcp-server@latest"Permission denied" errors
~/nanobanana-images by defaultFor local development:
# Clone repository
git clone https://github.com/zhongweili/nanobanana-mcp-server.git
cd nanobanana-mcp-server
# Install with uv
uv sync
# Set environment
export GEMINI_API_KEY=your-api-key-here
# Run locally
uv run python -m nanobanana_mcp_server.serverMIT License - see LICENSE for details.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.