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-previewas the default Nano Banana 2 modelgoogle/gemini-3-pro-image-previewfor higher-quality compositionsgoogle/gemini-2.5-flash-imagefor faster draft generation
This project exposes MCP tools like:
generate_imageupload_fileoutput_statsmaintenance
What Users Need
Claude Codeor another MCP clientuvPython 3.11+- a
POLZA_AI_API_KEY
Install in 2 Minutes
For Claude Code / VS Code, the fastest setup is:
- Install
uv - Create a
.mcp.jsonfile in your project root - 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_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:
- Publish the Python package to
PyPI - Update repository URLs in
pyproject.tomlandserver.json - Publish
server.jsonto theMCP Registry
The registry only stores metadata. The actual package still needs to exist on PyPI.
Publish Checklist
Before publishing:
- Create the GitHub repo
ivanantigravity-lgtm/nanobanana-2-polzaia-mcp-server - Bump the version
- Build and test:
PYTHONPYCACHEPREFIX=/tmp/pycache python3 -m compileall nanobanana_mcp_server tests
uv build
- Publish to PyPI
uv publish
- Publish
server.jsonwithmcp-publisher
brew install mcp-publisher
mcp-publisher login
mcp-publisher publish
Backend Notes
This server uses:
POST /v1/mediaGET /v1/media/{id}POST /v1/storage/uploadGET /v1/storage/files/{id}DELETE /v1/storage/files/{id}
through the Polza API.