Nano Banana MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add -e "GEMINI_API_KEY=${GEMINI_API_KEY}" nanobanana-d35b -- npx -y @saroby/nanobanana-mcp
Required:GEMINI_API_KEY
README.md

Google Gemini image generation MCP server

@saroby/nanobanana-mcp

Google Gemini image generation MCP server (Nano Banana).

Features

  • generate_image - Generate images using Google Gemini models
    • flash mode: gemini-2.5-flash-image (fast, ~2-3s)
    • pro mode: gemini-3-pro-image-preview (high quality, ~5-8s)
  • list_images - List generated images in a directory

Setup

Get API Key

  1. Go to Google AI Studio
  2. Create an API key

Install in Claude Code

claude mcp add nanobanana -e GEMINI_API_KEY=your-key-here -- npx -y @saroby/nanobanana-mcp

Manual Usage

GEMINI_API_KEY=your-key-here npx @saroby/nanobanana-mcp

Tools

generate_image

Parameter Type Required Description
prompt string Yes Image description (1-8192 chars)
model "flash" | "pro" No Model selection (default: flash)
aspect_ratio enum No 1:1, 16:9, 9:16, 4:3, 3:4
negative_prompt string No Elements to exclude
output_dir string No Save directory (default: ./nanobanana-images)
count number No Number of images 1-4 (default: 1)

list_images

Parameter Type Required Description
directory string No Directory to search (default: ./nanobanana-images)

Development

npm install
npm run build
npm run dev  # watch mode

License

MIT

Tools (2)

generate_imageGenerate images using Google Gemini models with support for custom aspect ratios and negative prompts.
list_imagesList generated images in a directory.

Environment Variables

GEMINI_API_KEYrequiredAPI key from Google AI Studio

Configuration

claude_desktop_config.json
{"mcpServers": {"nanobanana": {"command": "npx", "args": ["-y", "@saroby/nanobanana-mcp"], "env": {"GEMINI_API_KEY": "your-key-here"}}}}

Try it

Generate a high-quality image of a futuristic city skyline using the pro model.
Create 4 images of a cute robot reading a book with a 16:9 aspect ratio.
Generate an image of a mountain landscape, but make sure to exclude any clouds using a negative prompt.
List all the images I have generated in the default directory.

Frequently Asked Questions

What are the key features of Nano Banana?

Supports Google Gemini 2.5 Flash and Gemini 3.0 Pro image generation models. Configurable aspect ratios including 1:1, 16:9, 9:16, 4:3, and 3:4. Support for negative prompts to refine image output. Local directory management for generated images. Batch generation support for up to 4 images at once.

What can I use Nano Banana for?

Rapid prototyping of visual concepts for design projects. Generating custom assets for presentations or documentation. Automating the creation of image sets for creative brainstorming. Managing and organizing AI-generated assets directly from the Claude interface.

How do I install Nano Banana?

Install Nano Banana by running: claude mcp add nanobanana -e GEMINI_API_KEY=your-key-here -- npx -y @saroby/nanobanana-mcp

What MCP clients work with Nano Banana?

Nano Banana works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Nano Banana docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare