NanoBanana Pro 2

io.github.u2n4由 GitHub 账号 u2n4 发布v1.1.2更新于 Oct 24, 2026

4K AI image generation via NanoBanana Pro 2: Pro + Flash models, Google Search grounding

已验证STDIO仅桌面媒体与设计AI 与机器学习

概览

AI 生成的概览

本地 MCP 服务器,让助手使用 NanoBanana Pro 2(Pro 与 Flash 模型)生成和编辑 AI 图像,最高支持 4K 分辨率。

可以做什么
根据文本提示生成图像,可选择模型、宽高比、分辨率、负面提示、思考级别、搜索接地和批量生成,并可用上传的参考图编辑图像以获得一致的多角度效果。上传参考图用于编辑或条件控制。查看已生成图像的统计信息,包括数量、总大小和文件详情。执行维护操作,清理缓存、删除临时文件并优化存储。
适用场景
适合需要助手按需创建或编辑图像的场景,从 Flash 快速迭代到 Pro 高质量 4K 渲染,并可通过 Google 搜索接地处理真实世界主题。
运行要求
以 Python 包形式在桌面本地运行(pip 或 uvx)。需要在 GEMINI_API_KEY 环境变量中提供 Gemini API 密钥。可选设置 IMAGE_OUTPUT_DIR 指定输出目录、NANOBANANA_DB_PATH 指定 SQLite 元数据数据库;生成图像需要网络访问。
安装前请注意
Gemini API 密钥属于凭据,会以明文配置传入。生成时提示词和参考图会发送至 Google 的 Gemini 服务。默认会将图像和 SQLite 元数据数据库写入磁盘;维护操作可能删除缓存和临时文件,将 NANOBANANA_DB_PATH 设为 :memory: 会在重启后丢失图像历史。

安装

在 SourceWeft 中

  1. 打开 控制台中的 NanoBanana Pro 2,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

NanoBanana MCP Server

MCP server for AI image generation using NanoBanana Pro 2. Supports Pro (maximum quality) and Flash (fast generation) models with default 4K resolution.

Inspired by the nano-banana naming convention used across the MCP community. This is an independent implementation.

Quick Install

bash
pip install nanobanana-imagen-mcp# oruvx nanobanana-imagen-mcp --help

Claude Desktop (claude_desktop_config.json):

json
{  "mcpServers": {    "nanobanana": {      "command": "uvx",      "args": ["nanobanana-imagen-mcp"],      "env": {        "GEMINI_API_KEY": "your_key_here"      }    }  }}
VariableDescriptionDefault
GEMINI_API_KEYGemini API key — required for all generation--
IMAGE_OUTPUT_DIRDirectory where generated images are saved~/nanobanana-images
NANOBANANA_DB_PATHSQLite database path for image metadata~/nanobanana-images/images.db

What It Does

Generates AI images using NanoBanana Pro 2 models. Supports text-to-image generation, image editing with reference images, file uploads, and server maintenance. Produces high-quality images at up to 4K resolution.

Tools (4)

ToolDescription
generate_imageGenerate images using NanoBanana Pro 2. Supports model selection (Pro/Flash), aspect ratio, resolution (up to 4K), negative prompts, thinking level, grounding, reference images, and batch generation.
upload_fileUpload a reference image for use in image editing or conditioning.
show_output_statsDisplay statistics about generated images — count, total size, file details.
maintenanceServer maintenance and cleanup — clear caches, remove temporary files, optimize storage.

Models

ModelEngineBest For
ProGemini 3 Pro ImageMaximum quality, complex scenes, photorealism
FlashGemini 3.1 Flash ImageFast generation, simple scenes, quick iterations

Configuration

VariableDescriptionDefault
GEMINI_API_KEYGemini API key (required)--
IMAGE_OUTPUT_DIROutput directory for generated images~/nanobanana-images

Storage

Generated image metadata is tracked in a SQLite database.

VariableDescriptionDefault
NANOBANANA_DB_PATHPath to the SQLite metadata database~/nanobanana-images/images.db

Opt out of persistent storage by setting NANOBANANA_DB_PATH=:memory:. This uses an in-memory database that is discarded when the server exits — useful for ephemeral or read-only environments. Trade-off: image history is lost on restart; the show_output_stats tool will show an empty database each session.

The database and output directories are created lazily on first image generation — starting the server with no GEMINI_API_KEY set (e.g. nanobanana-imagen-mcp --help) does not create any files or directories.

Claude Desktop Configuration

From pip (recommended)

bash
pip install nanobanana-imagen-mcp
json
{  "mcpServers": {    "nanobanana": {      "command": "uvx",      "args": ["nanobanana-imagen-mcp"],      "env": {        "GEMINI_API_KEY": "your_key_here"      }    }  }}

From this repository

json
{  "mcpServers": {    "nanobanana": {      "command": "python",      "args": ["-m", "servers.nanobanana.nanobanana_mcp_server.server"],      "env": {        "GEMINI_API_KEY": "your_key_here"      },      "cwd": "path/to/gemini-media-mcp"    }  }}

Features

  • Default 4K resolution for maximum detail
  • Pro model for complex, photorealistic scenes
  • Flash model for fast iterations and simple subjects
  • Reference image support for consistent multi-angle shots
  • Negative prompt support for quality control
  • Thinking level control for complex multi-element scenes
  • Google Search grounding for real-world subjects

License

MIT

Credits

Inspired by the nano-banana naming convention used across the MCP community. This is an independent implementation.

来源:servers/nanobanana/README.md,提交 1b8fc5a

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.1.2最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分