Skip to main content

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

Project description

Nano Banana 2 Polza MCP Server

mcp-name: io.github.ivanantigravity-lgtm/nanobanana-2-polzaia-mcp-server

MCP server for image generation and editing through Polza, 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

Install in 2 Minutes

For Claude Code / VS Code, the fastest setup is:

  1. Install uv
  2. Create a .mcp.json file in your project root
  3. Paste this config and add your Polza key
{
  "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/yourname/Documents/nanobanana"
      }
    }
  }
}

Then restart Claude Code / VS Code.

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_2_polzaia_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_2_polzaia_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_2_polzaia_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 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.6.tar.gz (261.5 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.6-py3-none-any.whl (86.8 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for nanobanana_2_polzaia_mcp_server-0.4.6.tar.gz
Algorithm Hash digest
SHA256 e1bd2892eaadd8e42458fc0f9cfa3a5e5a912b77fd1ea6b6e8fec1c4209ae5ab
MD5 421b9983087538662edfcd7dbc049379
BLAKE2b-256 c8968677f96dddab947fa297b28bff3f8abd1e68579a84455f55e24af9cbcb9e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nanobanana_2_polzaia_mcp_server-0.4.6-py3-none-any.whl
Algorithm Hash digest
SHA256 500714360f7aedf8c358eb011d2782278c42302431965b7dea077f8ac3501648
MD5 013a6048873cb5c9aa1c43ae35abede0
BLAKE2b-256 86ff72fcd1fb17991cc1d14ccab0976fc1ca7d57d47f0612bdf98dca49288b1d

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