home / mcp / nano-banana mcp server

Nano-Banana MCP Server

A Nano Banana MCP server, which you can integrate to cursor/claude code and any mcp client

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "conechoai-nano-banana-mcp": {
      "command": "npx",
      "args": [
        "nano-banana-mcp"
      ],
      "env": {
        "GEMINI_API_KEY": "your-gemini_api_key_here"
      }
    }
  }
}

You can generate and edit AI-generated images using a dedicated MCP server that talks to Google's Gemini API. This server supports creating images from text, editing them with prompts, and iterating on results, with optional style guidance from reference images. It works with popular MCP clients and handles secure API key usage, automatic file management, and cross‑platform file paths for Windows, macOS, and Linux.

How to use

Use a compatible MCP client to connect to the Nano-Banana MCP Server. You can generate new images from text prompts, edit existing images with prompts, and continue refining the latest result. When you want to apply style guidance or reference images, provide one or more reference files to guide the generation or editing process. The server stores generated and edited images in platform-appropriate directories for easy access.

Typical workflows include starting with a base prompt to generate an image, using the continue editing flow to refine composition and lighting, and applying style transfers or additional prompts to reach the desired look. You can also ask the server to continue editing the last result to incrementally improve details or drama.

How to install

Prerequisites: install Node.js 18.0.0 or higher, and obtain a Gemini API key from Google AI Studio.

Clone the project and install dependencies, then run the development server or build for production.

# Clone the repository
git clone https://github.com/claude-code/nano-banana-mcp.git
cd nano-banana-mcp

# Install dependencies
npm install

# Run in development mode
npm run dev

# Build for production
npm run build

# Run tests
npm test

Configuration and usage with MCP clients

Configure the server in your MCP client by pointing it to the local or remote MCP endpoint and providing the Gemini API key securely.

{
  "mcpServers": {
    "nano-banana": {
      "command": "npx",
      "args": ["nano-banana-mcp"],
      "env": {
        "GEMINI_API_KEY": "your-gemini-api-key-here"
      }
    }
  }
}

Environment variables and security

Security is improved by placing sensitive keys in MCP client configuration environments rather than in shared files. The Gemini API key can be supplied via MCP config env variables or via system environment variables, in that priority order.

Configuration priority (highest to lowest): MCP configuration environment variables, system environment variables, local configuration files created by the Gemini token configuration tool.

File storage and naming

Images are saved to platform-appropriate locations to keep files organized.

Windows: %USERPROFILE%\Documents\nano-banana-images\

macOS/Linux: ./generated_imgs/ in the current directory

System-wide directory when run from system paths: ~/nano-banana-images/

Generated image files use the naming convention: generated-[timestamp]-[id].png and edited images use edited-[timestamp]-[id].png.

Example work flows

Basic Image Generation: generate_image, then continue_editing twice for refinement.

Style Transfer: generate_image with a base concept, edit_image with reference images for style, then continue_editing for fine-tuning.

Iterative Design: generate_image, get_last_image_info, continue_editing, repeat until satisfied.

Available commands (endpoints)

The MCP server exposes a set of actions you can invoke from your client to create and modify images.

generate_image: create a new image from a text prompt.

edit_image: modify a specific image with a prompt and optional reference images.

continue_editing: continue refining the last image with a new prompt and optional references.

get_last_image_info: retrieve information about the most recent image.

configure_gemini_token: set or update your Gemini API key.

get_configuration_status: verify if the Gemini API key is configured.

Available tools

generate_image

Create a new image from a text prompt. This is the base entry point for producing visuals from your description.

edit_image

Edit a specific image file using a natural language prompt and optional reference images to guide the transformation.

continue_editing

Continue refining the last generated or edited image with additional prompts, enabling iterative design.

get_last_image_info

Fetch information about the most recently generated image, including metadata and status.

configure_gemini_token

Configure or update the Gemini API key used for authentication with the image API.

get_configuration_status

Check whether the Gemini API key has been configured and is ready for use.