Nano Banana

Provides AI-powered image generation via Gemini models with smart model selection and proxy support.
  • python

0

GitHub Stars

python

Language

6 months ago

First Indexed

3 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "ion-aluminium-nanobanana-mcp-cliproxyapi": {
      "command": "python3",
      "args": [
        "-m",
        "nanobanana_mcp_server.server"
      ],
      "env": {
        "NO_PROXY": "127.0.0.1,localhost",
        "GCP_REGION": "us-central1",
        "GCP_PROJECT_ID": "my-gcp-project",
        "GEMINI_API_KEY": "sk-abcdef1234567890",
        "CLIPROXY_API_KEY": "sk-your-cli-proxy-key",
        "NANOBANANA_MODEL": "pro",
        "CLIPROXY_BASE_URL": "http://127.0.0.1:8318",
        "NANOBANANA_AUTH_METHOD": "auto"
      }
    }
  }
}

You are using Nano Banana MCP Server to generate AI-powered images with Gemini models. This server automatically selects between fast and high-quality models, supports advanced features like aspect ratio control and Google grounding, and can route requests through a Gemini-compatible proxy for secure local setups. You can run it locally, connect through a variety of MCP clients, and tailor authentication and model behavior to your needs.

How to use

You run the MCP server and connect your MCP client to request image generations. The server exposes choices between a fast Flash model for rapid prototyping and a Pro model for higher quality outputs, including up to 4K resolution with Google Search grounding. You can control output size, aspect ratio, and other rendering details through the client, and the server will automatically select the best model based on your prompt and settings.

How to install

Prerequisites: you need Python 3.11 or newer. The MCP server can be run directly from source or installed from package sources that expose the server as an MCP service.

Option 1: Install from source (recommended for CLIProxyAPI users)

  1. Clone the repository

  2. Change into the project directory

  3. Synchronize/start the server locally using the standard runtime entry point

Option 2: Install via PyPI (Gemini direct)

  1. Install the package using your preferred Python package tool

  2. Run the server from the installed entry point

Configuration and runtime options

Authentication methods let you choose how requests are authenticated to Gemini. You can use an API key, Google Vertex AI ADC, automatic selection, or route requests through a local Gemini-compatible proxy.

Key environment variables you may configure include:

  • GEMINI_API_KEY: Your Gemini API key for direct access

  • NANOBANANA_AUTH_METHOD: Options are auto, vertex_ai, or other supported methods

  • GCP_PROJECT_ID and GCP_REGION: Used when Vertex AI ADC is active

  • CLIPROXY_BASE_URL and CLIPROXY_API_KEY: Route requests through a CLIProxyAPI proxy

  • NANOBANANA_MODEL: Choose between flash or pro, default auto

  • NO_PROXY: Comma-separated hosts that should bypass proxies

Usage patterns and examples

Use automatic model selection to let the server pick the best model for your prompt. If you request 4K resolution or enable grounding, the Pro model is typically chosen. For rapid drafts, the Flash model is preferred.

You can explicitly request a Pro or Flash output by configuring model_tier in your client if the API supports it. You can also control aspect ratios to fit formats like square social posts or cinematic widescreen.

Troubleshooting and notes

If you encounter authentication issues, verify that the correct environment variables are set and that your key or ADC credentials are valid. If the server cannot start, ensure you are using a recent version of the MCP server and that your MCP client supports the MCP interface.

Appendix: Quick-start CLIProxyAPI mode

In CLIProxyAPI mode you route through a local Gemini-compatible proxy. Set the proxy URL and API key, choose a model, and start the server with the usual Python entry point.

Available tools

generate_image

Generate an image from a prompt using the selected Gemini model with configurable options like resolution, aspect ratio, grounding, and thinking level.

set_model_tier

Choose between flash or pro model, or let the server auto-select based on the prompt and settings.

set_aspect_ratio

Specify output aspect ratio such as 1:1, 16:9, 21:9, etc.

enable_grounding

Enable Google Search grounding to improve factual accuracy in images.

set_thinking_level

Configure the AI thinking level for Pro mode to influence composition and reasoning.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational