replicate-nano-banana-mcp
An MCP (Model Context Protocol) server for generating images using Google's Nano Banana Pro model via Replicate.
Features
- MCP Server: Expose image generation as an MCP tool for use with Claude and other MCP-compatible clients
- CLI Tool: Command-line interface for quick image generation testing
Installation
pip install replicate-nano-banana-mcp
Or with uv:
uv pip install replicate-nano-banana-mcp
Configuration
Set your Replicate API token as an environment variable:
export REPLICATE_API_TOKEN=your_token_here
Usage
MCP Server
Run the MCP server:
replicate-nano-banana-mcp
Or with uv:
uv run replicate-nano-banana-mcp
Claude Desktop Configuration
Add this to your Claude Desktop configuration file (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"nano-banana": {
"command": "uv",
"args": [
"--directory",
"/path/to/replicate-nano-banana-mcp",
"run",
"replicate-nano-banana-mcp"
],
"env": {
"REPLICATE_API_TOKEN": "your_token_here"
}
}
}
}
Or if installed globally:
{
"mcpServers": {
"nano-banana": {
"command": "replicate-nano-banana-mcp",
"env": {
"REPLICATE_API_TOKEN": "your_token_here"
}
}
}
}
CLI Tool
Generate an image from the command line:
nano-banana-cli "A beautiful sunset over the ocean"
With options:
nano-banana-cli "A futuristic cityscape" \
--resolution 2K \
--aspect-ratio 16:9 \
--output-format png \
--safety-filter block_only_high
CLI Options
prompt: Text description of the image to generate (required)--resolution: Output resolution -1Kor2K(default:2K)--aspect-ratio: Aspect ratio -1:1,4:3,3:4,16:9,9:16(default:4:3)--output-format: Image format -png,jpg,webp(default:png)--safety-filter: Safety level -block_low_and_above,block_medium_and_above,block_only_high(default:block_only_high)
MCP Tool
The server exposes a single tool:
generate_image
Generate an image using Google's Nano Banana Pro model.
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
prompt |
string | (required) | Text description of the image to generate |
resolution |
string | "2K" |
Output resolution: "1K" or "2K" |
aspect_ratio |
string | "4:3" |
Aspect ratio: "1:1", "4:3", "3:4", "16:9", "9:16" |
output_format |
string | "png" |
Output format: "png", "jpg", "webp" |
safety_filter_level |
string | "block_only_high" |
Safety filter: "block_low_and_above", "block_medium_and_above", "block_only_high" |
Returns: URL of the generated image.
Development
Clone the repository:
git clone https://github.com/sugarforever/replicate-nano-banana-mcp.git
cd replicate-nano-banana-mcp
Install dependencies:
uv sync
Run the server in development:
uv run replicate-nano-banana-mcp
Run the CLI in development:
uv run nano-banana-cli "Your prompt here"
License
MIT License - see LICENSE for details.
Metadata
Release files for replicate-nano-banana-mcp 0.1.0
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 | Actions |
|---|---|---|---|---|
| replicate_nano_banana_mcp-0.1.0.tar.gz | 4.2 kB | Without provenance | Details for replicate_nano_banana_mcp-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| replicate_nano_banana_mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for replicate_nano_banana_mcp-0.1.0-py3-none-any.whl |
Total release size: 10.5 kB
Release files / replicate_nano_banana_mcp-0.1.0.tar.gz
| Download URL | replicate_nano_banana_mcp-0.1.0.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
88da2b52b37ee1ab17c4e42361b5317f7a976adce27fd9d8e722c326944be131
|
|
BLAKE2b-256 checksum How to use checksums |
050280229e72b25f82242e4f0c9c0513fbf9eeb976fc91c10287c7072f53fef6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.4
|
Release files / replicate_nano_banana_mcp-0.1.0-py3-none-any.whl
| Download URL | replicate_nano_banana_mcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e255861cfbb4299dbd23026be577ec762098073cf00faa765cee1de2732f82a6
|
|
BLAKE2b-256 checksum How to use checksums |
c53e80231c0c8a523319bacaa371ef3b2a838d14c8b356611bb2cdfe89c0def4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.4
|
Security for replicate-nano-banana-mcp 0.1.0
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.