nanobanana
Gemini Vision & Image Generation MCP for Claude Desktop and Claude Code
claude mcp add --transport stdio ycse-nanobanana-mcp npx -y @ycse/nanobanana-mcp \ --env NANOBANANA_MODEL="default or your preferred model" \ --env GOOGLE_AI_API_KEY="your_api_key"
How to use
NanoBanana MCP exposes Gemini-based image generation and editing capabilities within Claude Desktop, Claude Code, and Cursor. It supports switching between Nano Banana 2 (Flash) and Nano Banana Pro models at runtime so you can iterate quickly or render higher-quality outputs as needed. Core tools include gemini_generate_image for creating images from prompts, gemini_edit_image for applying natural-language edits to existing images, and gemini_chat for multi-turn conversations with image support. Maintain session continuity with set_aspect_ratio to ensure consistent framing, and use get_image_history and clear_conversation to manage evolving visuals across a session.
How to install
Prerequisites:
- Node.js 18+ and npm
- Access key for Google AI API (GOOGLE_AI_API_KEY)
Installation steps:
-
Clone the MCP server repository or install the published package: git clone https://github.com/YCSE/nanobanana-mcp.git cd nanobanana-mcp
-
Install dependencies: npm install
-
Set up environment variables (example):
- GOOGLE_AI_API_KEY=your_api_key
- NANOBANANA_MODEL=gemini-3.1-flash-image-preview or gemini-3-pro-image-preview
-
Run in development or start mode: npm run dev # Development mode with hot reload npm run build # Build production assets npm run start # Run the compiled server
-
Add to MCP configuration in your environment as shown in the mcp_config section.
Additional notes
Environment variables
- GOOGLE_AI_API_KEY is required for image generation and editing
- NANOBANANA_MODEL can be used to lock a default model; you can switch models at runtime via the provided tools Common issues
- If tools don’t appear, restart Claude Desktop/Code and verify the MCP config syntax
- Ensure the npx command runs without errors: npx -y @ycse/nanobanana-mcp Configuration tips
- Use set_aspect_ratio before generation/edit to ensure correct framing
- Use gemini_chat for context-aware multi-turn conversations with image support
- Reference images and history can help maintain character consistency across renders
Related MCP Servers
gemini -tool
MCP server that enables AI assistants to interact with Google Gemini CLI, leveraging Gemini's massive token window for large file analysis and codebase understanding
openapi
OpenAPI definitions, converters and LLM function calling schema composer.
comfy-pilot
MCP server + embedded terminal that lets Claude Code see and edit your ComfyUI workflows
mcp-claude-spotify
An integration that allows Claude Desktop to interact with Spotify using the Model Context Protocol (MCP).
mcp-rss-aggregator
Model Context Protocol Server for aggregating RSS feeds in Claude Desktop
seedream-image
🚀 PixelMCP | 为你的 Cursor、Claude Code 等集成AI绘画能力,让AI生成的页面不再单调!