Nano-Banana MCP Server

Generate and edit images with Google's Gemini 2.5 Flash Image model from any MCP client

By ConEchoAI TypeScript Local · stdio AI and MLMedia

28 popularity score ★ 235 ↓ 1.4k/wk

Connect your client

Local (npm)

Add in one click

Opens the app, which asks before it adds the server. Then replace each <NAME> in its settings with your value.

Or add it by command or config

It needs GEMINI_API_KEY. Replace each <NAME> with your value.

Claude CodeTerminal
claude mcp add nano-banana -e GEMINI_API_KEY=<GEMINI_API_KEY> -- npx -y nano-banana-mcp
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "nano-banana": {
      "command": "npx",
      "args": [
        "-y",
        "nano-banana-mcp"
      ],
      "env": {
        "GEMINI_API_KEY": "<GEMINI_API_KEY>"
      }
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "nano-banana": {
      "command": "npx",
      "args": [
        "-y",
        "nano-banana-mcp"
      ],
      "env": {
        "GEMINI_API_KEY": "<GEMINI_API_KEY>"
      }
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "nano-banana": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "nano-banana-mcp"
      ],
      "env": {
        "GEMINI_API_KEY": "<GEMINI_API_KEY>"
      }
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.nano-banana]
command = "npx"
args = ["-y", "nano-banana-mcp"]

[mcp_servers.nano-banana.env]
GEMINI_API_KEY = "<GEMINI_API_KEY>"
Gemini CLITerminal
gemini mcp add --scope user -e GEMINI_API_KEY=<GEMINI_API_KEY> nano-banana npx -- -y nano-banana-mcp

Settings 1

GEMINI_API_KEY Required: Gemini API key from Google AI Studio. Can instead be set later with the configure_gemini_token tool, which writes .nano-banana-config.json in the working directory.

What it does

Nano-Banana MCP Server is a small local stdio server that passes text prompts, and optionally local image files, to Google's Gemini image model and saves what comes back as PNG files on your disk. It has six tools: one creates a new image from a prompt, one edits a named image file, one keeps editing whatever image was produced last in the session, and three handle setup and status (store an API key, check whether a key is set, describe the last image).

Editing can take extra reference images, for instance to borrow a style or add an element from another picture. Each result is returned to the client as an inline image and written to a folder: on Windows that is Documents\nano-banana-images in your home folder; elsewhere it is generated_imgs under the directory the server was started in, or ~/nano-banana-images when that directory is under /usr, /opt or /var.

The code in version 1.0.3 calls the model id gemini-2.5-flash-image-preview, hard-coded in src/index.ts for both generating and editing; there is no setting to pick another model, size or aspect ratio. The README states that the whole project was generated with Claude Code.

What it needs

RuntimeNode.js 18+

Node.js 18 or newer (the launch command uses npx). A Gemini API key from Google AI Studio, supplied as GEMINI_API_KEY or through the configure_gemini_token tool. Image generation calls are billed or rate-limited according to your Google AI Studio plan.

Limits

The model is fixed in the code to gemini-2.5-flash-image-preview (src/index.ts, v1.0.3); if Google withdraws that preview id, the image tools stop working until the package is updated. No options for image size, aspect ratio, count or seed: each call sends only the prompt and images. Input files are typed by extension (.png, .webp, .jpg/.jpeg; anything else is sent as JPEG), and every saved result is named .png. continue_editing only knows the last image of the current server process. Without a key, every image tool returns an error asking you to run configure_gemini_token first.

Who it suits

Suits a developer who already has a Gemini API key and wants quick image generation and prompt-based edits from Claude Code, Cursor or another MCP client, with the results kept as files on the local machine. It is a community project, not a Google release, and it exposes no model, size or aspect-ratio choices, so anyone who needs those controls or a newer Gemini image model should pick a server that exposes them.

Tools 6

generate_image
Creates a new image from a text prompt and saves it as a PNG.
edit_image
Changes an image file at a given path by prompt, with optional reference images.
continue_editing
Applies a further prompt-based edit to the last image made in this session.
get_last_image_info
Reports the path and details of the last generated or edited image.
configure_gemini_token
Sets the Gemini API key and saves it to a local config file.
get_configuration_status
Says whether a Gemini API key is set and where it came from.

Similar servers