Skip to main content
Glama
NH-5

Nano Banana MCP Server

by NH-5
README.md
# Nano Banana MCP Server

MCP服务器,用于通过Google AI Studio API调用Gemini Nano Banana Pro (gemini-3-pro-image-preview) 图像生成模型。

版本: 1.0.0

## 功能
- 调用Google Gemini Nano Banana模型生成图像
- 支持通过MCP协议在opencode等客户端中使用
- 生成图片会保存到本地文件

## 安装

```bash
npm install
npm run build
```

## 配置

1. 复制 `.env.example` 为 `.env`:
```bash
cp .env.example .env
```

2. 在 `.env` 中设置你的Google API Key:
```
GOOGLE_API_KEY=your_api_key_here
```

### 环境变量

| 变量 | 说明 | 默认值 |
|------|------|--------|
| `GOOGLE_API_KEY` | Google AI Studio API密钥 | (必填) |
| `HTTPS_PROXY` | HTTPS代理地址 | 系统代理 |

## 运行

```bash
npm start
```

## 在opencode中使用

在opencode的mcp配置中添加:

```json
{
  "mcp": {
    "nanobanana": {
      "type": "local",
      "command": ["node", "/path/to/nanobanana-mcp-server/dist/index.js"],
      "env": {
        "GOOGLE_API_KEY": "your_api_key"
      },
      "enabled": true
    }
  }
}
```

## 工具

### generate_image

生成图像

**参数:**
- `prompt` (required): 图像描述文本
- `output_dir`: 图片保存目录 (默认当前目录)

**示例:**
```
用nano banana画一只可爱的猫咪
```

TDQS

B3.1/5.0

Scored across 1 tool

Disambiguation5/5

With only one tool, there is no possibility of ambiguity or overlap between tools. The single tool 'generate_image' has a clearly distinct purpose that cannot be confused with any other tool in this set.

Naming Consistency5/5

The single tool name 'generate_image' follows a clear verb_noun pattern. With only one tool, there is perfect consistency as there are no other tools to compare against or create naming conflicts with.

Tool Count2/5

A single tool for an image generation server feels thin and under-scoped. While it might cover the core functionality, typical MCP servers for such domains would include additional tools like list_models, get_image_details, or variations of generation parameters. The count of 1 suggests limited capability for agents to perform related operations.

Completeness2/5

The tool surface is severely incomplete for an image generation domain. There is only a generation tool with no supporting operations like model listing, configuration management, image retrieval, or editing capabilities. This creates significant gaps that will likely cause agent failures when trying to perform comprehensive image-related tasks.

Maintenance

ActivityInactive
ResponsivenessNo issues