Skip to main content

Nano Banana Pro Image Generation for Claude Code - MCP server for automatic image generation, conversion, and smart asset placement

Project description

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 detection
  • convert_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/ or src/assets/
    • Unity → Assets/Images/
    • Godot → assets/images/
    • Python → assets/ or static/images/
  • 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:

  1. Detect this should be a wide/banner image (16:9)
  2. Generate the image via your configured API
  3. 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:

  1. Detect it's a Next.js project
  2. Find or create public/images/
  3. Apply kebab-case naming (or match existing convention)
  4. 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/YOUR_USERNAME/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.

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

nanobanana_pro_mcp-0.1.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

nanobanana_pro_mcp-0.1.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nanobanana_pro_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for nanobanana_pro_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e0522f9eeea4e03a3a34641268cfa991aebb5d286a609401e252be3625399e4a
MD5 807774c43c1ec0037a86a27c55159b25
BLAKE2b-256 682b71a94ee07fc770bca1cf83890c26d1c51e6fe499fcf373ad0367a0358af6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nanobanana_pro_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4edecd25ce3da4942f783d38f36828e835bbb78af23162612d66817c2392e2ea
MD5 5bfe9c8b27e7e166a65165df197ba467
BLAKE2b-256 e8f4566fa4f33d50e13e7077de60ce0f337d099c5e1433466608dbbf1e984a13

See more details on using hashes here.

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