ImageMcp
A full-featured image processing MCP server for AI assistants, exposing ~55 tools across 11 categories for editing, layers, conversion, AI segmentation/cleanup/generation, design analysis, and screenshot-to-code.
README
ImageMcp
A full-featured image processing MCP server for AI assistants. Exposes ~55 tools across 11 categories — editing, layers, format conversion, AI segmentation/cleanup/generation, design analysis, screenshot-to-code, and more.
Quick Start
# Install
pip install -e .
# Set API key (required for AI-powered tools)
export ANTHROPIC_API_KEY="sk-..."
# Run the MCP server
python server.py
# Or with the MCP CLI
mcp run server.py
Without ANTHROPIC_API_KEY, all non-AI tools work (core editing, layers, conversions) and AI tools degrade to local Pillow fallbacks with reduced quality.
Tools
Core Editing (10)
crop_image, resize_image, rotate_image, flip_image, add_text, remove_text, blur_region, adjust_brightness, adjust_contrast, export_image
Layer Management (8)
create_document, add_image_layer, add_text_layer, move_layer, resize_layer, delete_layer, duplicate_layer, list_layers
Format Conversions (7)
png_to_jpg, jpg_to_png, webp_to_png, svg_to_png, png_to_svg, image_to_pdf, pdf_to_images
AI Segmentation & Selection (6)
extract_subject, extract_person, extract_face, extract_object, remove_background, generate_mask
AI Cleanup (4)
remove_object, erase_text, remove_watermark_candidate, inpaint_region
AI Generation (5)
generate_avatar, generate_icon, generate_background, generate_illustration, generate_character
Design Analysis (5)
extract_colors, extract_typography, detect_layout, describe_design, identify_components
Screenshot → Code (4)
screenshot_to_html, screenshot_to_react, screenshot_to_component_tree, image_to_wireframe
Smart Export (5)
export_png, export_svg, export_react, export_tailwind, export_figma_json
Advanced AI (7)
photo_to_headshot, photo_to_cartoon, photo_to_vector, photo_to_3d, style_transfer, face_enhancement, upscale_image
Architecture
D:\ImageMcp\
├── server.py # FastMCP entry — registers all 55 tools
├── main.py # CLI entry point
├── pyproject.toml # Python project config + dependencies
│
├── src/imagemcp/
│ ├── tools/ # One module per tool category
│ │ ├── core_editing.py
│ │ ├── layers.py
│ │ ├── conversions.py
│ │ ├── ai_segmentation.py
│ │ ├── ai_cleanup.py
│ │ ├── ai_generation.py
│ │ ├── design_analysis.py
│ │ ├── screenshot_to_code.py
│ │ ├── smart_export.py
│ │ └── advanced_ai.py
│ │
│ └── utils/
│ ├── io.py # Image I/O, temp file management
│ ├── ai_client.py # Anthropic SDK client, vision helpers, image generation
│ └── canvas.py # In-memory layer canvas for compositing
│
└── tests/ # ~120 tests across all tool categories
├── conftest.py
└── test_*.py
Configuration
| Variable | Purpose |
|---|---|
ANTHROPIC_API_KEY |
Required for AI vision/generation/inpainting tools |
IMAGEMCP_STORAGE |
Custom temp directory (default: system temp) |
Connecting to the Server
Once the server is running, any MCP-compatible client can connect via stdio transport.
Claude Desktop / Claude Code
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"ImageMcp": {
"command": "python",
"args": ["D:/ImageMCP/server.py"]
}
}
}
VS Code (GitHub Copilot)
Create or edit .vscode/mcp.json in your workspace:
{
"servers": {
"ImageMcp": {
"type": "stdio",
"command": "python",
"args": ["D:/ImageMCP/server.py"]
}
}
}
Using UV
If you use uv to manage the project:
{
"mcpServers": {
"ImageMcp": {
"command": "uv",
"args": ["run", "server.py"],
"cwd": "D:/ImageMCP"
}
}
}
Custom MCP Client (stdio)
The server communicates over stdin/stdout using the Model Context Protocol (MCP) JSON-RPC format. Any MCP-compatible client can connect — no HTTP server needed.
Development
# Install dev dependencies
pip install -e ".[test]"
# Download test assets
python -m tests.download_assets
# Run tests (API tests auto-skip if ANTHROPIC_API_KEY not set)
pytest tests/ -v
Stack
- MCP framework:
mcp[cli](FastMCP) - Image processing: Pillow, numpy
- AI: Anthropic Claude SDK (vision, image generation, inpainting)
- Background removal: rembg (U²-Net, runs locally)
- Format support: cairosvg, PyMuPDF, reportlab
- OCR: pytesseract (optional)
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。