Skip to main content

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 - 1K or 2K (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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

replicate_nano_banana_mcp-0.1.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

replicate_nano_banana_mcp-0.1.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file replicate_nano_banana_mcp-0.1.0.tar.gz.

File metadata

File hashes

Hashes for replicate_nano_banana_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 88da2b52b37ee1ab17c4e42361b5317f7a976adce27fd9d8e722c326944be131
MD5 597bde800a3535e0a6d5bc6f70ac3b59
BLAKE2b-256 050280229e72b25f82242e4f0c9c0513fbf9eeb976fc91c10287c7072f53fef6

See more details on using hashes here.

File details

Details for the file replicate_nano_banana_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for replicate_nano_banana_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e255861cfbb4299dbd23026be577ec762098073cf00faa765cee1de2732f82a6
MD5 e4ce90a3579a8315eee084e0d7e95a93
BLAKE2b-256 c53e80231c0c8a523319bacaa371ef3b2a838d14c8b356611bb2cdfe89c0def4

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page