Nano Banana Pro Image Generation for Claude Code
An MCP (Model Context Protocol) server that provides AI-powered image generation, format conversion, and smart asset placement for Claude Code.
Features
generate_image- Generate images from text prompts with automatic aspect ratio detectionconvert_image- Convert images between formats (PNG, JPG, WebP, ICO, ICNS)save_asset- Smart asset placement with project-aware naming conventions
Smart Detection
-
Aspect Ratio: Automatically detects the best size based on prompt keywords
- "icon", "avatar", "logo" → 1:1 (1024x1024)
- "banner", "hero", "header" → 16:9 (1280x720)
- "mobile", "story", "splash" → 9:16 (720x1280)
- "photo", "traditional" → 4:3 (1216x896)
-
Project Type: Detects your project framework and places assets accordingly
- Next.js, React, Vue →
public/images/orsrc/assets/ - Unity →
Assets/Images/ - Godot →
assets/images/ - Python →
assets/orstatic/images/
- Next.js, React, Vue →
-
Naming Convention: Matches your project's existing style
- kebab-case, snake_case, PascalCase, camelCase
Installation
From PyPI (Recommended)
# Using uv (recommended)
uv pip install nanobanana-pro-mcp
# Or using pip
pip install nanobanana-pro-mcp
Prerequisites
- Python 3.10+
- uv (recommended) or pip
Configure Claude Code
Add to your Claude Code MCP settings (~/.claude.json or project's .mcp.json):
{
"mcpServers": {
"nanobanana": {
"command": "uvx",
"args": [
"nanobanana-pro-mcp",
"--api-key=YOUR_API_KEY",
"--base-url=http://127.0.0.1:8045/v1"
]
}
}
}
Configuration Options
| Argument | Required | Description |
|---|---|---|
--api-key |
Yes | Your API key for the image generation service |
--base-url |
Yes | Base URL of the OpenAI-compatible image API |
--model |
No | Model name (default: gemini-3-pro-image) |
Usage Examples
Generate an Image
"Generate a futuristic city skyline at sunset"
The MCP will:
- Detect this should be a wide/banner image (16:9)
- Generate the image via your configured API
- Return a temporary file path and suggested filename
Convert Format
"Convert /tmp/futuristic-city.png to WebP"
For icons:
"Convert /tmp/app-logo.png to ICO"
This creates a proper Windows icon with all required sizes (16x16 through 256x256).
Save to Project
"Save /tmp/futuristic-city.png to my Next.js project at /home/user/my-app"
The MCP will:
- Detect it's a Next.js project
- Find or create
public/images/ - Apply kebab-case naming (or match existing convention)
- Save as
futuristic-city.png
Supported Formats
| Format | Read | Write | Notes |
|---|---|---|---|
| PNG | ✅ | ✅ | Default output format |
| JPG/JPEG | ✅ | ✅ | Converts RGBA to RGB |
| WebP | ✅ | ✅ | Great for web projects |
| ICO | ✅ | ✅ | Multi-size Windows icons |
| ICNS | ✅ | ✅ | macOS icons (basic support) |
Development
Local Setup
git clone https://github.com/rzgrozt/nanobanana-pro-mcp.git
cd nanobanana-pro-mcp
# Create virtual environment
uv venv
source .venv/bin/activate
# Install in development mode
uv pip install -e .
Testing Locally
nanobanana-pro-mcp --api-key=test --base-url=http://localhost:8045/v1
License
MIT License - see LICENSE for details.
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
Metadata
Release files for nanobanana-pro-mcp 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| nanobanana_pro_mcp-0.1.1.tar.gz | 8.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nanobanana_pro_mcp-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.1 kB
Release files / nanobanana_pro_mcp-0.1.1.tar.gz
| Download URL | nanobanana_pro_mcp-0.1.1.tar.gz |
|---|---|
| Size | 8.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2184e166191f6340d4f50949cb28a83ba44ecdaa581d51e7a389b5ea06a3e91e
|
|
BLAKE2b-256 checksum How to use checksums |
b1035d0fab05b9748ad86ef6fd88d979a31a44f2589c92c2593186e2a607b9c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.11
|
Release files / nanobanana_pro_mcp-0.1.1-py3-none-any.whl
| Download URL | nanobanana_pro_mcp-0.1.1-py3-none-any.whl |
|---|---|
| Size | 9.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e9430c89b121cac1e3c837a7340eacebfa3a905c06a8372ab251fc29ebcbe438
|
|
BLAKE2b-256 checksum How to use checksums |
19c9740d78a38e274bdb2c6c64d52c66f8448bfa89fd31a4c6497b4037bf9476
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.11
|
Security for nanobanana-pro-mcp 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.