A production-ready MCP server for AI-powered image generation using Gemini 3 Pro Image and Gemini 2.5 Flash Image with intelligent model selection
Project description
Banana Image MCP
What is Banana Image MCP?
Banana Image MCP is an MCP (Model Context Protocol) server that enables Claude and other AI assistants to generate high-quality images using Google's latest Gemini image models.
Simply describe what you want, and Claude will create it - from quick concept sketches to stunning 4K professional artwork.
Key Features
| Feature | Description |
|---|---|
| 4K Ultra HD | Generate images up to 3840px with Pro model |
| Dual Model Support | Flash (fast, 2-3s) + Pro (4K quality, 5-8s) |
| Smart Model Selection | Automatically picks the best model based on your prompt |
| Google Search Grounding | Pro model uses real-world knowledge for accuracy |
| Flexible Aspect Ratios | 1:1, 16:9, 9:16, 4:3, 3:2, 21:9 and more |
| Image Editing | Edit existing images with natural language |
| Advanced Reasoning | Configurable thinking levels for complex compositions |
Quick Start
1. Get a Gemini API Key
Get your free API key from Google AI Studio
2. Install & Configure
For Claude Desktop, add to your config file:
{
"mcpServers": {
"banana-image": {
"command": "uvx",
"args": ["banana-image-mcp"],
"env": {
"GEMINI_API_KEY": "your-api-key-here"
}
}
}
}
Config file locations
| Platform | Path |
|---|---|
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Windows | %APPDATA%\Claude\claude_desktop_config.json |
| Linux | ~/.config/Claude/claude_desktop_config.json |
Other MCP clients (Cursor, VS Code, Cline, etc.)
The configuration is similar for other MCP-compatible clients:
{
"mcpServers": {
"banana-image": {
"command": "uvx",
"args": ["banana-image-mcp"],
"env": {
"GEMINI_API_KEY": "your-api-key-here"
}
}
}
}
Updating to the latest version
When using uvx, packages are cached locally. To get the latest version after an update:
# Clear the cache for this package
uv cache clean banana-image-mcp
# Then restart your MCP client (Claude Desktop, etc.)
Or specify a version explicitly:
{
"mcpServers": {
"banana-image": {
"command": "uvx",
"args": ["banana-image-mcp==1.0.0"],
"env": {
"GEMINI_API_KEY": "your-api-key-here"
}
}
}
}
3. Start Creating
Just ask Claude to generate images:
"Generate a cute cat wearing a space suit"
"Create a professional product photo of a coffee cup, 4K quality"
"Make a 16:9 YouTube thumbnail about cooking"
"Edit this image: make the sky more dramatic"
Models Comparison
| Model | Speed | Max Resolution | Best For |
|---|---|---|---|
| Gemini 2.5 Flash | 2-3s | 1024px | Quick drafts, iterations, prototypes |
| Gemini 3 Pro | 5-8s | 4K (3840px) | Final assets, marketing, professional work |
Model Selection
The server defaults to Pro model for best quality. You can also control it:
| Say this... | Model Used |
|---|---|
| "quick sketch", "draft", "prototype" | Flash |
| "4K", "professional", "high quality" | Pro |
| (default) | Pro |
Tool Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
prompt |
string | required | Image description |
model_tier |
string | "pro" |
"flash", "pro", or "auto" |
resolution |
string | "4k" |
"1k", "2k", "4k", "high" |
aspect_ratio |
string | - | "1:1", "16:9", "9:16", "4:3", "21:9", etc. |
thinking_level |
string | "high" |
"low" or "high" (Pro only) |
enable_grounding |
bool | true |
Enable Google Search grounding (Pro only) |
n |
int | 1 |
Number of images (1-4) |
negative_prompt |
string | - | What to avoid in the image |
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
GEMINI_API_KEY |
Yes | - | Your Gemini API key |
IMAGE_OUTPUT_DIR |
No | ~/banana-images |
Where to save generated images |
Example Outputs
Here are some examples of what you can create:
- Product Photography: Professional product shots with studio lighting
- Concept Art: Fantasy landscapes, character designs, sci-fi scenes
- Marketing Materials: Social media graphics, banners, thumbnails
- Technical Diagrams: Flowcharts, architecture diagrams with text
- Photo-realistic Images: Portraits, nature, urban photography
Development
# Clone the repository
git clone https://github.com/zengwenliang416/banana-image-mcp.git
cd banana-image-mcp
# Install dependencies
uv sync
# Run in development mode
fastmcp dev banana_image_mcp.server:create_app
# Run tests
pytest
# Lint and format
ruff check .
ruff format .
Changelog
v1.0.0
- First stable release
- 4K resolution output support (up to 3840px)
- Dual model support: Flash (fast) + Pro (4K quality)
- Intelligent model selection based on prompt
- Google Search grounding for Pro model
- Flexible aspect ratios (1:1, 16:9, 9:16, 4:3, 21:9, etc.)
- Image editing with natural language
- GitHub Actions CI/CD workflow
v0.1.2
- Added 4K resolution output support
- Default to Pro model and 4K resolution
- Fixed image_size parameter passing to Gemini API
v0.1.1
- Updated package metadata and author info
v0.1.0
- Initial release with dual model support
Links
License
MIT License - see LICENSE for details.
Made with by Wenliang Zeng
If you find this useful, please consider giving it a star!
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file banana_image_mcp-1.0.0.tar.gz.
File metadata
- Download URL: banana_image_mcp-1.0.0.tar.gz
- Upload date:
- Size: 190.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1dbc75bf7ff83d9893e23e1d6f3ef035f4dcad3e93026c488bef923ac3fb4d9c
|
|
| MD5 |
1f62c072d1596c1cfd91bee594884c1c
|
|
| BLAKE2b-256 |
ca5eec8ac4eb6dfb37c8fe25262d94dac5565ca12c0cebbc09a3db9778eb6a92
|
File details
Details for the file banana_image_mcp-1.0.0-py3-none-any.whl.
File metadata
- Download URL: banana_image_mcp-1.0.0-py3-none-any.whl
- Upload date:
- Size: 81.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb3deb592cabd84ddd7a5bbe1b41aa7b0bfeba86a399ac2bdd3be8db8f89c06f
|
|
| MD5 |
57a0d8aa12e1806e038fa5abed816389
|
|
| BLAKE2b-256 |
8d4d1d1779ed734c7ad64ad65123f39069225976880ec9220f6d693c52739c93
|