Skip to main content
Glama
PanPan Image Generator MCP Server

PanPan Image Generator MCP Server

by panda920

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


Related MCP server: ModelsLab Text2Image MCP Server

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


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


Available Tools

5 tools
edit_image_nanoA

编辑图像(单张或批量)。支持全部四款生图模型,支持多图参考,支持指定分辨率和宽高比。

Inputs: model, requests, imagePath, editPrompt, +6 more.

generate_image_batchA

批量生图(单张或多张,高并发)。支持全部四款模型:nanobananapro / gemini-3-pro-image-preview(高质量)、gemini-3-pro-image-preview-2k(2K)、gemini-3-pro-image-preview-4k(4K)、nanobanana2 / gemini-flash(快速)。支持指定分辨率和宽高比。

📁 路径规则:① 每条请求可单独指定 saveToFilePath;② 可用 outputDir 统一指定目录(默认当前工作目录);③ 写入失败时自动 fallback 到 MCP 服务器目录。

Inputs: requests (required), model, outputDir, image_size, +3 more.

generate_image_with_shared_contextB

🎯【推荐】共享上下文批量生图(保持风格一致性)。适合 PPT、教程、卡片组等系列图片。支持全部四款模型,支持指定分辨率。

Inputs: requests (required), styleContext (required), model, image_size, +3 more.

images_to_pdfA

将多张图片转换为 PDF(每页一张,完美填充无空白)。

Inputs: imagePaths (required), outputPath (required).

images_to_pptxC

将多张图片转换为 PowerPoint (PPTX) 文件。

Inputs: imagePaths (required), outputPath (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 5 tools

    Disambiguation4/5

    The two generation tools (generate_image_with_shared_context and generate_image_batch) overlap somewhat, but their descriptions clarify different use cases: one for style-consistent series, the other for high-concurrency generic batch generation. The editing and conversion tools are clearly distinct from each other and from the generation tools.

    Naming Consistency3/5

    The naming is mixed: the first three tools use a verb_noun pattern (generate_image_*, edit_image_*), but the last two use a noun_to_noun pattern (images_to_pdf, images_to_pptx). The suffix 'nano' in edit_image_nano is also inconsistent with the other names. The pattern is readable but not uniform.

    Tool Count5/5

    With 5 tools, the server is well-scoped for its purpose of image generation, editing, and conversion to common presentation formats. Each tool serves a distinct purpose without unnecessary bloat.

    Completeness4/5

    The server covers the core lifecycle of creating, editing, and converting images. Minor gaps exist, such as lack of explicit format conversion beyond PDF/PPTX or model listing, but the primary workflows are supported.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server that enables Claude Code to generate high-quality AI images using ModelsLab API with support for multiple image generation models including Flux, Stable Diffusion, and Midjourney.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      AI-powered image and video generation and processing server that supports text-to-image, image-to-image, text/image-to-video generation, image analysis, and comprehensive editing operations (crop, resize, convert, adjust) through providers like Doubao and Aliyun.
      6
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      An MCP server that brings Google Gemini's image generation and editing capabilities to Claude Desktop, Claude Code, and Cursor. It supports 2K image creation, natural language image transformations, and session consistency to maintain styles across generations.
      7
      704 npm
      MIT