Get the FREE Ultimate OpenClaw Setup Guide →

nanobanana

Gemini Vision & Image Generation MCP for Claude Desktop and Claude Code

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio ycse-nanobanana-mcp npx -y @ycse/nanobanana-mcp \
  --env NANOBANANA_MODEL="default or your preferred model" \
  --env GOOGLE_AI_API_KEY="your_api_key"

How to use

NanoBanana MCP exposes Gemini-based image generation and editing capabilities within Claude Desktop, Claude Code, and Cursor. It supports switching between Nano Banana 2 (Flash) and Nano Banana Pro models at runtime so you can iterate quickly or render higher-quality outputs as needed. Core tools include gemini_generate_image for creating images from prompts, gemini_edit_image for applying natural-language edits to existing images, and gemini_chat for multi-turn conversations with image support. Maintain session continuity with set_aspect_ratio to ensure consistent framing, and use get_image_history and clear_conversation to manage evolving visuals across a session.

How to install

Prerequisites:

  • Node.js 18+ and npm
  • Access key for Google AI API (GOOGLE_AI_API_KEY)

Installation steps:

  1. Clone the MCP server repository or install the published package: git clone https://github.com/YCSE/nanobanana-mcp.git cd nanobanana-mcp

  2. Install dependencies: npm install

  3. Set up environment variables (example):

    • GOOGLE_AI_API_KEY=your_api_key
    • NANOBANANA_MODEL=gemini-3.1-flash-image-preview or gemini-3-pro-image-preview
  4. Run in development or start mode: npm run dev # Development mode with hot reload npm run build # Build production assets npm run start # Run the compiled server

  5. Add to MCP configuration in your environment as shown in the mcp_config section.

Additional notes

Environment variables

  • GOOGLE_AI_API_KEY is required for image generation and editing
  • NANOBANANA_MODEL can be used to lock a default model; you can switch models at runtime via the provided tools Common issues
  • If tools don’t appear, restart Claude Desktop/Code and verify the MCP config syntax
  • Ensure the npx command runs without errors: npx -y @ycse/nanobanana-mcp Configuration tips
  • Use set_aspect_ratio before generation/edit to ensure correct framing
  • Use gemini_chat for context-aware multi-turn conversations with image support
  • Reference images and history can help maintain character consistency across renders

Related MCP Servers

Sponsor this space

Reach thousands of developers