
nanobanana-mcp-server
io.github.zhongweili/nanobanana-mcp-server
An MCP server that provides image generation and editing capabilities
Documentation
Nano Banana MCP Server π
A production-ready Model Context Protocol (MCP) server that provides AI-powered image generation capabilities through Google's Gemini 2.5 Flash Image model.
β¨ Features
- π¨ AI Image Generation: Create high-quality images from detailed text prompts
- π Smart Templates: Pre-built prompt templates for photography, design, and editing
- π File Management: Upload and manage files via Gemini Files API
- π Resource Discovery: Browse templates and file metadata through MCP resources
- π‘οΈ Production Ready: Comprehensive error handling, logging, and validation
- β‘ High Performance: Optimized architecture with intelligent caching
π Quick Start
Prerequisites
- Google Gemini API Key - Get one free here
- Python 3.11+ (for development only)
Installation
Option 1: From MCP Registry (Recommended) This server is available in the Model Context Protocol Registry. Install it using your MCP client.
mcp-name: io.github.zhongweili/nanobanana-mcp-server
Option 2: Using uvx
uvx nanobanana-mcp-server@latest
Option 3: Using pip
pip install nanobanana-mcp-server
π§ Configuration
Claude Desktop
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"
}
}
}
}
Configuration file locations:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
Claude Code (VS Code Extension)
Install and configure in VS Code:
- Install the Claude Code extension
- Open Command Palette (
Cmd/Ctrl + Shift + P
) - Run "Claude Code: Add MCP Server"
- Configure:
{ "name": "nanobanana", "command": "uvx", "args": ["nanobanana-mcp-server@latest"], "env": { "GEMINI_API_KEY": "your-gemini-api-key-here" } }
Cursor
Add to Cursor's MCP configuration:
{
"mcpServers": {
"nanobanana": {
"command": "uvx",
"args": ["nanobanana-mcp-server@latest"],
"env": {
"GEMINI_API_KEY": "your-gemini-api-key-here"
}
}
}
}
Continue.dev (VS Code/JetBrains)
Add to your config.json
:
{
"mcpServers": [
{
"name": "nanobanana",
"command": "uvx",
"args": ["nanobanana-mcp-server@latest"],
"env": {
"GEMINI_API_KEY": "your-gemini-api-key-here"
}
}
]
}
Open WebUI
Configure in Open WebUI settings:
{
"mcp_servers": {
"nanobanana": {
"command": ["uvx", "nanobanana-mcp-server@latest"],
"env": {
"GEMINI_API_KEY": "your-gemini-api-key-here"
}
}
}
}
Gemini CLI / Generic MCP Client
# 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.server
βοΈ Environment Variables
Optional configuration:
# Required
GEMINI_API_KEY=your-gemini-api-key-here
# Optional
IMAGE_OUTPUT_DIR=/path/to/image/directory # Default: ~/nanobanana-images
LOG_LEVEL=INFO # DEBUG, INFO, WARNING, ERROR
LOG_FORMAT=standard # standard, json, detailed
π Troubleshooting
Common Issues
"GEMINI_API_KEY not set"
- Add your API key to the MCP server configuration in your client
- Get a free API key at Google AI Studio
"Server failed to start"
- Ensure you're using the latest version:
uvx nanobanana-mcp-server@latest
- Check that your client supports MCP (Claude Desktop 0.10.0+)
"Permission denied" errors
- The server creates images in
~/nanobanana-images
by default - Ensure write permissions to your home directory
Development Setup
For 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.server
π License
MIT License - see LICENSE for details.
π Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
nanobanana-mcp-server
pip install nanobanana-mcp-server
Related Servers
ai.smithery/Artin0123-gemini-image-mcp-server
Analyze images and videos with Gemini to get fast, reliable visual insights. Handle content from Uβ¦
ai.smithery/BadRooBot-test_m
Send quick greetings, scrape website content, and generate text or images on demand. Perform web sβ¦
ai.smithery/IndianAppGuy-magicslide-mcp-actual-test
Generate polished PowerPoint presentations from text prompts, YouTube videos, or structured outlinβ¦