MCP Nano Banana
Exposes Google Gemini's Nano Banana image generation models to Claude, enabling text-to-image generation, image editing, and multi-image composition through natural language prompts.
README
MCP Nano Banana
An MCP (Model Context Protocol) server that exposes Google Gemini's image generation capabilities (Nano Banana / Nano Banana Pro) as tools that Claude can use.
Installation
git clone https://github.com/Pgarciapg/mcp-nano-banana.git
cd mcp-nano-banana
npm install
npm run build
Features
- Text-to-Image Generation: Generate images from text prompts
- Image Editing: Edit existing images using natural language
- Image Composition: Combine multiple images into new compositions
- Two Models Available:
nano-banana(gemini-2.5-flash-image): Fast, efficient, 1024px resolutionnano-banana-pro(gemini-3-pro-image-preview): Advanced, up to 4K, with thinking mode
Setup
1. Get a Gemini API Key
- Go to Google AI Studio
- Create or select a project
- Generate an API key
2. Set Your API Key
Add your Gemini API key to your shell profile (~/.zshrc or ~/.bashrc):
export GEMINI_API_KEY="your-api-key-here"
Then reload your shell:
source ~/.zshrc
3. Configure Claude Code
Add the server to Claude Code's MCP config. Edit ~/.claude/.mcp.json:
{
"mcpServers": {
"gemini-imagen": {
"command": "node",
"args": ["/path/to/mcp-nano-banana/dist/index.js"],
"env": {
"GEMINI_API_KEY": "${GEMINI_API_KEY}",
"IMAGEN_OUTPUT_DIR": "/path/to/output/folder"
}
}
}
}
4. Restart Claude Code
After configuring, restart Claude Code to load the new MCP server.
Available Tools
generate_image
Generate an image from a text prompt.
Parameters:
prompt(required): Text description of the image to generatemodel:nano-banana(default) ornano-banana-proaspect_ratio:1:1,2:3,3:2,3:4,4:3,4:5,5:4,9:16,16:9,21:9image_size:1K,2K,4K(only for nano-banana-pro)filename: Optional output filename
edit_image
Edit an existing image using text prompts.
Parameters:
prompt(required): Description of the edit to makeimage_path(required): Path to the input imagemodel: Model to use for editingaspect_ratio: Optional aspect ratio for outputimage_size: Resolution (only for nano-banana-pro)filename: Optional output filename
compose_images
Combine multiple images into a new composition.
Parameters:
prompt(required): How to combine the imagesimage_paths(required): Array of paths to input imagesmodel: Model to use (nano-banana-pro recommended)aspect_ratio: Aspect ratio for outputimage_size: Resolution (only for nano-banana-pro)filename: Optional output filename
Usage Examples
Generate a simple image
"Generate an image of a sunset over mountains with a cabin in the foreground"
Edit an existing image
"Add a wizard hat to the cat in this image" + provide image_path
Combine multiple images
"Put the dress from the first image on the model from the second image" + provide image_paths array
Prompting Tips
- Be Descriptive: Describe scenes narratively, not as keyword lists
- Specify Style: Use photography terms for photorealistic images (lens type, lighting, angles)
- Include Details: Mention colors, textures, lighting, and mood
- Use Templates: For specific styles (product photos, logos, etc.), follow proven templates
Environment Variables
GEMINI_API_KEY(required): Your Google Gemini API keyIMAGEN_OUTPUT_DIR(optional): Directory for generated images (defaults to./generated-images)
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.