image2-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@image2-mcpGenerate an image of a knight riding a dragon"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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.shThe script will:
Check that
uvis installedInstall Python dependencies (
uv sync)Ask for your API key (or reuse from
~/.claude/.env)Write
~/.claude/.envwith your keyAdd
image2to your~/.claude/.mcp.jsonRun 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 syncConfiguration
Copy the environment template and fill in your API key:
cp .env.example ~/.claude/.env
# Edit ~/.claude/.env and set MAGENE_API_KEYVariable | Required | Default | Description |
| Yes | โ | Your company API key |
| No |
| API endpoint |
| No | System temp dir | Default image save location |
| No |
| 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 |
| string | Yes | โ | Text description of the image (max 32000 chars) |
| string | Yes | โ | Image size (see below) |
| string | No |
|
|
| string | No | From env | Custom output directory |
| string | No | Auto-generated | Custom filename (without |
Available Sizes
Value | Resolution |
| 1K Square |
| 1.5K Landscape |
| 1.5K Portrait |
| 2K Square |
| 2K Landscape |
| 4K Landscape |
| 4K Portrait |
| 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-missingMaintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
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