Skip to content

Configuration ​

API Key Setup ​

  1. Visit Google AI Studio
  2. Create a new API key
  3. Configure using one of the methods below

Configuration Priority ​

The server loads your API key in this order:

  1. MCP environment variables (highest priority) — set in your MCP client config
  2. System environment variable — GEMINI_API_KEY
  3. Config file — ~/.nano-banana-config.json (created via configure_gemini_token tool)

Claude Code ​

With environment variable (recommended):

json
{
  "mcpServers": {
    "nano-banana": {
      "command": "npx",
      "args": ["-y", "github:fjacquet/Nano-Banana-MCP"],
      "env": {
        "GEMINI_API_KEY": "your-gemini-api-key-here"
      }
    }
  }
}

Without environment variable:

json
{
  "mcpServers": {
    "nano-banana": {
      "command": "npx",
      "args": ["-y", "github:fjacquet/Nano-Banana-MCP"]
    }
  }
}

Cursor ​

With environment variable (recommended):

json
{
  "nano-banana": {
    "command": "npx",
    "args": ["nano-banana-mcp"],
    "env": {
      "GEMINI_API_KEY": "your-gemini-api-key-here"
    }
  }
}

Without environment variable:

json
{
  "nano-banana": {
    "command": "npx",
    "args": ["nano-banana-mcp"]
  }
}

Other MCP Clients ​

System environment variable:

bash
export GEMINI_API_KEY="your-gemini-api-key-here"
npx -y github:fjacquet/Nano-Banana-MCP

Using the configure tool:

bash
npx -y github:fjacquet/Nano-Banana-MCP
# Then use configure_gemini_token tool to set your key
# Saves to ~/.nano-banana-config.json

Model Selection ​

Five models are available:

ModelIDUse Case
Nano Banana 2.1gemini-nano-banana-2.1Pro quality at Flash speed — default for all tools
Nano Banana Progemini-3-pro-imageProfessional quality, advanced reasoning
Nano Banana 2gemini-3.1-flash-imagePrevious default
Nano Banana 2 Litegemini-3.1-flash-lite-imageFastest and cheapest — 1K output only, no Google Search grounding
Nano Bananagemini-2.5-flash-imageLegacy — shut down by Google on 2027-03-15

Pass the model parameter to any generation/editing tool to select the model.

File Storage ​

Images are saved to platform-appropriate locations:

  • Windows: %USERPROFILE%\Documents\nano-banana-images\
  • macOS/Linux: ./generated_imgs/ (in current directory)
  • System directories: ~/nano-banana-images/ (when run from system paths)

File naming: generated-[timestamp]-[id].png or edited-[timestamp]-[id].png

Released under the MIT License.