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.7.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.7-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.7.tar.gz.

File metadata

File hashes

Hashes for nanobanana_2_polzaia_mcp_server-0.4.7.tar.gz
Algorithm Hash digest
SHA256 bc19b952bd54973c7ba93327924071becfc91c949cfa05bb62bdf6c67999d995
MD5 8f3f34b2ce11c13f70e826e2e6764c7c
BLAKE2b-256 3b5d9c290b65369ccf7cff038de29bd70ae5134452aac2dd874ab8fbf2c6c583

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nanobanana_2_polzaia_mcp_server-0.4.7-py3-none-any.whl
Algorithm Hash digest
SHA256 b5fed18b61dd6cf55a962be11eec0b8befee07f9e7f015ffaa9d8ed610bc11b7
MD5 595ec96bc117fa6da8bab662ca4bb7cd
BLAKE2b-256 bea50856505a5c85d4415a5ccea4c63e1e20c48e675e8fa854f35090e23a7222

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