# Nano Banana

An MCP server that hands your agent image generation and editing through Google Gemini. Useful when a picture has to come out of the coding session itself.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 13
- Author: mindstone
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/mindstone/mcp-servers/tree/HEAD/connectors/nano-banana
- Updated: 2026-10-22
- HTML: https://affpapa.org/en/nevibecode/mcp/nano-banana

## What it does

Three tools ship with the server. `nano_banana_generate` draws an image from a text description, `nano_banana_edit` changes one you already have, and `configure_nano_banana_api_key` stores the Gemini key. Everything runs against the cloud API, so nothing heavy happens on your machine.

\`nano_banana_edit` takes up to 14 reference images, each either a workspace path or an `https://` URL. A single source is capped at 20MB. Remote fetches go through SSRF checks: HTTPS only, no userinfo, private and loopback hosts refused. PNG, JPEG and WebP are accepted; a GIF comes back as `UNSUPPORTED_IMAGE_FORMAT`. Saving never overwrites — an existing file at `save_path` triggers `SAVE_EXISTS`.

You need a `GEMINI_API_KEY`; without it the server will not start. Node.js 20+ and npm are required too. Output size is set with `image_size` — `"1K"`, `"2K"` or `"4K"`, defaulting to `"1K"`. Only the Gemini 3 image models honour anything above 1K; `gemini-2.5-flash-image` stays near 1K and rejects an explicit `image_size`. The Gemini request timeout defaults to `180000` ms, and slow generations on `gemini-3-pro-image-preview` will need it raised.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `GEMINI_API_KEY`, `MCP_WORKSPACE_PATH`, `NANO_BANANA_GEMINI_TIMEOUT_MS`, `NANO_BANANA_BRIDGE_TIMEOUT_MS` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env GEMINI_API_KEY=<GEMINI_API_KEY> --env MCP_WORKSPACE_PATH=<MCP_WORKSPACE_PATH> --env NANO_BANANA_GEMINI_TIMEOUT_MS=<NANO_BANANA_GEMINI_TIMEOUT_MS> --env NANO_BANANA_BRIDGE_TIMEOUT_MS=<NANO_BANANA_BRIDGE_TIMEOUT_MS> --transport stdio nano-banana -- npx -y @mindstone/mcp-server-nano-banana
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add nano-banana --env GEMINI_API_KEY=<GEMINI_API_KEY> --env MCP_WORKSPACE_PATH=<MCP_WORKSPACE_PATH> --env NANO_BANANA_GEMINI_TIMEOUT_MS=<NANO_BANANA_GEMINI_TIMEOUT_MS> --env NANO_BANANA_BRIDGE_TIMEOUT_MS=<NANO_BANANA_BRIDGE_TIMEOUT_MS> -- npx -y @mindstone/mcp-server-nano-banana
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "nano-banana": {
            "command": "npx",
            "args": [
                "-y",
                "@mindstone/mcp-server-nano-banana"
            ],
            "env": {
                "GEMINI_API_KEY": "<GEMINI_API_KEY>",
                "MCP_WORKSPACE_PATH": "<MCP_WORKSPACE_PATH>",
                "NANO_BANANA_GEMINI_TIMEOUT_MS": "<NANO_BANANA_GEMINI_TIMEOUT_MS>",
                "NANO_BANANA_BRIDGE_TIMEOUT_MS": "<NANO_BANANA_BRIDGE_TIMEOUT_MS>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "nano-banana": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@mindstone/mcp-server-nano-banana"
            ],
            "env": {
                "GEMINI_API_KEY": "<GEMINI_API_KEY>",
                "MCP_WORKSPACE_PATH": "<MCP_WORKSPACE_PATH>",
                "NANO_BANANA_GEMINI_TIMEOUT_MS": "<NANO_BANANA_GEMINI_TIMEOUT_MS>",
                "NANO_BANANA_BRIDGE_TIMEOUT_MS": "<NANO_BANANA_BRIDGE_TIMEOUT_MS>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e GEMINI_API_KEY=<GEMINI_API_KEY> -e MCP_WORKSPACE_PATH=<MCP_WORKSPACE_PATH> -e NANO_BANANA_GEMINI_TIMEOUT_MS=<NANO_BANANA_GEMINI_TIMEOUT_MS> -e NANO_BANANA_BRIDGE_TIMEOUT_MS=<NANO_BANANA_BRIDGE_TIMEOUT_MS> nano-banana npx -y @mindstone/mcp-server-nano-banana
```
Replace <…> with your own values

## When to use it
- generate an image from a description without leaving the agent chat
- touch up an existing picture from inside the editor
- fuse several source images into one composition
- write the result into the project without clobbering an old file
- get a 2K or 4K render for a layout

## Example prompts
- Generate an image: a logo for the dark theme, save it to `assets/logo.png`
- Edit `assets/hero.jpg` — drop the background, put the result in `assets/hero-clean.png`
- Combine `shot-1.png` and `shot-2.png` into one collage at 2K

## Similar
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16730
- [labelhead-artist-momentum](https://affpapa.org/en/nevibecode/mcp/labelhead-artist-momentum.md) — MCP server · ★ 107701
- [Agent Skills Search Server](https://affpapa.org/en/nevibecode/mcp/agent-skills-search-server.md) — MCP server · ★ 26673
- [Skyvern](https://affpapa.org/en/nevibecode/mcp/skyvern.md) — MCP server · ★ 23283
- [Nhost](https://affpapa.org/en/nevibecode/mcp/nhost.md) — MCP server · ★ 9369
- [PraisonAI](https://affpapa.org/en/nevibecode/mcp/praisonai.md) — MCP server · ★ 9298

From the same set: [mindstone/mcp-servers](https://affpapa.org/en/nevibecode/by/mindstone/mcp-servers.md) — 13 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
