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 分