Configuration
API Key Setup
- Visit Google AI Studio
- Create a new API key
- Configure using one of the methods below
Configuration Priority
The server loads your API key in this order:
- MCP environment variables (highest priority) — set in your MCP client config
- System environment variable —
GEMINI_API_KEY - Config file —
~/.nano-banana-config.json(created viaconfigure_gemini_tokentool)
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-MCPUsing 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.jsonModel Selection
Five models are available:
| Model | ID | Use Case |
|---|---|---|
| Nano Banana 2.1 | gemini-nano-banana-2.1 | Pro quality at Flash speed — default for all tools |
| Nano Banana Pro | gemini-3-pro-image | Professional quality, advanced reasoning |
| Nano Banana 2 | gemini-3.1-flash-image | Previous default |
| Nano Banana 2 Lite | gemini-3.1-flash-lite-image | Fastest and cheapest — 1K output only, no Google Search grounding |
| Nano Banana | gemini-2.5-flash-image | Legacy — 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