使用说明
Gemini图像MCP
使用谷歌的Gemini 3.0模型(Nano Banana Pro)生成AI图像的模型上下文协议(MCP)服务器。
特性
- generate_image -根据文本提示创建分辨率高达4K的图像
- edit_image -使用说明修改现有图像、样式转换、多图像混合
- describe_image -分析和描述图像
- 参考图像 -最多支持14张参考图片,用于风格/内容指导
安装
npm install
npm run build
配置
克劳德代码CLI
claude mcp add gemini-image --env GEMINI_API_KEY=your_key -- node /path/to/dist/index.js
克劳德桌面版
增添 ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"gemini-image": {
"command": "node",
"args": ["/path/to/dist/index.js"],
"env": {
"GEMINI_API_KEY": "your_api_key_here"
}
}
}
}
Zed编辑
Click to expand installation prompt for Zed
将此提示复制并粘贴到您的Zed AI助手:
Install the gemini-image MCP server for me. Here's what you need to do:
1. Clone the repo and build it:
git clone https://github.com/dfeirstein/gemini-image-mcp.git ~/.config/zed/mcp-servers/gemini-image-mcp
cd ~/.config/zed/mcp-servers/gemini-image-mcp
npm install
npm run build
2. Add this to my Zed settings.json under "context_servers":
{
"context_servers": {
"gemini-image": {
"command": {
"path": "node",
"args": ["~/.config/zed/mcp-servers/gemini-image-mcp/dist/index.js"],
"env": {
"GEMINI_API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}
}
3. Remind me to replace YOUR_API_KEY_HERE with my actual Gemini API key from https://aistudio.google.com/apikey
The MCP provides three tools: generate_image, edit_image, and describe_image using Google's Gemini 3.0 (Nano Banana Pro) models.
获取API密钥
从获取Gemini API密钥 谷歌AI工作室.
注: Gemini 3 Pro Image(Nano Banana Pro)需要启用计费功能,没有免费套餐。
使用示例
生成图像
Generate a cyberpunk cityscape at night with neon lights
高分辨率:
Generate a detailed landscape at 4K resolution
编辑图像
Add sunglasses to this photo
Remove the background
Apply a watercolor style
描述图像
What objects are in this image?
Describe the mood and composition
模型
| 型号 | ID | 描述 |
|---|---|---|
| 纳米香蕉Pro | gemini-3-pro-image-preview |
最佳质量,最高4K分辨率(默认) |
| 闪光灯 | gemini-2.5-flash-preview-05-20 |
更快,便于描述 |
| 遗产 | gemini-2.0-flash-exp |
回退选项 |
参数
图像大小(Nano Banana Pro)
1K-标准分辨率(默认)2K-高分辨率4K-超高分辨率
宽高比
1:1-方形(默认)3:4-肖像4:3-景观9:16-高大肖像16:9-宽屏
许可证
麻省理工学院