Skip to main content

Nano Banana MCP Server 🍌

A production-ready Model Context Protocol (MCP) server that provides AI-powered image generation capabilities through Google's Gemini 2.5 Flash Image model.

✨ Features

  • 🎨 AI Image Generation: Create high-quality images from detailed text prompts
  • 📋 Smart Templates: Pre-built prompt templates for photography, design, and editing
  • 📁 File Management: Upload and manage files via Gemini Files API
  • 🔍 Resource Discovery: Browse templates and file metadata through MCP resources
  • 🛡️ Production Ready: Comprehensive error handling, logging, and validation
  • ⚡ High Performance: Optimized architecture with intelligent caching

🚀 Quick Start

Prerequisites

  1. Google Gemini API Key - Get one free here
  2. Python 3.11+ (for development only)

Installation

Option 1: From MCP Registry (Recommended) This server is available in the Model Context Protocol Registry. Install it using your MCP client.

mcp-name: io.github.zhongweili/nanobanana-mcp-server

Option 2: Using uvx

uvx nanobanana-mcp-server@latest

Option 3: Using pip

pip install nanobanana-mcp-server

🔧 Configuration

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "nanobanana": {
      "command": "uvx",
      "args": ["nanobanana-mcp-server@latest"],
      "env": {
        "GEMINI_API_KEY": "your-gemini-api-key-here"
      }
    }
  }
}

Configuration file locations:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Claude Code (VS Code Extension)

Install and configure in VS Code:

  1. Install the Claude Code extension
  2. Open Command Palette (Cmd/Ctrl + Shift + P)
  3. Run "Claude Code: Add MCP Server"
  4. Configure:
    {
      "name": "nanobanana",
      "command": "uvx",
      "args": ["nanobanana-mcp-server@latest"],
      "env": {
        "GEMINI_API_KEY": "your-gemini-api-key-here"
      }
    }
    

Cursor

Add to Cursor's MCP configuration:

{
  "mcpServers": {
    "nanobanana": {
      "command": "uvx",
      "args": ["nanobanana-mcp-server@latest"],
      "env": {
        "GEMINI_API_KEY": "your-gemini-api-key-here"
      }
    }
  }
}

Continue.dev (VS Code/JetBrains)

Add to your config.json:

{
  "mcpServers": [
    {
      "name": "nanobanana",
      "command": "uvx",
      "args": ["nanobanana-mcp-server@latest"],
      "env": {
        "GEMINI_API_KEY": "your-gemini-api-key-here"
      }
    }
  ]
}

Open WebUI

Configure in Open WebUI settings:

{
  "mcp_servers": {
    "nanobanana": {
      "command": ["uvx", "nanobanana-mcp-server@latest"],
      "env": {
        "GEMINI_API_KEY": "your-gemini-api-key-here"
      }
    }
  }
}

Gemini CLI / Generic MCP Client

# Set environment variable
export GEMINI_API_KEY="your-gemini-api-key-here"

# Run server in stdio mode
uvx nanobanana-mcp-server@latest

# Or with pip installation
python -m nanobanana_mcp_server.server

⚙️ Environment Variables

Optional configuration:

# Required
GEMINI_API_KEY=your-gemini-api-key-here

# Optional
IMAGE_OUTPUT_DIR=/path/to/image/directory  # Default: ~/nanobanana-images
LOG_LEVEL=INFO                             # DEBUG, INFO, WARNING, ERROR
LOG_FORMAT=standard                        # standard, json, detailed

🐛 Troubleshooting

Common Issues

"GEMINI_API_KEY not set"

  • Add your API key to the MCP server configuration in your client
  • Get a free API key at Google AI Studio

"Server failed to start"

  • Ensure you're using the latest version: uvx nanobanana-mcp-server@latest
  • Check that your client supports MCP (Claude Desktop 0.10.0+)

"Permission denied" errors

  • The server creates images in ~/nanobanana-images by default
  • Ensure write permissions to your home directory

Development Setup

For local development:

# Clone repository
git clone https://github.com/zhongweili/nanobanana-mcp-server.git
cd nanobanana-mcp-server

# Install with uv
uv sync

# Set environment
export GEMINI_API_KEY=your-api-key-here

# Run locally
uv run python -m nanobanana_mcp_server.server

📄 License

MIT License - see LICENSE for details.

🆘 Support

Metadata

Release files for iflow-mcp_nanobanana-mcp-server 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iflow-mcp_nanobanana-mcp-server 0.1.6
File Size Uploaded
iflow_mcp_nanobanana_mcp_server-0.1.6.tar.gz 181.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for iflow-mcp_nanobanana-mcp-server 0.1.6
File Interpreter ABI Platform
iflow_mcp_nanobanana_mcp_server-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 248.6 kB

Release files / iflow_mcp_nanobanana_mcp_server-0.1.6.tar.gz

Download URL iflow_mcp_nanobanana_mcp_server-0.1.6.tar.gz
Size 181.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e636f7a70ee57f69e2074028e490367fdc2d9a98f8749bf7391eef7d66f9ed6e
BLAKE2b-256 checksum
How to use checksums
7d2d85f2c3a5c35945176e58797b3e8b065a1e832b1e257e14e9ab841a2cb914
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.9

Release files / iflow_mcp_nanobanana_mcp_server-0.1.6-py3-none-any.whl

Download URL iflow_mcp_nanobanana_mcp_server-0.1.6-py3-none-any.whl
Size 67.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2bc92c0b9791903b74971cf30aa42fb3ac415be5e1e3fbda6915414ba9ee6ccc
BLAKE2b-256 checksum
How to use checksums
3fdf21f6c259677e82d0b38adcfee329e17080d2f2dfdfb79d6f9c4120ed18ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.9

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page