🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@nanobanana/mcp

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nanobanana/mcp

Lean MCP server for Google's Nano Banana (Gemini) image models. Generates and edits images, returns file paths.

latest
Source
npmnpm
Version
0.1.2
Version published
Maintainers
2
Created
Source

@nanobanana/mcp 🍌

A lean MCP server for Google's Nano Banana (Gemini) image models. It generates and edits images from any MCP client (Claude Code, Claude Desktop, Cursor) and hands back file paths instead of base64, so your agent's context stays small.

  • Three tools and nothing else: generate_image, edit_image, list_models
  • Defaults to Nano Banana 2 (gemini-3.1-flash-image). Switch models per call or via env. If a pinned model id ever goes stale, list_models shows what your key can actually use.
  • Multi-image editing: pass reference images for style transfer, characters, or compositing
  • Control over aspect ratio (1:1 up to 21:9) and resolution (1K, 2K, 4K)
  • Google Search grounding for images that need real-world accuracy, like infographics
  • Safe output paths. The server never writes to / when a desktop MCP client spawns it there.
  • Auth lives in env vars only, so your API key never passes through chat context

Quick start

Get a free Gemini API key at aistudio.google.com/apikey.

Claude Code

claude mcp add nanobanana -e GEMINI_API_KEY=your_key -- npx -y @nanobanana/mcp

Also listed in the MCP Registry as io.github.getjoystick/nanobanana-mcp.

Claude Desktop / Cursor: add this to claude_desktop_config.json or .cursor/mcp.json:

{
  "mcpServers": {
    "nanobanana": {
      "command": "npx",
      "args": ["-y", "@nanobanana/mcp"],
      "env": { "GEMINI_API_KEY": "your_key" }
    }
  }
}

Tools

generate_image

ParamRequiredDescription
promptImage description
modelGemini image model id (default gemini-3.1-flash-image)
aspectRatio1:1, 16:9, 9:16, 4:3, 21:9, and similar
size1K, 2K, or 4K
groundingGround with Google Search for factual accuracy
outputDirSave directory (default ./nano-banana)
filenameBase filename without extension

edit_image

Same params, plus:

ParamRequiredDescription
imagesInput image path(s). The first is the base; the rest are references.

Both tools save to disk and return the file path.

list_models

Takes no params. Lists the image model ids your API key can use. Handy when a pinned model id stops working, which is how earlier Nano Banana servers broke.

Configuration

Env varDescription
GEMINI_API_KEYRequired. Gemini API key (GOOGLE_API_KEY also works)
NANOBANANA_MODELDefault model override
NANOBANANA_OUTPUT_DIRDefault output directory override

Models

Model idNotes
gemini-3.1-flash-imageDefault. Nano Banana 2: 4K output, strong text rendering
gemini-3-pro-imageNano Banana Pro, for complex scenes that need deeper reasoning
gemini-2.5-flash-imageThe original Nano Banana (legacy; Google retires it 2026-10-02)

Development

npm install
npm run build
GEMINI_API_KEY=your_key npm run smoke   # end-to-end test against the live API

Acknowledgements

Inspired by other Nano Banana MCPs. Built with Claude Code.

License

MIT

Keywords

mcp

FAQs

Package last updated on 02 Jul 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts