Skip to main content

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 description
  • model_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 results
  • output_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


Download files

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

Source Distribution

gemini_image_mcp-1.1.0.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

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

gemini_image_mcp-1.1.0-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file gemini_image_mcp-1.1.0.tar.gz.

File metadata

  • Download URL: gemini_image_mcp-1.1.0.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gemini_image_mcp-1.1.0.tar.gz
Algorithm Hash digest
SHA256 922ee91bb7e089cc1a15a1ca87bcd1c6378e5446bff59d3027123ccf0550a012
MD5 dab773d841f20542d3649586780d1252
BLAKE2b-256 81aa39d3c11226c12ccad66530c19f253d28d2d6b460515050acb3828a9ca178

See more details on using hashes here.

Provenance

The following attestation bundles were made for gemini_image_mcp-1.1.0.tar.gz:

Publisher: publish.yml on channel47/nano-banana-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gemini_image_mcp-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for gemini_image_mcp-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c1143e13bb3b3e6af57426f1975e7dc0d03c2af81b10dda935da6e5eee2883b1
MD5 4a10df9c88b70fb65c31ad79d0b4d112
BLAKE2b-256 0d7c98a8af5d67a95f1acf4c54173a3e2a880db882b554b44f31aff36322b02c

See more details on using hashes here.

Provenance

The following attestation bundles were made for gemini_image_mcp-1.1.0-py3-none-any.whl:

Publisher: publish.yml on channel47/nano-banana-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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