Imagen MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
git clone https://github.com/BearThreat/nano-banana-openrouter-mcp
cd nano-banana-openrouter-mcp
npm install
npm run build
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add -e "OPENROUTER_API_KEY=${OPENROUTER_API_KEY}" imagen -- node "<FULL_PATH_TO_NANO_BANANA_OPENROUTER_MCP>/dist/index.js"

Replace <FULL_PATH_TO_NANO_BANANA_OPENROUTER_MCP>/dist/index.js with the actual folder you prepared in step 1.

Required:OPENROUTER_API_KEY+ 1 optional
README.md

Fast, cost-efficient image generation and editing for MCP.

Nano Banana - OpenRouter MCP Server

Fast, cost-efficient image generation and editing for MCP. Powered by Nano Banana 2 via OpenRouter.

Features

  • edit_or_create_image: Create or edit an image using the Nano Banana 2 model on OpenRouter. Fast, cost-efficient results. Supports up to 12 context images. Saves to project folder by default.
  • batch_edit_or_create_images: Perform multiple image creation or editing tasks in a single batch. Optimized for Nano Banana 2. Perfect for fast, cost-efficient creative workflows.
  • health_check: Validate .env loading, API key presence, selected model, and optionally run a live OpenRouter connectivity test.
  • start_annotation: Open a visual annotation UI to draw on images and add notes before editing.
  • get_annotation_results: Retrieve completed annotation results after the user clicks Finish.
  • complete_annotation_edit: One-step helper that retrieves completed annotations and immediately applies the requested edit.
  • Multimodal Support: Provide up to 12 local images as context for editing or inspiration.
  • Flexible Output: Specify a local path to save each generated image.
  • Model Override: Still supports NANO_BANANA_MODEL_ID if you want to point the server at a different OpenRouter image model.

Setup

Prerequisites

  • Node.js and npm installed.
  • An OpenRouter API key.

Installation

  1. Clone this repository:

    git clone https://github.com/BearThreat/nano-banana-openrouter-mcp
    cd nano-banana-openrouter-mcp
    
  2. Install dependencies:

    npm install
    
  3. Build the server:

    npm run build
    

Configuration

Add the server to your MCP settings file (e.g., cline_mcp_settings.json or claude_desktop_config.json):

{
  "mcpServers": {
    "nano-banana": {
      "command": "node",
      "args": ["/path/to/nano-banana-openrouter-mcp/build/index.js"],
      "cwd": "/path/to/nano-banana-openrouter-mcp",
      "env": {
        "OPENROUTER_API_KEY": "your-openrouter-api-key",
        "NANO_BANANA_MODEL_ID": "google/gemini-3.1-flash-image-preview"
      },
      "disabled": false,
      "autoApprove": [
        "edit_or_create_image",
        "batch_edit_or_create_images",
        "start_annotation",
        "get_annotation_results",
        "complete_annotation_edit",
        "health_check"
      ]
    }
  }
}

Usage

Once configured, your AI client will have access to the image generation tools.

By default, this server now targets Nano Banana 2 on OpenRouter:

google/gemini-3.1-flash-image-preview

This was chosen for better speed/cost tradeoffs. You can still override it with NANO_BANANA_MODEL_ID if needed.

Single Image Generation

{
  "prompt": "Generate a modern technical infographic about the Model Context Protocol.",
  "outputPath": "infographic.png"
}

Batch Image Generation

{
  "tasks": [
    { "prompt": "Create a blue circle", "outputPath": "circle.png" },
    { "prompt": "Create a red square", "outputPath": "square.png" },
    { "prompt": "Combine circle.png and square.png into a single composition", "imagePaths": ["circle.png", "square.png"], "outputPath": "combined.png" }
  ]
}

Image Annotation

Use the start_annotation tool to open a browser-based annotation UI where you can draw freehand markings on images and add notes:

{
  "imagePaths": ["photo1.jpg", "photo2.png", "design.webp"]
}

This opens a visual editor where you can:

  • Draw on each image with freehand markings (red, yellow, green, blue, white colors)
  • Navigate between images with Back/Next buttons
  • Add notes under each image (pre-filled with Notes about {filename}:)
  • Combine all prompts into a single combined prompt when finished

The tool returns:

  • annotatedImagePaths: Paths to the annotated images (saved in .nano-banana-temp/ folder)
  • combinedPrompt: All individual prompts concatenated together
  • originalImagePaths: The original input paths

This is particularly useful when you want to point out specific areas in images that need editing, which the AI can then use with edit_or_create_image.

Annotation Shortcut Flow

If the user has already completed the annotation step in the browser, you can call complete_annotation_edit to retrieve the saved annotation results and immediately apply the edit in one tool call.

Health Check

Use health_check to verify local configuration and optionally test OpenRouter connectivity:

{
  "testApi": true
}

License

MIT

Tools (6)

edit_or_create_imageCreate or edit an image using the Nano Banana 2 model on OpenRouter.
batch_edit_or_create_imagesPerform multiple image creation or editing tasks in a single batch.
health_checkValidate .env loading, API key presence, and test OpenRouter connectivity.
start_annotationOpen a visual annotation UI to draw on images and add notes before editing.
get_annotation_resultsRetrieve completed annotation results after the user clicks Finish.
complete_annotation_editRetrieves completed annotations and immediately applies the requested edit.

Environment Variables

OPENROUTER_API_KEYrequiredAPI key for OpenRouter authentication
NANO_BANANA_MODEL_IDOptional model ID override for OpenRouter image models

Configuration

claude_desktop_config.json
{"mcpServers": {"nano-banana": {"command": "node", "args": ["/path/to/nano-banana-openrouter-mcp/build/index.js"], "cwd": "/path/to/nano-banana-openrouter-mcp", "env": {"OPENROUTER_API_KEY": "your-openrouter-api-key", "NANO_BANANA_MODEL_ID": "google/gemini-3.1-flash-image-preview"}}}}

Try it

Generate a modern technical infographic about the Model Context Protocol and save it as infographic.png.
Create a batch of images: a blue circle and a red square, then combine them into a single composition.
Open the annotation UI for photo1.jpg so I can mark areas that need editing.
Check if my OpenRouter API key is configured correctly and the server is healthy.

Frequently Asked Questions

What are the key features of Imagen?

Fast, cost-efficient image generation and editing via Nano Banana 2. Batch processing for multiple image creation tasks. Visual annotation UI for drawing and adding notes to images. Multimodal support with up to 12 local images as context. Flexible local file path output for generated images.

What can I use Imagen for?

Rapidly generating technical infographics or diagrams for documentation. Batch creating assets for web projects with specific composition requirements. Collaborative image editing by annotating specific areas for AI refinement. Iterative design workflows where visual feedback is provided via annotations.

How do I install Imagen?

Install Imagen by running: git clone https://github.com/BearThreat/nano-banana-openrouter-mcp && cd nano-banana-openrouter-mcp && npm install && npm run build

What MCP clients work with Imagen?

Imagen works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Imagen docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare