Skip to main content
Glama

image2-mcp

MCP Server for the company image2 text-to-image API. Allows Claude Code, Codex, and other MCP-compatible AI tools to generate images directly.

๐Ÿš€ Quick Start (One Command)

git clone <repo-url>
cd image2-mcp
bash scripts/setup.sh

The script will:

  1. Check that uv is installed

  2. Install Python dependencies (uv sync)

  3. Ask for your API key (or reuse from ~/.claude/.env)

  4. Write ~/.claude/.env with your key

  5. Add image2 to your ~/.claude/.mcp.json

  6. Run a health check to verify everything works

Then restart Claude Code and try: "ๅธฎๆˆ‘็”Ÿๆˆไธ€ๅผ ๅ›พ็‰‡..."


Related MCP server: Nano-Banana MCP Server

๐Ÿ“ฆ Manual Setup

Prerequisites

  • Python 3.10+

  • uv (Python package manager)

  • A company API Key for the unified AI platform

Install

uv sync

Configuration

Copy the environment template and fill in your API key:

cp .env.example ~/.claude/.env
# Edit ~/.claude/.env and set MAGENE_API_KEY

Variable

Required

Default

Description

MAGENE_API_KEY

Yes

โ€”

Your company API key

MAGENE_API_BASE_URL

No

http://localhost:11636/api/v1/images/generations (set via env)

API endpoint

IMAGE2_OUTPUT_DIR

No

System temp dir /image2-output

Default image save location

IMAGE2_MODEL

No

openai/gpt-image-2

Model name override

MCP Configuration

Add to ~/.claude/.mcp.json:

{
  "mcpServers": {
    "image2": {
      "command": "bash",
      "args": [
        "-c",
        "set -a; [ -f ~/.claude/.env ] && . ~/.claude/.env; [ -f .env ] && . ./.env; set +a; uv run --directory /path/to/image2-mcp python -m image2_mcp"
      ],
      "description": "ๆ–‡็”Ÿๅ›พ โ€” ่ฐƒ็”จๅ…ฌๅธ็ปŸไธ€ API ๅนณๅฐ image2 ๆจกๅž‹็”Ÿๆˆๅ›พ็‰‡"
    }
  }
}

Health Check

uv run python -m image2_mcp --health-check

๐Ÿ”ง How It Works

The AI calls generate_image as a native tool:

AI: generate_image(prompt="a cat in a garden", size="1024x1024")
    โ†’ Server validates parameters
    โ†’ POST to company API
    โ†’ Decodes Base64 response
    โ†’ Saves PNG to disk
    โ†’ Returns image + file path + usage stats to AI

๐Ÿ“ Tool Parameters

Parameter

Type

Required

Default

Description

prompt

string

Yes

โ€”

Text description of the image (max 32000 chars)

size

string

Yes

โ€”

Image size (see below)

quality

string

No

auto

low, medium, high, or auto

output_dir

string

No

From env

Custom output directory

filename

string

No

Auto-generated

Custom filename (without .png)

Available Sizes

Value

Resolution

1024x1024

1K Square

1536x1024

1.5K Landscape

1024x1536

1.5K Portrait

2048x2048

2K Square

2048x1152

2K Landscape

3840x2160

4K Landscape

2160x3840

4K Portrait

auto

Automatic

Custom sizes supported: WxH format, max 3840px per side, multiples of 16, aspect ratio โ‰ค 3:1, total pixels 655,360โ€“8,294,400.


๐Ÿงช Development

uv sync --group dev
uv run pytest --cov=src --cov-report=term-missing
Install Server
F
license - not found
A
quality
B
maintenance

Maintenance

โ€“Maintainers
โ€“Response time
โ€“Release cycle
โ€“Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Paipai112/image2-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server