ChromaManga MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
ChromaManga MCP Server
AI-Powered Manga Colorization Service via Model Context Protocol
Features • Quick Start • MCP Tools • Usage Examples • Architecture
Project Overview
This project is built upon ChromaManga, wrapping its powerful manga colorization capabilities as an MCP (Model Context Protocol) service, enabling AI assistants (like Claude, Kiro) to perform manga colorization tasks through natural language conversations.
What is MCP?
MCP is an open protocol that allows AI applications to seamlessly integrate with external tools and data sources. Through MCP, AI assistants can:
Invoke local tools and services
Access file systems and databases
Execute complex multi-step tasks
Related MCP server: manga-trans
Features
Core Colorization Capabilities
🎨 Regional Prompt Control - Different prompts for background and each character, precise colorization in a single inference pass
🤖 Automatic Character Recognition - CLIP-based ReID automatically identifies characters and applies matching LoRA styles
🎯 ControlNet Lineart Guidance - Preserves original manga lineart structure with high fidelity
💬 Speech Bubble Protection - Automatically detects and preserves text in speech bubbles
⚡ Real-ESRGAN Super-Resolution - Optional 4x super-resolution for high-quality output
Agent + Web UI (Recommended)
🌐 LangGraph ReAct Agent - AI agent with tool-calling loop, driven by natural language conversation
🖥️ Web Chat Interface - Dark glass-morphism UI with drag-and-drop upload, parameter drawer, and before/after comparison slider
⚡ WebSocket Streaming - Real-time progress updates: tool calls, intermediate results, and final images streamed live
📡 Langfuse Observability - Optional LLM tracing and evaluation via Langfuse
MCP Service Features
🔧 15 Tool Functions - Complete pipeline from task creation to post-processing
📊 Task State Management - Real-time query of task progress and intermediate results
🔄 Pipeline Rollback - Support for rolling back to any step and re-executing
⚙️ Dynamic Parameter Adjustment - Modify prompts and inference parameters at runtime
🤝 AI Conversation Integration - Use through natural language in Kiro, Claude Desktop, and other clients
Quick Start
Requirements
Python 3.10+
CUDA-capable GPU with 12GB+ VRAM (recommended)
20GB+ free disk space for models
Installation
# 1. Clone repository
git clone https://github.com/YourUsername/ChromaManga-MCP.git
cd ChromaManga-MCP
# 2. Install core dependencies
pip install -r requirements.txt
# 3. Install MCP dependencies
pip install -r mcp_server/mcp_requirements.txt
# 4. (Optional) Install Agent dependencies for Web UI mode
pip install -r agent_requirements.txt
# 5. Models will be downloaded automatically on first run
# Or manually download to data/models/ directory:
# - Base model: Illustrious-XL
# - ControlNet: xinsir/controlnet-union-sdxl-1.0
# - YOLO models: anime person detection + bubble detectionChoose Your Run Mode
This project supports 4 run modes:
Mode | Command | Description |
Agent + Web UI (Recommended) |
| LangGraph Agent + FastAPI + Web chat UI, browser at |
MCP Server |
| Standalone MCP server (stdio), for Claude Desktop / Kiro |
CLI Single Image |
| Command-line end-to-end colorization |
Batch Processing |
| Batch process all images in |
Agent + Web UI Setup
# 1. Prepare LLM credentials
cp .env.agent.example .env.agent
# Edit .env.agent to set LLM_API_KEY (supports any OpenAI-compatible API)
# 2. Start
python run_agent.py
# 3. Open browser
# http://127.0.0.1:8000
# First launch takes 30-60 seconds to load SDXL modelConfigure MCP Client
Using with Kiro
Edit ~/.kiro/settings/mcp.json:
{
"mcpServers": {
"chromamanga": {
"command": "python",
"args": ["path/to/ChromaManga-MCP/mcp_server/chromamanga_mcp_server.py"],
"env": {
"PYTHONPATH": "path/to/ChromaManga-MCP"
},
"disabled": false,
"autoApprove": ["get_task_status", "get_config", "analyze_image"]
}
}
}Using with Claude Desktop
Edit Claude Desktop configuration file:
{
"mcpServers": {
"chromamanga": {
"command": "python",
"args": ["path/to/ChromaManga-MCP/mcp_server/chromamanga_mcp_server.py"],
"env": {
"PYTHONPATH": "path/to/ChromaManga-MCP"
}
}
}
}Verify Installation
# Run integration tests
python tests/verify_integration.py
# Test full pipeline (takes 15-20 minutes)
python tests/test_full_pipeline.py data/inputs/manga.pngMCP Tools
This service provides 15 tool functions covering the complete manga colorization pipeline:
Task Management (3 tools)
create_task- Create a new colorization taskget_task_status- Query task status and progressget_task_result- Get final results and intermediate outputs
Pipeline Steps (7 tools)
extract_lineart- Extract lineart for ControlNet guidancedetect_persons- Detect person locations in the imageidentify_characters- Identify characters using CLIP ReIDdetect_bubbles- Detect speech bubbles to protect text areasgenerate_masks- Generate region masksrun_inference- Execute SDXL + ControlNet inference (10-20 minutes)postprocess- Post-processing: blend lineart, restore text, super-resolution
Configuration Management (3 tools)
get_config- Get current configurationupdate_inference_params- Adjust inference parameters (steps, CFG, seed, etc.)update_prompt- Modify character or background prompts
Utility Functions (3 tools)
analyze_image- Analyze image quality metricsreset_to_step- Roll back to a specific step and re-execute
Usage Examples
Example 1: Complete Colorization Pipeline
In your AI assistant, type:
Please colorize this manga: /path/to/manga.png
Execute the complete pipeline:
1. Create task
2. Extract lineart
3. Detect persons
4. Identify characters
5. Detect bubbles
6. Generate masks
7. Run inference
8. Apply post-processingThe AI will automatically call all tools to complete the colorization and tell you where the result is saved.
Example 2: Adjust Colors
User: Sagiri's hair is too dark, make it brighter
AI actions:
1. get_config - View current configuration
2. update_prompt - Modify Sagiri's prompt, add "bright, light, vibrant"
3. reset_to_step - Roll back to inference step
4. run_inference - Regenerate
5. postprocess - Apply post-processingExample 3: Adjust Parameters
User: Colors are too pale, make them more vibrant
AI actions:
1. analyze_image - Analyze current result
2. update_inference_params - Increase guidance_scale (6.0 → 7.0)
3. reset_to_step - Roll back to inference
4. run_inference - RegenerateExample 4: Check Progress
User: Check status of task abc-123
AI calls get_task_status to display:
- Current status: processing
- Progress: 75% (6/7 steps)
- Current step: run_inference
- Completed: lineart_extraction, detect_persons, ...Architecture
Workflow
┌─────────────────────────────────────────────────────────────────┐
│ Agent + Web UI (Recommended) │
│ │
│ Browser (frontend/) ──WebSocket──▶ FastAPI (agent/server.py) │
│ ↕ │
│ LangGraph ReAct Agent (agent/graph.py) │
│ ↕ (stdio subprocess) │
│ MCP Server (chromamanga_mcp_server.py) │
└─────────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────────┐
│ MCP Client (Kiro / Claude Desktop) │
│ • User interacts through natural language │
│ • AI assistant understands intent and calls MCP tools │
└──────────────────────────┬──────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────────┐
│ MCP Server (chromamanga_mcp_server.py) │
│ • 15 tool functions │
│ • Task state management │
│ • Dynamic parameter adjustment │
└──────────────────────────┬──────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────────┐
│ ChromaManga Core Engine │
│ │
│ 1. Input Processing │
│ • Load B&W manga image │
│ • Extract lineart (ControlNet-compatible) │
│ • Detect speech bubbles → extract text mask │
│ │
│ 2. Character Detection & Recognition │
│ • YOLO person detection → bounding boxes │
│ • CLIP ReID → match to character templates │
│ • Assign region-specific prompts │
│ │
│ 3. Regional Attention Inference │
│ • Build spatial masks (background + person regions) │
│ • Encode all region prompts │
│ • Inject RegionalAttnProcessor into UNet │
│ • Single-pass SDXL + ControlNet inference │
│ • Different prompts routed to different regions │
│ │
│ 4. Post-processing │
│ • Blend original lineart (preserve line clarity) │
│ • Restore speech bubble text (inpaint + stamp) │
│ • Real-ESRGAN 4x super-resolution │
│ • Save final result + debug visualizations │
└─────────────────────────────────────────────────────────────────┘Key Technologies
Model Context Protocol (MCP) - AI tool integration protocol
LangGraph - Agent orchestration framework with tool-calling loop
Stable Diffusion XL - High-quality image generation
ControlNet (Lineart) - Preserves manga line structure
Regional Attention - Custom attention processor for spatial prompt routing
CLIP ReID - Character identification using visual similarity
YOLO - Person and speech bubble detection
Real-ESRGAN - Anime-optimized super-resolution
Project Structure
ChromaManga-MCP/
├── core/ # Core colorization engine
│ ├── colorize.py # Main pipeline: SDXL + ControlNet + Regional Attention
│ ├── config.py # Configuration: models, LoRAs, inference parameters
│ └── task_manager.py # 7-step task state machine with rollback support
│
├── mcp_server/ # MCP server (Model Context Protocol)
│ ├── chromamanga_mcp_server.py # 15 MCP tools, stdio protocol
│ ├── mcp_requirements.txt # MCP dependencies
│ └── mcp_config_example.json # Client-side configuration example
│
├── agent/ # LangGraph Agent + FastAPI backend
│ ├── graph.py # ReAct Agent with SYSTEM_PROMPT and tool-calling loop
│ ├── server.py # FastAPI: WebSocket streaming, image upload/serve
│ ├── mcp_bridge.py # Bridges MCP tools → LangChain tools
│ ├── config.py # LLM credentials, MCP startup, Langfuse
│ └── mock_tools.py # Mock tools for UI development (no GPU needed)
│
├── frontend/ # Web chat interface
│ ├── index.html # Dark glass-morphism UI
│ ├── styles.css # Styles with parameter drawer & comparison slider
│ └── app.js # WebSocket client, tool cards, progress tracking
│
├── utils/ # Utility modules
│ ├── preprocess.py # Lineart extraction and denoising strategies
│ ├── postprocess.py # Lineart blending
│ ├── character_reid.py # CLIP ViT-L/14 character ReID
│ └── regional_attention.py # Custom UNet cross-attention for spatial prompt routing
│
├── scripts/ # CLI tools
│ ├── batch_colorize.py # Batch process data/inputs/
│ └── experiments/ # Denoising & lineart method comparison experiments
│
├── tests/ # Test suite
│ ├── test_mcp_server.py # MCP server unit tests
│ ├── test_full_pipeline.py # End-to-end pipeline test (requires GPU)
│ ├── verify_integration.py # Integration verification
│ └── check_mcp_setup.py # MCP dependency/config health check
│
├── examples/ # Example outputs showing pipeline stages
│ └── */ # Per-task debug images (input → lineart → ... → final)
│
├── data/ # Data directory
│ ├── inputs/ # Input manga images
│ ├── outputs/ # Output results
│ ├── loras/ # LoRA model weights
│ ├── models/ # Pre-trained models (auto-downloaded)
│ └── refs/ # Character reference images for ReID
│
├── run_agent.py # Agent + Web UI entrypoint
├── requirements.txt # Core Python dependencies
├── agent_requirements.txt # Agent/Web UI dependencies
├── .env.agent.example # LLM credential template
└── CHANGELOG.md # ChangelogParameter Tuning Guide
Color-Related
Issue | Solution | Parameter Adjustment |
Colors too pale | Increase prompt adherence |
|
Colors oversaturated | Decrease prompt adherence |
|
Specific character color wrong | Modify character prompt |
|
Quality-Related
Issue | Solution | Parameter Adjustment |
Insufficient detail | Increase inference steps |
|
Lineart not clear | Increase ControlNet strength |
|
Too rigid | Decrease ControlNet strength |
|
Lineart too heavy | Decrease blend strength |
|
Background-Related
Issue | Solution | Example Prompt |
Background too busy | Simplify background prompt |
|
Background too plain | Enrich background prompt |
|
Character Auto-Recognition
Place reference images in data/refs/character_name/ directory:
data/refs/
├── sagiri/
│ ├── ref1.png
│ ├── ref2.jpg
│ └── ref3.png
└── another_character/
└── ref1.pngThe system will automatically:
Extract CLIP features from reference images
Build character templates (cached in
data/models/reid_templates.npy)Match detected persons to templates
Apply corresponding LoRA and prompts
System Requirements
GPU: NVIDIA GPU with 12GB+ VRAM (RTX 3060 Ti or better)
RAM: 16GB+ system memory
Storage: 20GB+ for models and cache
OS: Windows 10/11, Linux, macOS (with CUDA support)
Troubleshooting
MCP-Related
MCP Server won't start
Check if configuration file path is correct
Run
python tests/verify_integration.pyto verifyCheck client log output
Tool call failed
Confirm task ID is correct
Check if prerequisite steps are completed
Review error message and follow instructions
Performance-Related
Out of Memory (OOM)
Reduce
max_infer_resolutionincore/config.pyEnable
downscale_before_infer = TrueClose other GPU applications
Slow inference
Ensure CUDA is available:
torch.cuda.is_available()Install xformers:
pip install xformersUse fewer inference steps (15-20)
Quality-Related
Poor colorization quality
Adjust
controlnet_scale(try 0.9-1.2)Tune
guidance_scale(try 5.5-7.5)Check if LoRA is compatible with base model
Ensure lineart extraction quality (check debug images)
Output Results
Each task generates complete intermediate results:
data/outputs/colored/debug/{task_id}_colored/
├── 00_input.png # Original input
├── 01_bubble_bbox.png # Bubble detection
├── 02_lineart.png # Lineart extraction
├── 02_person_detection.png # Person detection
├── 03_bboxes_reid.png # Character identification
├── 04_region_mask.png # Region masks
├── 05_colored_raw.png # Raw colorization
├── 06_lineart_blend.png # Lineart blended
└── 07_final.png # Final result
data/outputs/colored/
└── {filename}_colored.png # Main output fileDevelopment Guide
Adding New MCP Tools
Add tool definition in
list_tools()Add routing in
call_tool()Implement corresponding
handle_xxx()function
Debugging MCP Server
# Run MCP Server directly
python mcp_server/chromamanga_mcp_server.py
# View logs (output to stderr)
python mcp_server/chromamanga_mcp_server.py 2> mcp_server.logRunning Tests
# Basic functionality tests
python tests/test_mcp_server.py
# Full pipeline test
python tests/test_full_pipeline.py data/inputs/manga.png
# Integration verification
python tests/verify_integration.pyLicense
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
This project is built upon the following open-source projects:
ChromaManga - Original manga colorization project
Model Context Protocol - MCP protocol specification
Stable Diffusion XL by Stability AI
ControlNet by Lvmin Zhang
Illustrious-XL by OnomaAI Research
Real-ESRGAN by Xintao Wang
CLIP by OpenAI
Related Documentation
CLAUDE.md - AI collaboration guide, architecture details, and key code index
CHANGELOG.md - Version history and changes
Citation
If you use this project in your research or project, please cite:
@software{chromamanga_mcp_2024,
title={ChromaManga MCP Server: AI-Powered Manga Colorization via Model Context Protocol},
author={Your Name},
year={2024},
url={https://github.com/YourUsername/ChromaManga-MCP}
}Made with ❤️ for manga artists and AI developers
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Create manga and anime art from text. 24 styles, multi-panel stories, BYOK.
Turn a script into manga and comic pages and voiced anime clips, with consistent characters.
1Image and video AI tools and your own pipelines, run from any AI assistant.
Anime image, original character (OC) & anime video generation for AI agents. Free daily credits.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables generating original English-dialogue manga with configurable Japanese art styles through an MCP server, including story scripting, panel image generation, and page composition.-
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to perform local-first manga/comic scanlation by inspecting raw pages, translating text, cleaning speech bubbles, and typesetting localized content through MCP tools.1-
- FlicenseNot gradedqualityBmaintenanceAutomates manga translation by detecting text regions with YOLO, performing OCR, invoking a multimodal LLM with full-page context for translation, and rendering translated text back onto the original images.-
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to search and filter titles, browse rankings, read comments, manage favorites, download albums, chapters, and covers with live progress, cancellation, and retry, and convert downloads into ZIP, PDF, or long images, all through natural language. Exposes 21 tools and 3 knowledge resources over stdio, SSE, and HTTP transports, along with runtime configuration and account login.-