nano-banana
by priorwave
README.md
# Nano Banana MCP Server
A local stdio MCP server for Gemini-powered image generation.
## Features
- Simple MCP to generate images with Google's Gemini image models
- Save generated output to local disk as JPEG
- Return both user-facing content and structured tool output for clients
- Run locally via stdio (no HTTP transport in this project)
## Prerequisites
- Node.js 20+
- Gemini API key from Google AI Studio
## Install
```bash
git clone https://github.com/priorwave/nano_banana_mcp_server/
cd nano-banana-mcp
npm install
npm run build
```
## Configuration
Set an API key in your shell profile:
```bash
export GEMINI_API_KEY="your-key-here"
# GOOGLE_API_KEY is also supported
```
Optional model override:
```bash
export GEMINI_IMAGE_MODEL="gemini-2.5-flash-image"
```
Configure your MCP client to run this server locally via stdio:
```json
{
"mcpServers": {
"nano-banana": {
"command": "node",
"args": ["/absolute/path/to/nano_banana_mcp_server/dist/index.js"],
"env": {
"GEMINI_API_KEY": "${GEMINI_API_KEY}"
}
}
}
}
```
## Tool: `generate_image`
| Parameter | Required | Description |
|-----------|----------|-------------|
| `prompt` | Yes | Prompt text for generation (1-4000 chars) |
| `save_path` | No | Optional output path (absolute or relative). If directory, a timestamped `.jpg` file is created. If file path, extension must be `.jpg` or `.jpeg`. If omitted or invalid/unwritable, the server falls back to `IMAGE_OUTPUT_DIR` and then a safe local temp directory. |
The tool returns:
- Text status content
- Image content
- Structured output with `file_path`, `mime_type`, `model`, and optional `text`
## Development
- Build: `npm run build`
- Start: `npm start`
- Test: `npm test`
TDQS
A4.2/5.0
Scored across 1 tool
Disambiguation5/5
Only one tool exists, so there is no possibility of confusing it with other tools. Its purpose is clearly defined.
Naming Consistency5/5
With a single tool, the naming is inherently consistent and follows a clear verb_noun pattern (generate_image).
Tool Count3/5
A single tool feels thin for a server, but it may be appropriate if the server's entire purpose is image generation. Still, it is borderline and likely lacks broader functionality.
Completeness4/5
The tool provides the core image generation capability with no obvious dead ends, though a more complete surface might include options like output path or resolution controls. Minor gaps exist but are workable.
Maintenance
ActivityInactive
ResponsivenessNo issues