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)
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.