PanPan Image Generator MCP Server
AI-powered image generation and editing server for Claude Code, supporting multiple Gemini models, batch generation, shared context, and conversion to PDF/PPTX.
README
<p align="center"> <img src="assets/banner.png" alt="PanPan Image Generator" width="100%"> </p>
<h1 align="center">PanPan Image Generator MCP</h1>
<p align="center"> <strong>AI-powered image generation & editing MCP server for Claude Code</strong> </p>
<p align="center"> <a href="#features">Features</a> • <a href="#supported-models">Models</a> • <a href="#quick-start">Quick Start</a> • <a href="#tools">Tools</a> • <a href="#examples">Examples</a> </p>
Features
- Multi-model support — Gemini Pro Image Preview (1K/2K/4K) and Gemini Flash Image Preview
- Image editing — Edit existing images with text instructions, supports multi-image reference
- Batch generation — High-concurrency worker pool for parallel image generation
- Shared context — Generate series of images with consistent style (great for slides, tutorials, card sets)
- Resolution control — 1K / 2K / 4K presets or custom WxH, plus aspect ratio selection
- Format conversion — Convert images to PDF or PowerPoint (PPTX)
- Smart file handling — Auto-fallback output directory, customizable per-request save paths
Supported Models
| Model ID | Alias | Quality |
|---|---|---|
gemini-3-pro-image-preview |
nanobananapro |
High quality, 1K |
gemini-3-pro-image-preview-2k |
— | High quality, 2K |
gemini-3-pro-image-preview-4k |
— | High quality, 4K |
gemini-3.1-flash-image-preview |
nanobanana2, gemini-flash |
Fast |
All models are accessed through any OpenAI-compatible API endpoint that supports Gemini image generation.
Demo
<table> <tr> <td align="center"> <img src="assets/demo-art.png" width="300"><br> <sub>Art illustration</sub> </td> <td align="center"> <img src="assets/demo-cyberpunk.png" width="300"><br> <sub>Cyberpunk</sub> </td> <td align="center"> <img src="assets/demo-chinese.png" width="300"><br> <sub>Chinese ink painting</sub> </td> </tr> </table>
Quick Start
Install
git clone https://github.com/panda920/panpan-image-generator-mcp.git
cd panpan-image-generator-mcp
npm install
Configure
Copy the example env file and fill in your API key:
cp .env.example .env
Edit .env:
GEMINI_API_KEY=your_api_key_here
GEMINI_API_BASE=https://openrouter.ai/api/v1
Use with Claude Code
Add to ~/.claude.json:
{
"mcpServers": {
"panpan-image-generator": {
"type": "stdio",
"command": "node",
"args": ["/path/to/panpan-image-generator-mcp/panpan-image-generator-mcp-server.js"],
"env": {
"GEMINI_API_KEY": "your_api_key",
"GEMINI_API_BASE": "https://openrouter.ai/api/v1"
}
}
}
}
Tools
Image Generation
| Tool | Description |
|---|---|
generate_image_batch |
Generate one or more images with high concurrency. Supports all 4 models, custom resolution and aspect ratio. |
generate_image_with_shared_context |
Batch generate images with shared style context for visual consistency. Ideal for slides, tutorials, card sets. |
Image Editing
| Tool | Description |
|---|---|
edit_image_nano |
Edit images (single or batch). Supports all 4 models, multi-image reference, custom resolution and aspect ratio. |
Format Conversion
| Tool | Description |
|---|---|
images_to_pdf |
Convert multiple images to a PDF document (one image per page, full bleed). |
images_to_pptx |
Convert multiple images to a PowerPoint presentation. |
Examples
In Claude Code, just ask naturally:
Generate a cyberpunk cityscape at night in 4K
Edit this image: change the background to blue
Batch generate 5 cat illustrations in different styles
Create a 10-slide presentation with consistent branding, then export to PPTX
Environment Variables
| Variable | Default | Description |
|---|---|---|
GEMINI_API_KEY |
— | API key (required) |
GEMINI_API_BASE |
https://openrouter.ai/api/v1 |
OpenAI-compatible API base URL |
GEMINI_MODEL |
gemini-3-pro-image-preview |
Default Pro model |
GEMINI_FLASH_MODEL |
gemini-3.1-flash-image-preview |
Default Flash model |
OUTPUT_DIR |
Current working directory | Default output directory |
Requirements
- Node.js >= 18.0.0
License
MIT License
<p align="center"> Made with ❤️ by PanPan </p>
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。