nanobanana-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@nanobanana-mcpgenerate an image of a sunset over the ocean"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
NanoBanana
AI 图像生成工具,使用 OpenAI 兼容协议,支持任何兼容的图像生成服务。
特性
🎨 文生图 - 根据文本描述生成图片
🖼️ 图生图 - 基于参考图片生成新图片
🔄 多 Provider 兼容 - OpenRouter 等
📦 双版本支持 - MCP Server + Clawdbot Plugin
Related MCP server: GPT Image MCP Server
版本选择
版本 | 适用场景 | 目录 |
MCP Server | Claude Desktop / Claude Code |
|
Clawdbot Plugin | Clawdbot AI 助手 |
|
MCP Server
用于 Claude Desktop 和 Claude Code。
快速使用
npx nanobanana-mcp从源码安装
git clone https://github.com/superboolgithub/nanobanana-mcp.git
cd nanobanana-mcp
npm install
npm run build环境变量
变量名 | 必填 | 说明 | 默认值 |
| ✅ | API 密钥 | - |
| ✅ | API 基础 URL | - |
| ✅ | 图片输出目录 | - |
| ❌ | 默认宽高比 |
|
| ❌ | 默认图片尺寸 |
|
| ❌ | 默认模型 |
|
Claude Desktop 配置
在 claude_desktop_config.json 中添加:
{
"mcpServers": {
"nanobanana": {
"command": "npx",
"args": ["-y", "nanobanana-mcp"],
"env": {
"NANOBANANA_API_KEY": "your-api-key",
"NANOBANANA_BASE_URL": "https://openrouter.ai/api",
"NANOBANANA_OUTPUT_DIR": "/path/to/output"
}
}
}
}Claude Code 配置
在 ~/.claude.json 中添加:
{
"mcpServers": {
"nanobanana": {
"type": "stdio",
"command": "npx",
"args": ["-y", "nanobanana-mcp"],
"env": {
"NANOBANANA_API_KEY": "your-api-key",
"NANOBANANA_BASE_URL": "https://openrouter.ai/api",
"NANOBANANA_OUTPUT_DIR": "/path/to/output"
}
}
}
}Clawdbot Plugin
用于 Clawdbot AI 助手。
安装
cp -r clawdbot-plugin ~/.clawdbot/extensions/nanobanana配置
在 ~/.clawdbot/clawdbot.json 中添加:
{
"plugins": {
"entries": {
"nanobanana": {
"enabled": true,
"config": {
"apiKey": "your-api-key",
"baseUrl": "https://openrouter.ai/api",
"outputDir": "/tmp/nanobanana",
"defaultAspectRatio": "1:1",
"defaultImageSize": "1K",
"defaultModel": "google/gemini-2.5-flash-image-preview"
}
}
}
}
}配置项
配置项 | 必填 | 说明 | 默认值 |
| ✅ | API 密钥 | - |
| ✅ | API 基础 URL | - |
| ❌ | 图片输出目录 |
|
| ❌ | 默认宽高比 |
|
| ❌ | 默认图片尺寸 |
|
| ❌ | 默认模型 |
|
工具说明
generate_image - 文生图
根据文本描述生成图片。
参数:
prompt(必填) - 图片描述,最大 5000 字符aspectRatio- 宽高比imageSize- 图片尺寸model- 模型名称
edit_image - 图生图
基于参考图片生成新图片。
参数:
prompt(必填) - 图片描述referenceImageUrl(必填) - 参考图片 URLaspectRatio- 宽高比imageSize- 图片尺寸model- 模型名称
参数选项
宽高比 (aspectRatio)
值 | 分辨率 | 说明 |
| 1024×1024 | 方形(默认) |
| 1344×768 | 横版宽屏 |
| 768×1344 | 竖版 |
| 1184×864 | 横版 |
| 864×1184 | 竖版 |
| 832×1248 | 竖版 |
| 1248×832 | 横版 |
| 896×1152 | 竖版 |
| 1152×896 | 横版 |
| 1536×672 | 超宽屏 |
图片尺寸 (imageSize)
值 | 说明 |
| 标准分辨率(默认) |
| 高分辨率 |
| 最高分辨率 |
兼容模型
google/gemini-2.5-flash-image-preview- 快速生成google/gemini-3-pro-image-preview- 高质量gemini-2.5-flash-image- Gemini Flashblack-forest-labs/flux.2-pro- Flux Pro其他支持图像生成的模型
API 协议
使用 OpenAI Chat Completions API 格式:
请求
POST /v1/chat/completions
Content-Type: application/json
Authorization: Bearer <api-key>
{
"model": "gemini-2.5-flash-image",
"messages": [
{ "role": "user", "content": "Generate a beautiful sunset" }
],
"modalities": ["image", "text"],
"image_config": {
"aspect_ratio": "16:9",
"image_size": "2K"
}
}响应格式
支持两种响应格式:
格式 1:OpenRouter 风格
{
"choices": [{
"message": {
"content": "Here's your image",
"images": [{
"image_url": { "url": "data:image/png;base64,..." }
}]
}
}]
}格式 2:Markdown 内嵌
{
"choices": [{
"message": {
"content": ""
}
}]
}兼容的 Provider
任何使用 OpenAI Chat Completions API 格式的图像生成服务:
其他 OpenAI 兼容 API
使用示例
"生成一张可爱的猫咪图片"
"生成一张 4K 横版的日落海滩风景"
"基于这张图片,生成一个卡通风格的版本"开发
# 安装依赖
npm install
# 开发模式
npm run dev
# 构建
npm run build
# 运行
npm startLicense
MIT
Available Tools
2 toolsedit_imageA
基于参考图片生成新图片(图生图)。
参数说明:
prompt: 图片描述(必填)
referenceImageUrl: 参考图片的 URL(必填)
aspectRatio: 宽高比
imageSize: 图片尺寸
model: 模型名称
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | 模型名称 | |
| prompt | Yes | 图片描述文本 | |
| imageSize | No | 图片尺寸 | |
| aspectRatio | No | 宽高比 | |
| referenceImageUrl | Yes | 参考图片的 URL |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
没有提供 annotations,描述承担了全部安全/行为披露责任。但描述仅说明'生成新图片'这一动作,未提及权限要求、速率限制、输出格式或潜在副作用,行为透明性不足。
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
描述以一句话概述用途,随后用列表方式呈现参数,结构清晰,没有冗余内容。虽然参数列表与 schema 重复,但作为面向代理的自然语言说明是可接受的。
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
工具本身较简单,schema 完整覆盖参数,但缺少与兄弟工具的使用边界和返回值说明。在无 annotations 和 output schema 的情况下,描述仅达到最低可用标准,未提供更丰富的上下文。
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema 描述覆盖率达 100%,描述中的参数说明与 schema 属性描述基本重复,未增加额外语义。'必填'标注在 schema 中已有体现,因此描述未提供超越 schema 的价值,维持基线 3 分。
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
描述以'基于参考图片生成新图片(图生图)'开头,明确说明了工具的核心功能:基于参考图片生成新图片。动词'生成'和资源'图片'清晰,并且'基于参考图片'与兄弟工具 generate_image(文生图)形成明显区分。
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
描述明确指出了图生图的使用场景,让 agent 能根据是否有参考图片来决定选择此工具而非 generate_image。但未显式给出'何时不使用'或指名替代工具,因此未达到最高分。
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
generate_imageA
生成 AI 图片(OpenAI 兼容协议)。
参数说明:
prompt: 图片描述(必填)
aspectRatio: 宽高比,可选值: 1:1, 16:9, 9:16, 4:3, 3:4, 2:3, 3:2, 4:5, 5:4, 21:9。默认: 1:1
imageSize: 图片尺寸,可选值: 1K, 2K, 4K。默认: 1K
model: 模型名称。默认: google/gemini-2.5-flash-image-preview
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | 模型名称 | |
| prompt | Yes | 图片描述文本 | |
| imageSize | No | 图片尺寸 | |
| aspectRatio | No | 宽高比 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry the behavioral burden. It adds 'OpenAI 兼容协议' and default values for parameters, which is useful context. However, it does not disclose the return format, whether the operation is synchronous, or any side effects beyond generation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and front-loaded with the purpose, followed by a clear bulleted parameter list. Every sentence provides actionable information without fluff or repetition.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
All parameters are documented with defaults and enums, but the description omits the output format (e.g., image URL, base64) and lacks usage guidance relative to the sibling tool. For a generation tool with no output schema or annotations, this is a notable gap but still usable for parameter selection.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3. The description adds value by explicitly marking 'prompt' as required, listing all enum values for aspectRatio and imageSize, and providing default values for aspectRatio, imageSize, and model, which are not present in the schema descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states '生成 AI 图片' (generate AI images) with the OpenAI-compatible protocol, giving a specific verb and resource. It distinguishes from the sibling tool 'edit_image' by explicitly focusing on generation rather than editing.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is implied from the tool name and description (use for generating images vs editing), but there is no explicit guidance on when to prefer this tool over alternatives. No exclusions or alternative tool references are provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
2 tool updates
v1.0.0- First observed
edit_image - First observed
generate_image
TDQS
The two tools are clearly distinct: generate_image creates from a text prompt, while edit_image uses a reference image. Their purposes do not overlap, and the parameter differences (prompt + aspectRatio vs. prompt + referenceImageUrl) make selection unambiguous.
Both tools follow the exact same verb_noun pattern with underscores: generate_image and edit_image. This is perfectly consistent and predictable.
With only 2 tools, the server feels thin for a general image generation service, but it is tightly scoped to the two core generation workflows. It is borderline but not unreasonable for a specialized server.
The server covers the primary image generation operations: text-to-image and image-to-image editing. Minor gaps exist (e.g., no upscaling or variation tools), but for the stated purpose, the surface is mostly complete.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server for Qwen Image 3 AI image generation
MCP server for NanoBanana AI image generation and editing
Generate AI images and videos from any compatible MCP client.
MCP server for Flux AI image generation
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceAn MCP tool server that enables generating and editing images through OpenAI's image models, supporting text-to-image generation and advanced image editing (inpainting, outpainting) across various MCP-compatible clients.110MIT
- FlicenseNot gradedqualityCmaintenanceAn MCP server that enables text-to-image generation and editing using OpenAI's gpt-image-1 model, supporting multiple output formats, quality settings, and background options.69-
- AlicenseNot gradedqualityDmaintenanceMCP server that wraps OpenAI's image generation and editing APIs, enabling text-to-image and image-to-image operations via tools.20437ISC
- FlicenseNot gradedqualityCmaintenanceAn MCP server for AI-powered image processing (generate, edit, vary, analyze) supporting OpenAI, Gemini, Ideogram, and custom relay endpoints.-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/superboolgithub/nanobanana-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server