nano-banana-mcp

by petrkindlmann

Not rated
GitHub

Description

A Model Context Protocol server for AI image generation and editing with Google's Gemini "Nano Banana" image models, via the Interactions API. Generate, edit, and iterate on images directly from Claude Code, Claude Desktop, Cursor, or any MCP-compatible client — with multi-turn…

About

A Model Context Protocol server for AI image generation and editing with Google's Gemini "Nano Banana" image models, via the Interactions API. Generate, edit, and iterate on images directly from Claude Code, Claude Desktop, Cursor, or any MCP-compatible client — with multi-turn editing, search grounding, interleaved…

Details

Author
petrkindlmann
Categories
Design, AI, Other

Setup

Install nano-banana-mcp in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/petrkindlmann/nano-banana-mcp

Follow the installation instructions in the repository README, then restart your MCP client.

AModel Context Protocolserver forAI image generation and editingwith Google's Gemini "Nano Banana" image models, via theInteractions API.

Generate, edit, and iterate on images directly from Claude Code, Claude Desktop, Cursor, or any MCP-compatible client — with multi-turn editing, search grounding, interleaved storyboards, style-consistent icon sets, and image-from-video.

All generated by this server — a photoreal product shot, an isometric illustration with legible text, and a vector sticker. No edits.

Note:This server uses the GeminiInteractions API, which is currently inbeta. The Gemini 3 image models (gemini-3-pro-image,gemini-3.1-flash-image) may require access on your API key. Thenanotier (gemini-2.5-flash-image) is the most widely available. SeeRequirements.

- Text-to-image— high-quality images from a prompt, up to 4K, with aspect-ratio and resolution control
- Multi-turn editing— iterate conversationally; each result returns aninteraction_idyou pass back to keep editing
- Reference images— up to 14 inputs for virtual try-on, product placement, compositing, style transfer, photo restoration, attribute replacement, 2D→3D mockups
- Search grounding— ground images in real-time data (weather, news, scores) with Google Search and Google Image Search
- Interleaved stories— one prompt → a sequence of captioned images (storyboards, comics, recipes, illustrated explainers)
- Style-consistent icon sets— chained generation keeps a uniform look across an icon set
- Image from video— generate thumbnails/posters from a public YouTube URL
- Inline previews— downscaled previews returned to the client so the model can see what it generated and self-correct
- Robust— automatic retries with backoff on rate limits and transient errors; clear, actionable error messages

git clone https://github.com/petrkindlmann/nano-banana-mcp.git cd nano-banana-mcp npm install
claude mcp add nano-banana --scope user \ --env GEMINI_API_KEY=your_key_here \ -- node /absolute/path/to/nano-banana-mcp/index.js

Claude Desktop / Cursor / Windsurf / VS Code

Add to your MCP config (e.g.~/Library/Application Support/Claude/claude_desktop_config.jsonon macOS):

{ "mcpServers": { "nano-banana": { "command": "node", "args": ["/absolute/path/to/nano-banana-mcp/index.js"], "env": { "GEMINI_API_KEY": "your_key_here" } } } }

Restart your client. The five tools below will appear.

The model IDs are beta/preview models that Google rotates and occasionally retires. If a newer version ships — or a configured ID is deprecated — point a tier at a new model without editing code:

"env": { "GEMINI_API_KEY": "your_key_here", "NANO_BANANA_MODEL_FLASH": "gemini-3.2-flash-image" }

Each tier keeps its capability profile (sizes, aspect ratios, grounding) regardless of the ID you assign it.

Just ask in natural language — your MCP client picks the right tool and arguments.

You:Generate a 16:9 hero image of a misty pine forest at dawn, cinematic, save it tohero.jpg

Claude:callsgenerate_image→ saveshero.jpg, returns aninteraction_idand a preview

You:Make the fog heavier and add a deer in the clearing

Claude:callsedit_imagewith the previousinteraction_idhero-v2.jpg

Multi-turn editing is the recommended way to iterate: each result carries aninteraction_id, and passing it back keeps the full conversation context so edits stay consistent.

- flash(default) — your go-to.Best all-around balance of quality, cost, and latency. Up to 4K, search grounding, the widest aspect ratios (21:9,1:4, etc.), and the only tier that accepts video input.
- pro— the highest-quality renderer.Use for professional/deliverable assets, complex multi-element instructions, and legibletext rendered inside the image(infographics, posters, menus). A built-in "Thinking" pass refines composition before rendering. Slower and pricier.
- nano— speed and volume.1K-only, no grounding/thinking, always returns PNG. Reach for it when generating many images fast and per-image quality matters less.

generate_storydefaults topro(best interleaved quality);generate_from_videois locked toflash(the only tier that accepts video).

Returns the file pathandaninteraction_id— pass it toedit_imageto keep iterating.

Same image controls asgenerate_image, plus:

For best results, write full sentences describingsubject + setting + lighting + camera/lens + mood— narrative beats keyword soup.

A photorealistic close-up portrait of an elderly Japanese ceramicist with deep wrinkles and a warm smile. Soft golden-hour light streaming through a window. Captured with an 85mm portrait lens, soft bokeh background. Serene and masterful mood.

- Node.js 18+(uses the built-innode:testrunner and modern ES modules)
- AGemini API key(GEMINI_API_KEY)
- The Interactions API isbeta; Gemini 3 image tiers (flash,pro) may require access. Thenanotier is the most widely available — setmodel: "nano"ifflash/proare unavailable on your key.

npm test # unit tests (node:test) — no API key needed npm run smoke # live smoke test — requires GEMINI_API_KEY

The codebase is split into focused modules:

- lib/config.js— model tables, aspect-ratio/size validation, helpers
- lib/gemini.js— API client, retries, response extraction, previews
- lib/tools.js— tool schemas and handlers
- index.js— MCP server wiring

AI Video, Image & Audio Generation with over 150 models

Convert photos to LEGO-style brick mosaic previews with AI-powered color quantization. MCP server for Claude, Cursor, and other AI agents.

Hosted remote MCP server for AI image and video generation from one Streamable HTTP endpoint.

a specialised AI text remover for photos and graphics

Official FLUX MCP server from Black Forest Labs. Generate, edit, vary, and browse FLUX.2 images directly in any MCP-compatible client

MCP server for OpenAI GPT image generation and editing

Style-locking AI image engine with a hosted MCP server. Define one master style and generate unlimited matching images.

Image and video understanding and generation

Google AI studio based imageneration MCP with option to extend it to other providers

AI interior design from your agent — restyle rooms, place furniture, and virtually stage spaces from a single photo.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.