
mcp for nano banana using openrouter.ai
概览
A professional MCP (Model Context Protocol) extension for any MCP-compatible client (including Gemini CLI and Codex CLI), for generating and manipulating images. It uses the model by default, and is pre-configured to connect to OpenRouter. You can point it at any provider that hosts the model by adjusting the MODEL_* environment variables. - : Create stunning images from descriptive prompts - : Modify existing images with natural language instructions - : Restore and enhance old or damaged photos - : User-friendly filenames with automatic duplicate prevention 1. installed and configured (e.g., Gemini CLI, Codex CLI) 2. and npm 3. : You will need an API key from OpenRouter or another provider that hosts the google/gemini-2.5-flash-image model. By default, the extension talks to OpenRouter. Optional overrides are useful when targeting other providers that host the model: - MODEL_BASE_URL – alternate provider endpoint (default: https://openrouter.
README
以下为原文 README 节选,完整内容请查看原文。
Nano Banana - MCP Image Generation Extension
A professional MCP (Model Context Protocol) extension for any MCP-compatible client (including Gemini CLI and Codex CLI), for generating and manipulating images. It uses the google/gemini-2.5-flash-image model by default, and is pre-configured to connect to OpenRouter. You can point it at any provider that hosts the model by adjusting the MODEL_* environment variables.
✨ Features
- 🎨 Text-to-Image Generation: Create stunning images from descriptive prompts
- ✏️ Image Editing: Modify existing images with natural language instructions
- 🔧 Image Restoration: Restore and enhance old or damaged photos
- 📁 Smart File Management: User-friendly filenames with automatic duplicate prevention
📋 Prerequisites
- MCP-compatible CLI installed and configured (e.g., Gemini CLI, Codex CLI)
- Node.js 18+ and npm
- API Key: You will need an API key from OpenRouter or another provider that hosts the
google/gemini-2.5-flash-imagemodel.
By default, the extension talks to OpenRouter. Optional overrides are useful when targeting other providers that host the model:
MODEL_BASE_URL– alternate provider endpoint (default:https://openrouter.ai/api/v1)MODEL_ID– override model id (default:google/gemini-2.5-flash-image)MODEL_REFERER/MODEL_TITLE– analytics headers for providers that require themMODEL_GENERATE_PATH– alternate generation endpoint path (default:/responses)
If you are using OpenRouter, refer to their authentication guide for generating API keys. For other providers, consult their documentation.
🚀 Installation
From NPM (Recommended)
For most users, installing via npx or your CLI’s extension manager is the easiest method.
Gemini CLI:
When you install the extension, you will be prompted to enter your API key.
gemini extensions install https://github.com/Aeven-AI/mcp-nanobanana
Codex CLI:
codex mcp add nanobanana --env MODEL_API_KEY="YOUR_API_KEY_HERE" -- npx -y @aeven/nanobanana-mcp@latest
Opencode CLI:
-
Run
opencode config edit(or open youropencode.jsoncsettings file manually). -
Register the server with an entry similar to:
{ "mcp": { "nanobanana": { "type": "local", "command": ["npx", "-y", "@aeven/nanobanana-mcp@latest"], "enabled": true, "environment": { "MODEL_API_KEY": "{env:MODEL_API_KEY}" } } } } -
Save the file and restart Opencode so it picks up the new MCP server.
Claude Code:
- Open Claude Code and navigate to Settings → Model Context Protocol → Add Server.
- Set the command to
npxand the arguments to-yand@aeven/nanobanana-mcp@latest. - Add an environment variable
MODEL_API_KEYpointing at your provider key.
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →