MCP Nano Banana
Enables image generation through Google's Gemini 2.5 Flash Image model (Nano Banana) using text prompts, with selectable aspect ratios and async job status tracking.
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.
MCP Nano Banana
Model Context Protocol (MCP) server for Google Gemini Nano Banana image generation
A production-ready MCP server that enables AI assistants like Claude to generate images using Google's Gemini 2.5 Flash Image model (Nano Banana). Features async job tracking, multiple aspect ratios, and file system integration.
Features
🎨 Image Generation: Create images using Gemini 2.5 Flash Image model
⏱️ Async Job Tracking: Monitor generation progress with unique job IDs
📐 Multiple Aspect Ratios: Support for 1:1, 3:4, 4:3, 9:16, and 16:9
💾 File System Integration: Save images anywhere with automatic PNG conversion
🔌 STDIO Transport: Local MCP server for secure, private operation
✅ Production Ready: Fully tested with comprehensive error handling
Related MCP server: Imagen MCP Server
Quick Start
Installation
npm install -g mcp-nano-bananaOr with Bun:
bun install -g mcp-nano-bananaSetup
Get your API key from Google AI Studio
Set the environment variable:
export GEMINI_API_KEY=your-api-key-hereOr create a .env file:
echo "GEMINI_API_KEY=your-api-key-here" > .envUsage with Claude Desktop
Add to your Claude Desktop configuration:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"nano-banana": {
"command": "mcp-nano-banana",
"env": {
"GEMINI_API_KEY": "your-api-key-here"
}
}
}
}Restart Claude Desktop and the server will be available.
Available Tools
generate_image
Generate an image from a text prompt.
Parameters:
prompt(string, required): Description of the image to generateaspectRatio(string, optional): One of "1:1", "3:4", "4:3", "9:16", "16:9" (default: "1:1")
Returns: Job ID for tracking generation progress
check_job_status
Check the status of an image generation job.
Parameters:
jobId(string, required): Job ID fromgenerate_image
Returns: Status information (pending/processing/completed/failed)
save_image
Save a completed image to the file system.
Parameters:
jobId(string, required): Job ID of completed generationfilePath(string, required): Absolute path for saving (must end in .png)
Returns: Success confirmation and file path
list_jobs
List all image generation jobs and their status.
Returns: Array of all jobs with status information
Example Workflow
User: Generate an image of a sunset over mountains
Claude: I'll generate that for you...
[Uses generate_image tool]
Job started: job_1234567890_abc123
[Waits and checks status]
Image complete! Where would you like me to save it?
User: Save it to ~/Pictures/sunset.png
Claude: [Uses save_image tool]
Saved to /Users/you/Pictures/sunset.png ✓Development
Running from Source
git clone https://github.com/dennisonbertram/mcp-nano-banana.git
cd mcp-nano-banana
bun install
bun run devTesting
bun testBuilding
bun build index.ts --target=bun --outdir=./distTechnical Details
Protocol: Model Context Protocol (MCP) 2024-11-05
Transport: STDIO for local, secure communication
Image Model: gemini-2.5-flash-image
Output Format: PNG (base64 decoded)
Generation Time: ~8 seconds average
Image Size: 1024x1024 pixels (1:1 aspect ratio)
Security
⚠️ Never commit API keys to version control
Best practices:
Use environment variables for API keys
Store keys in secure configuration management
Rotate keys regularly
Use
.envfiles (already in.gitignore)
Troubleshooting
Server not appearing in Claude Desktop
Verify the configuration file path is correct
Ensure
mcp-nano-bananais in your PATHCheck that
GEMINI_API_KEYis setRestart Claude Desktop completely
Image generation fails
Verify API key is valid at Google AI Studio
Check Gemini API quotas and limits
Review error messages via
check_job_statusEnsure internet connectivity
Cannot save images
Verify file path is absolute (not relative)
Ensure write permissions for target directory
File path must end in
.pngParent directory must exist or be creatable
Requirements
Node.js ≥ 20.0.0 or Bun ≥ 1.1.0
Google Gemini API key
Internet connection for image generation
Contributing
Contributions welcome! Please:
Fork the repository
Create a feature branch
Make your changes with tests
Submit a pull request
License
MIT License - Copyright (c) 2025 Dennison Bertram
See LICENSE file for details.
Author
Dennison Bertram
Links
Made with ❤️ for the MCP and AI community
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
LLM chat, text tools, image generation, editing, batch image jobs, and asynchronous video generation
Generate AI images and videos from your agent: list models, start jobs, and fetch the results.
AI image + video generation for agents: --flag prompt DSL, async generate/poll, x402 pay-per-use.
Generate images, videos and music with model discovery, cost estimates and asynchronous results.
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
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to generate high-quality images using Google's Gemini and Imagen models with support for multiple aspect ratios, dynamic model selection, and direct file saving capabilities.MIT
- AlicenseAqualityDmaintenanceProvides AI-powered image generation through Google's Gemini models (Flash and Pro) with intelligent model selection, aspect ratio control, and support for both direct Gemini API and CLIProxyAPI proxy routing.46MIT
- AlicenseAqualityNot gradedmaintenanceEnables image generation using Gemini native models, supporting both single prompts and batch processing via a file-based queue. It allows for detailed configuration of aspect ratios and models using YAML frontmatter across various MCP-enabled clients.3MIT