
由谷歌Gemini驱动的AI图像生成MCP服务器,支持智能模型选择和4K输出
概览
一台面向生产的服务器,通过谷歌模型提供AI驱动的图像生成能力,并具备智能模型选择功能。 (gemini-3.1-flash-image-preview)现在是——以闪存速度提供专业级画质: - 🍌 :Gemini 2.5 闪存延迟最高可达3840px - 🌐 :真实世界知识,提供事实准确图像 - 🎯 :每场景最多5个字符和14个对象 - ✍️ :图像中文字清晰排列 - 🏆 仍可实现最大推理深度 - 🎨 : 三款 Gemini 型号,具备智能自动选择 - 🍌 : 默认型号 — 4K 分辨率,闪光灯速度并接地 - 🏆 : 最复杂构图的最大推理深度 - ⚡ : Legacy Flash 模型,用于高批量快速原型制作 - 🤖 : 根据提示自动路由到 NB2 或 Pro - 📐 ⭐ 新功能:指定输出尺寸(1:1、16:9、9:16、21:9 等)- 📋 预构建的摄影、设计和编辑提示模板 - 📁 通过 Gemini Files API 上传和管理文件 -...
概述(AI 翻译)
一款生产准备的模型上下文协议(MCP)服务器,通过谷歌的Gemini模型提供AI驱动的图像生成能力,并支持智能模型选择。
⭐ 新:纳米香蕉2 — 双子座3.1闪现图像!🍌🚀
Nano Banana 2(gemini-3.1-flash-image-preview)现为默认型号——以Flash速度提供专业级品质:
- 🍌 闪速 + 4K 画质:Gemini 2.5 闪烁延迟下最高可达 3840px
- 🌐 谷歌搜索基础技术:真实事实准确图片的真实知识
- 🎯 主题一致性:每个场景最多5个角色和14个对象
- ✍️ 精细文本渲染:图像中清晰的文本位置
- 🏆 Gemini 3 Pro Image 仍可获得,以获得最大推理深度
✨ 特色
- 🎨 多模型AI图像生成:三款具智能自动选择的双子座模型
- 🍌 Gemini 3.1 闪光画面(NB2):默认型号 — 4K分辨率,闪光速度带接地
- 🏆 Gemini 3 Pro Image:最复杂构图的最大推理深度
- ⚡ Gemini 2.5 闪存图像:用于高批量快速原型制作的遗留闪存模型
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Nano Banana MCP Server 🍌
A production-ready Model Context Protocol (MCP) server that provides AI-powered image generation capabilities through Google’s Gemini models with intelligent model selection.
⭐ NEW: Nano Banana 2 — Gemini 3.1 Flash Image! 🍌🚀
Nano Banana 2 (gemini-3.1-flash-image-preview) is now the default model — delivering Pro-level quality at Flash speed:
- 🍌 Flash Speed + 4K Quality: Up to 3840px at Gemini 2.5 Flash latency
- 🌐 Google Search Grounding: Real-world knowledge for factually accurate images
- 🎯 Subject Consistency: Up to 5 characters and 14 objects per scene
- ✍️ Precision Text Rendering: Crystal-clear text placement in images
- 🏆 Gemini 3 Pro Image still available for maximum reasoning depth
✨ Features
- 🎨 Multi-Model AI Image Generation: Three Gemini models with intelligent automatic selection
- 🍌 Gemini 3.1 Flash Image (NB2): Default model — 4K resolution at Flash speed with grounding
- 🏆 Gemini 3 Pro Image: Maximum reasoning depth for the most complex compositions
- ⚡ Gemini 2.5 Flash Image: Legacy Flash model for high-volume rapid prototyping
- 🤖 Smart Model Selection: Automatically routes to NB2 or Pro based on your prompt
- 📐 Aspect Ratio Control ⭐ NEW: Specify output dimensions (1:1, 16:9, 9:16, 21:9, and more)
- 📋 Smart Templates: Pre-built prompt templates for photography, design, and editing
- 📁 File Management: Upload and manage files via Gemini Files API
- 🔍 Resource Discovery: Browse templates and file metadata through MCP resources
- 🛡️ Production Ready: Comprehensive error handling, logging, and validation
- ⚡ High Performance: Optimized architecture with intelligent caching
🚀 Quick Start
Prerequisites
- Google Gemini API Key - Get one free here
- Python 3.11+ (for development only)
Installation
Option 1: From MCP Registry (Recommended) This server is available in the Model Context Protocol Registry. Search for “nanobanana” or use the MCP name below with your MCP client.
mcp-name: io.github.zhongweili/nanobanana-mcp-server
Option 2: Using uvx
uvx nanobanana-mcp-server@latest
Option 3: Using pip
pip install nanobanana-mcp-server
🔧 Configuration
Authentication Methods
Nano Banana supports two authentication methods via NANOBANANA_AUTH_METHOD:
- API Key (
api_key): UsesGEMINI_API_KEY. Best for local development and simple deployments. - Vertex AI ADC (
vertex_ai): Uses Google Cloud Application Default Credentials. Best for production on Google Cloud (Cloud Run, GKE, GCE).
安装
uvx nanobanana-mcp-server@latest配置
{
"mcpServers": {
"nanobanana": {
"command": "uvx",
"args": ["nanobanana-mcp-server@latest"],
"env": {
"GEMINI_API_KEY": "your-gemini-api-key-here"
}
}
}
}