Nano Banana 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
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 "GOOGLE_API_KEY=${GOOGLE_API_KEY}" nanobanana -- node "<FULL_PATH_TO_NANOBANANA_MCP_SERVER>/dist/index.js"

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

Required:GOOGLE_API_KEY+ 1 optional
README.md

Generate images using Google's Gemini Nano Banana Pro model via MCP.

Nano Banana MCP Server

MCP服务器,用于通过Google AI Studio API调用Gemini Nano Banana Pro (gemini-3-pro-image-preview) 图像生成模型。

版本: 1.0.0

功能

  • 调用Google Gemini Nano Banana模型生成图像
  • 支持通过MCP协议在opencode等客户端中使用
  • 生成图片会保存到本地文件

安装

npm install
npm run build

配置

  1. 复制 .env.example.env
cp .env.example .env
  1. .env 中设置你的Google API Key:
GOOGLE_API_KEY=your_api_key_here

环境变量

变量 说明 默认值
GOOGLE_API_KEY Google AI Studio API密钥 (必填)
HTTPS_PROXY HTTPS代理地址 系统代理

运行

npm start

在opencode中使用

在opencode的mcp配置中添加:

{
  "mcp": {
    "nanobanana": {
      "type": "local",
      "command": ["node", "/path/to/nanobanana-mcp-server/dist/index.js"],
      "env": {
        "GOOGLE_API_KEY": "your_api_key"
      },
      "enabled": true
    }
  }
}

工具

generate_image

生成图像

参数:

  • prompt (required): 图像描述文本
  • output_dir: 图片保存目录 (默认当前目录)

示例:

用nano banana画一只可爱的猫咪

Tools (1)

generate_imageGenerates an image based on a text prompt and saves it locally.

Environment Variables

GOOGLE_API_KEYrequiredGoogle AI Studio API key
HTTPS_PROXYHTTPS proxy address

Configuration

claude_desktop_config.json
{"mcpServers": {"nanobanana": {"command": "node", "args": ["/path/to/nanobanana-mcp-server/dist/index.js"], "env": {"GOOGLE_API_KEY": "your_api_key"}}}}

Try it

Generate an image of a futuristic city skyline using the Nano Banana model.
Create an image of a cute cat and save it to my desktop.
Use the Nano Banana tool to generate a landscape painting of a mountain range.

Frequently Asked Questions

What are the key features of Nano Banana?

Integrates Google Gemini Nano Banana Pro image generation model. Supports MCP protocol for use in compatible clients. Automatically saves generated images to local storage.

What can I use Nano Banana for?

Generating custom AI imagery directly within an MCP-enabled IDE. Automating image asset creation for local development projects. Testing Gemini Nano Banana Pro model capabilities via text prompts.

How do I install Nano Banana?

Install Nano Banana by running: npm install && npm run build

What MCP clients work with Nano Banana?

Nano Banana 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 Nano Banana 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