MCP server for AI-powered image generation using Google Gemini models
Project description
gemini-image-mcp
MCP server for AI-powered image generation using Google Gemini models.
Also known as "Nano Banana" - the friendly name for this image generation server.
Features
- Dual Model Support: Flash (2-3s, 1024px) and Pro (4K quality)
- Smart Model Selection: Auto-selects based on prompt keywords
- Aspect Ratio Control: 1:1, 16:9, 9:16, 21:9, 4:3, 3:4, 2:1
- Google Search Grounding: Factually accurate images (Pro only)
- File Management: Upload, list, and delete files via Gemini Files API
- Reproducible Generation: Seed support for consistent results
Installation
Via uvx (Recommended)
No installation needed - runs directly:
uvx gemini-image-mcp
Via pip
pip install gemini-image-mcp
Via pipx
pipx install gemini-image-mcp
Configuration
Environment Variable
Get your free API key from Google AI Studio.
export GEMINI_API_KEY="your-api-key-here"
Claude Code Integration
Add to your .mcp.json:
{
"mcpServers": {
"nano-banana": {
"command": "uvx",
"args": ["gemini-image-mcp"]
}
}
}
Or configure in ~/.claude/settings.json:
{
"env": {
"GEMINI_API_KEY": "your-api-key-here"
}
}
Tools
generate_image
Generate images with automatic model selection.
mcp__nano-banana__generate_image
Parameters:
prompt(required): Image descriptionmodel_tier: "flash", "pro", or "auto" (default: auto)aspect_ratio: "1:1", "16:9", "9:16", etc. (default: 1:1)thinking_level: "LOW" or "HIGH" (Pro only)use_grounding: Enable Google Search grounding (Pro only)safety_level: "STRICT", "MODERATE", "PERMISSIVE", "OFF"seed: Integer for reproducible resultsoutput_path: File path to save image
list_files
List uploaded files.
mcp__nano-banana__list_files
upload_file
Upload a file for use as reference.
mcp__nano-banana__upload_file
delete_file
Delete an uploaded file.
mcp__nano-banana__delete_file
Model Selection
Pro model auto-selects for prompts containing:
- professional, 4k, high quality, detailed, photorealistic
- ultra, premium, studio, commercial, product photo
Flash model auto-selects for prompts containing:
- quick, fast, sketch, draft, concept, rough
- preview, test, iterate, simple, basic
Development
# Clone and setup
git clone https://github.com/channel47/nano-banana-mcp.git
cd nano-banana-mcp
uv venv && source .venv/bin/activate
uv pip install -e ".[dev]"
# Run tests
pytest tests/ -v
# Format code
ruff format src/ tests/
ruff check src/ tests/
License
MIT
Project details
Release history Release notifications | RSS feed
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 gemini_image_mcp-1.0.0.tar.gz.
File metadata
- Download URL: gemini_image_mcp-1.0.0.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84d029fcba18f2de607ef1c9e531fe2fec9cabfc40c26de5b98824c5ff62da28
|
|
| MD5 |
2d3296c66997013d5db78347e56cbe99
|
|
| BLAKE2b-256 |
4363a9f1af2dcd25387623af14c2ed35c72b2dcca4e54d8263fab34d2cdada96
|
Provenance
The following attestation bundles were made for gemini_image_mcp-1.0.0.tar.gz:
Publisher:
publish.yml on channel47/nano-banana-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gemini_image_mcp-1.0.0.tar.gz -
Subject digest:
84d029fcba18f2de607ef1c9e531fe2fec9cabfc40c26de5b98824c5ff62da28 - Sigstore transparency entry: 813303440
- Sigstore integration time:
-
Permalink:
channel47/nano-banana-mcp@4ff2874449307ff4ba8f00fc32c440111ca958ce -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/channel47
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4ff2874449307ff4ba8f00fc32c440111ca958ce -
Trigger Event:
push
-
Statement type:
File details
Details for the file gemini_image_mcp-1.0.0-py3-none-any.whl.
File metadata
- Download URL: gemini_image_mcp-1.0.0-py3-none-any.whl
- Upload date:
- Size: 11.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5f6735846b3192893463a74225438c2d35d9892dc5646bffbf070e0c0b056e3
|
|
| MD5 |
e1550b942b6df9a0b7763efd14779fc5
|
|
| BLAKE2b-256 |
3ea89d4cd4485386a7285661db057877ef0634240e2c21cd45bb93326c697a42
|
Provenance
The following attestation bundles were made for gemini_image_mcp-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on channel47/nano-banana-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gemini_image_mcp-1.0.0-py3-none-any.whl -
Subject digest:
c5f6735846b3192893463a74225438c2d35d9892dc5646bffbf070e0c0b056e3 - Sigstore transparency entry: 813303441
- Sigstore integration time:
-
Permalink:
channel47/nano-banana-mcp@4ff2874449307ff4ba8f00fc32c440111ca958ce -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/channel47
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4ff2874449307ff4ba8f00fc32c440111ca958ce -
Trigger Event:
push
-
Statement type: