Provides access to Gemini Flash 2.5 image generation capabilities, enabling text-to-image generation, image editing, multi-image composition, and batch generation of up to 10 variations at once.
Enables image manipulation operations including combining images into panoramas or grids, transforming (resize, crop, rotate, flip), adjusting (blur, sharpen, grayscale, tint, brightness, saturation), compositing with blend modes, and batch processing of entire directories.
Nano Banana MCP Server

Nano Banana is an MCP server that exposes Google Gemini Flash 2.5 Image Generation via a clean, focused interface. It is not a general multi‑model server — it is a thin wrapper around Gemini Flash 2.5 image generation only.
✨ What It Does
Generate, edit, and manipulate images using natural language via any MCP‑compatible client.
🚀 Compatible Tools
Works with any MCP‑compatible client. Below we document Gemini CLI (recommended) and a minimal generic MCP configuration.
Features
🎨 Image Generation (Powered by Gemini Flash 2.5)
Text-to-Image Generation: Create images from text descriptions
Image Editing: Modify existing images with text prompts
Multi-Image Composition: Combine multiple images or transfer styles
Batch Generation: Generate multiple variations at once
🛠️ Image Manipulation (Powered by Sharp)
Combine Images: Stitch images into panoramas, grids, or strips
Transform Images: Resize, crop, rotate, flip, and flop
Adjust Images: Blur, sharpen, grayscale, tint, brightness, saturation
Composite Images: Layer images with blend modes and positioning
Batch Processing: Apply operations to entire directories
🔧 Developer Features
Smart Path Handling: Automatically creates directories and handles file paths
Image Validation: Verify generated images are valid and meet size requirements
Comprehensive Error Handling: Clear feedback on API errors, quota issues, and failures
MCP Protocol: Works with any MCP-compatible AI client
🚀 Quick Install (1 Minute!)
Option 1: Global Install (Recommended)
Option 2: NPX (No Install)
Set your API key once in your shell (required):
Gemini CLI configuration (~/.gemini/settings.json):
Generic MCP configuration (for other clients using stdio):
Option 3: From Source
The quickstart script will:
✅ Check Node.js version
✅ Install Gemini CLI if needed
✅ Build the project
✅ Configure your API key
✅ Set up Gemini CLI integration
✅ Verify everything works
Minimal Setup (from source)
Configure API key:
Build:
Configure Gemini CLI using the JSON shown above.
Get your API key from: https://aistudio.google.com/apikey
CLI Commands
The Nano Banana CLI provides powerful management tools:
Important: Use setup to configure with Gemini CLI. The init command only creates a .env file.
Usage
Once configured, use with your MCP client of choice. Simply describe what you want:
"Generate a cyberpunk city at ./city.png"
"Create 5 potion icons at ./items/potions.png"
"Add a sunset to ./photo.jpg"
"Combine these images into a panorama"
🌟 Why Nano Banana?
🎨 Full Gemini Flash 2.5 Power: Access the latest image generation capabilities
🚀 Natural Language Interface: Just describe what you want
🔧 Flexible Integration: Works with Gemini CLI and other MCP clients
📁 Direct File Management: Images save exactly where you need them
🎯 Smart Context: One tool handles generation, editing, and composition
⚡ Batch Operations: Generate up to 10 variations at once
📚 Documentation
This README contains the supported setup paths. Nano Banana targets the Gemini Flash 2.5 image generation model only.
Available Tools
generate_image
Generate, edit, or compose images using Gemini Flash 2.5.
Parameters:
prompt(optional): Text description for generationimages(optional): Array of input images (base64 or file paths)outputPath: Where to save the generated image(s)count(optional): Number of variations to generate (1-10)options(optional): Additional Gemini model options
Examples:
Text-to-image:
Image editing:
Batch generation:
validate_image
Check if an image file exists and is valid.
Parameters:
path: File path to validate
Returns:
exists: Whether the file existsvalid: Whether it's a valid imagedimensions: Image width and heightformat: Image format (png, jpeg, etc.)fileSize: File size in byteserror: Error message if validation failed
How It Works
Flexible Input: The server intelligently determines the operation mode:
Text only → Text-to-image generation
Text + 1 image → Image editing
Text + multiple images → Composition/style transfer
Path Management: Automatically creates directories and handles both absolute and relative paths
Batch Support: When
count> 1, generates multiple variations with numbered suffixesValidation: Uses Sharp to verify images are properly generated and meet minimum size requirements
No Overwrites: The server never overwrites existing files. If the requested
outputPath(or any batch variation path) already exists, the server returns an error and does not write. Choose a new path or remove the file before retrying.
Error Handling
The server provides detailed error information:
INVALID_API_KEY: Authentication failedQUOTA_EXCEEDED: API limits reachedAPI_ERROR: General API failureINVALID_INPUT: Bad parametersFILE_WRITE_ERROR: Cannot save to pathVALIDATION_FAILED: Image corrupt or too smallFILE_EXISTS: Output file already exists; choose a new path
Testing
Run the example test script:
This will test:
Basic text-to-image generation
Image validation
Batch generation
Project Structure
🎮 Real-World Use Cases
Game Development
Web Development
Content Creation
🛠️ Requirements
Node.js 18 or higher
Gemini API Key with image generation access (Get one here)
TypeScript 5.0+ (for development)
🔧 Project Status
This is an experimental sample project. While GitHub issues are welcome for bug reports and feedback, this project is not actively seeking contributions and long-term maintenance is not guaranteed at this time.
📄 License
MIT License - see LICENSE file for details
🙏 Acknowledgments
Built with the Model Context Protocol
Powered by Gemini Flash 2.5
Inspired by the amazing MCP community