image2-mcp

image2-mcp

MCP server for the company image2 text-to-image API, enabling AI tools to generate images directly from text prompts.

Category
Visit Server

README

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: "ๅธฎๆˆ‘็”Ÿๆˆไธ€ๅผ ๅ›พ็‰‡..."


๐Ÿ“ฆ 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

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured