Nano Banana MCP Server
Provides tools for generating and editing images with Google Gemini's native image generation models (Flash and Pro). Supports text-to-image generation, editing existing images from a file path or base64 data, configurable aspect ratios, and resolutions up to 4K.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Nano Banana MCP Server
An MCP (Model Context Protocol) server for Google Gemini image generation. This server provides tools to generate and edit images using Gemini's native image generation capabilities.
Features
Text-to-Image Generation: Generate high-quality images from text prompts
Image Editing: Modify existing images with text instructions
Multiple Models: Support for both fast (Flash) and advanced (Pro) Gemini models
Flexible Output: Various aspect ratios and resolutions up to 4K
Base64 Support: Edit images provided as base64-encoded data
Related MCP server: Nano Banana
Installation
Using UV (recommended)
uv syncUsing pip
pip install -e .Configuration
Environment Variables
Variable | Required | Description |
| Yes | Your Google Gemini API key |
| No | Directory for generated images (defaults to |
Get your API key from Google AI Studio.
Usage
Running the Server
# Via entry point
nano-banana-mcp-server
# With verbose logging
nano-banana-mcp-server -v
# Via module
python -m nano_banana_mcp_serverClaude Desktop Configuration
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"nano-banana": {
"command": "uv",
"args": ["--directory", "/path/to/nano-banana-mcp-server", "run", "nano-banana-mcp-server"],
"env": {
"GEMINI_API_KEY": "your-api-key-here"
}
}
}
}Images will be saved to ./output relative to where the server runs. To use a different directory, add:
"env": {
"GEMINI_API_KEY": "your-api-key-here",
"NANO_BANANA_OUTPUT_DIR": "/custom/path"
}Available Tools
generate_image_from_text
Generate an image from a text prompt.
Parameters:
prompt(required): Text description of the image to generatemodel: Model to use -gemini-2.5-flash-image(default, fast) orgemini-3-pro-image-preview(advanced)aspect_ratio: Image aspect ratio -1:1,2:3,3:2,3:4,4:3,4:5,5:4,9:16,16:9,21:9image_size: Resolution -1K,2K,4K(Pro model only)
Example:
Generate a photorealistic image of a sunset over the ocean with a sailboatedit_existing_image
Edit an existing image using a text prompt.
Parameters:
prompt(required): Description of the edits to makeimage_path(required): Path to the input image filemodel: Model to useaspect_ratio: Output aspect ratioimage_size: Output resolution (Pro model only)
Example:
Add a rainbow to the sky in this landscape photoedit_image_base64
Edit an image provided as base64-encoded data.
Parameters:
prompt(required): Description of the edits to makeimage_base64(required): Base64-encoded image datamime_type: Image MIME type (default:image/png)model: Model to useaspect_ratio: Output aspect ratioimage_size: Output resolution (Pro model only)
Models
Model | ID | Features |
Flash |
| Fast generation, good for most use cases |
Pro |
| Advanced reasoning, 4K support, up to 14 reference images, Google Search grounding |
Prompting Tips
For Photorealistic Images
Use photography terminology:
A photorealistic close-up portrait of a golden retriever,
illuminated by soft window light, captured with an 85mm
portrait lens with shallow depth of field. The mood is
warm and peaceful.For Stylized Images
Be explicit about the style:
A kawaii-style sticker of a happy cat wearing a chef's hat,
featuring bold outlines, simple cel-shading, and a pastel
color palette on a white background.For Image Editing
Be specific about changes:
Change the color of the car from red to blue, keeping all
other elements exactly the same.Development
# Install with dev dependencies
uv sync --all-extras
# Run tests
uv run pytest
# Type checking
uv run pyright
# Linting
uv run ruff check .
# Formatting
uv run ruff format .License
This project is licensed under the MIT License - see the LICENSE file for details.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Generate and edit images: article covers, pet portraits, product shots. Each call spends credits.
Generate and edit images (PNG, transparent, GIF, SVG) with GPT Image and Nano Banana models.
Create images and videos from prompts, with options for image mixing, reference images, and start/…
Generate, edit and upscale images with references, batch jobs, cost previews and original downloads.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables text-to-image generation, image editing, and multi-image composition using Google's Gemini 2.5 Flash Image API. Supports flexible aspect ratios and character consistency across generations.1MIT
- AlicenseBqualityDmaintenanceEnables image generation using Google Gemini models like Gemini 2.0 Flash and Imagen 3.0 with support for custom aspect ratios and negative prompts. It also allows users to list and manage generated images stored in local directories.2MIT
- FlicenseNot gradedqualityCmaintenanceEnables image generation and editing using Google's Gemini models with support for model selection and custom aspect ratios. Users can generate high-quality images or modify existing ones through natural language prompts while controlling specific parameters like quality and dimensions.-
- AlicenseAqualityCmaintenanceEnables AI image generation and editing using Google's Gemini Multimodal Image APIs.61MIT