Skip to main content

An MCP server for Nano Banana image generation through the Polza AI media API

Project description

Nano Banana 2 Polza AI MCP Server

MCP server for image generation and editing through Polza AI, using:

  • google/gemini-3.1-flash-image-preview as the default Nano Banana 2 model
  • google/gemini-3-pro-image-preview for higher-quality compositions
  • google/gemini-2.5-flash-image for faster draft generation

This project exposes MCP tools like:

  • generate_image
  • upload_file
  • output_stats
  • maintenance

What Users Need

  • Claude Code or another MCP client
  • uv
  • Python 3.11+
  • a POLZA_AI_API_KEY

Local Development

git clone https://github.com/ivanantigravity-lgtm/nanobanana-2-polzaia-mcp-server.git
cd nanobanana-2-polzaia-mcp-server
uv sync
cp .env.example .env

Set at minimum:

POLZA_AI_API_KEY=your_polza_api_key
POLZA_BASE_URL=https://polza.ai/api
IMAGE_OUTPUT_DIR=/absolute/path/to/output

Run locally:

uv run python -m nanobanana_mcp_server.server

Claude Code / VS Code

If the package is published to PyPI, the easy install path is a project-level .mcp.json:

{
  "mcpServers": {
    "nanobanana-polza": {
      "command": "uvx",
      "args": ["nanobanana-2-polzaia-mcp-server@latest"],
      "env": {
        "POLZA_AI_API_KEY": "your-polza-api-key-here",
        "POLZA_BASE_URL": "https://polza.ai/api",
        "IMAGE_OUTPUT_DIR": "/Users/demo/Documents/nanobanana"
      }
    }
  }
}

If the user runs from source instead of a published package:

{
  "mcpServers": {
    "nanobanana-polza-local": {
      "command": "uv",
      "args": ["run", "python", "-m", "nanobanana_mcp_server.server"],
      "cwd": "/absolute/path/to/nanobanana-2-polzaia-mcp-server",
      "env": {
        "POLZA_AI_API_KEY": "your-polza-api-key-here",
        "POLZA_BASE_URL": "https://polza.ai/api",
        "IMAGE_OUTPUT_DIR": "/absolute/path/to/output"
      }
    }
  }
}

Claude Desktop

On macOS, add the same server to:

~/Library/Application Support/Claude/claude_desktop_config.json

Example:

{
  "mcpServers": {
    "nanobanana-polza": {
      "command": "uvx",
      "args": ["nanobanana-2-polzaia-mcp-server@latest"],
      "env": {
        "POLZA_AI_API_KEY": "your-polza-api-key-here",
        "POLZA_BASE_URL": "https://polza.ai/api",
        "IMAGE_OUTPUT_DIR": "/Users/demo/Documents/nanobanana"
      }
    }
  }
}

What Still Needs To Be Published

To make installation as easy as the screenshot flow:

  1. Publish the Python package to PyPI
  2. Update repository URLs in pyproject.toml and server.json
  3. Publish server.json to the MCP Registry

The registry only stores metadata. The actual package still needs to exist on PyPI.

Publish Checklist

Before publishing:

  1. Create the GitHub repo ivanantigravity-lgtm/nanobanana-2-polzaia-mcp-server
  2. Bump the version
  3. Build and test:
PYTHONPYCACHEPREFIX=/tmp/pycache python3 -m compileall nanobanana_mcp_server tests
uv build
  1. Publish to PyPI
uv publish
  1. Publish server.json with mcp-publisher
brew install mcp-publisher
mcp-publisher login
mcp-publisher publish

Backend Notes

This server uses:

  • POST /v1/media
  • GET /v1/media/{id}
  • POST /v1/storage/upload
  • GET /v1/storage/files/{id}
  • DELETE /v1/storage/files/{id}

through the Polza AI API.

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_2_polzaia_mcp_server-0.4.4.tar.gz (260.7 kB view details)

Uploaded Source

Built Distribution

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

nanobanana_2_polzaia_mcp_server-0.4.4-py3-none-any.whl (86.1 kB view details)

Uploaded Python 3

File details

Details for the file nanobanana_2_polzaia_mcp_server-0.4.4.tar.gz.

File metadata

File hashes

Hashes for nanobanana_2_polzaia_mcp_server-0.4.4.tar.gz
Algorithm Hash digest
SHA256 6eff71b17fd6fa7c5ffe3a043f9b82e7ca7e64de92c1d033673639dc069f2591
MD5 7b593bd7e29f86293c8b32c1da127402
BLAKE2b-256 6ade8d8b6b34feb3f120f7d20051f0d810e9e78e26c8e309c8bd5ef79f8f97ca

See more details on using hashes here.

File details

Details for the file nanobanana_2_polzaia_mcp_server-0.4.4-py3-none-any.whl.

File metadata

File hashes

Hashes for nanobanana_2_polzaia_mcp_server-0.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 baf3316e31d3f43eebd4983c37a449045c4640feb32a1c42cc56a978beef6093
MD5 f3b692cac19dc69cd4d12df7664e3706
BLAKE2b-256 ef9b42a8defe388963dd3355a1a78d196d08cfbe872ae2f90243d4009d4ed967

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