ComfyUI 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.
What is this?
ComfyUI MCP Server connects Claude Desktop (or Claude Code) to your local ComfyUI instance. Once set up, you can ask Claude to generate images and it will run them through Stable Diffusion, SDXL, or whatever checkpoint models you have installed -- no copy-pasting prompts between apps.
It works over MCP (Model Context Protocol), which means Claude treats your ComfyUI setup as a native tool.
Example conversation:
You: Generate a watercolor painting of a coastal village at sunrise
Claude: I'll generate that using your SDXL model.
[calls generate_image -> ComfyUI runs the workflow -> returns result]
Done -- saved as ComfyUI-MCP_00042.png (14.2s)Related MCP server: ComfyMCP
How it works
Claude Desktop / Claude Code
|
v
MCP Server (stdio)
|
v
ComfyUI REST API (localhost:8188)
|
v
Your GPU -> Stable Diffusion / SDXL / etc.The server translates Claude's tool calls into ComfyUI workflow submissions, polls for completion, and returns the results.
Prerequisites
Python 3.11+
ComfyUI running locally (default:
http://127.0.0.1:8188)At least one checkpoint model installed in ComfyUI
Installation
git clone https://github.com/MatthewSnow2/comfyui-mcp.git
cd comfyui-mcp
python -m venv .venv
source .venv/bin/activate # Linux/macOS
# .venv\Scripts\activate # Windows
pip install -e ".[dev]"Setup
1. Configure environment
Copy .env.example to .env and adjust if needed:
cp .env.example .envVariable | Default | What it does |
|
| Where your ComfyUI is running |
|
| Where generated images get saved |
|
| Which checkpoint to use by default |
|
| Sampling steps |
|
| Image width (px) |
|
| Image height (px) |
|
| CFG scale |
2. Add to Claude Desktop
Add this block to your claude_desktop_config.json:
{
"mcpServers": {
"comfyui": {
"command": "/path/to/comfyui-mcp/.venv/bin/comfyui-mcp",
"env": {
"COMFYUI_URL": "http://127.0.0.1:8188",
"COMFYUI_DEFAULT_MODEL": "sd_xl_base_1.0.safetensors"
}
}
}
}Replace /path/to/comfyui-mcp with your actual install path.
Config file locations:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
3. Restart Claude Desktop
Restart the app. You should see "comfyui" listed in the MCP tools dropdown.
What you can do
Generate images
Ask Claude to generate an image from any text prompt. It handles prompt engineering, model selection, and parameter tuning.
Parameter | Type | Default | Description |
| string | (required) | What you want to see |
| string |
| What to avoid |
| string | config default | Checkpoint model name |
| int |
| Width in pixels |
| int |
| Height in pixels |
| int |
| Sampling steps (more = slower but often better) |
| float |
| How closely to follow the prompt |
| int |
| Random seed (-1 = random each time) |
List your models
Ask "what models do I have?" and Claude will show every checkpoint installed in your ComfyUI.
Check queue status
Ask "what's in the queue?" to see how many jobs are pending, running, or completed.
Look up past generations
Give Claude a prompt ID from a previous generation and it will pull up the details.
Real usage examples
You: What models do I have?
Claude: You have 3 checkpoints:
- sd_xl_base_1.0.safetensors
- dreamshaper_8.safetensors
- realisticVision_v51.safetensors
You: Generate a cyberpunk street scene using dreamshaper at 512x768
Claude: [runs generation with dreamshaper_8, 512x768]
Done -- ComfyUI-MCP_00043.png (8.3s)
You: Same scene but make it daytime and use realisticVision
Claude: [runs generation with realisticVision_v51, same dimensions]
Done -- ComfyUI-MCP_00044.png (9.1s)Development
Run tests
pytestLint and type check
ruff check src/ tests/
mypy src/Run the server directly
python -m src.serverProject structure
comfyui-mcp/
src/
server.py # MCP server entry point
comfyui_client.py # HTTP client for ComfyUI API
config.py # Settings via pydantic-settings
models.py # Pydantic data models
workflows.py # ComfyUI workflow templates
tests/ # pytest suite
pyproject.toml
README.mdBuilt with
MCP SDK -- Model Context Protocol
ComfyUI -- Node-based Stable Diffusion UI
Pydantic -- Data validation
httpx -- Async HTTP client
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Use AI models for chat, image, and video generation from Claude Code and other MCP hosts.
Generate AI images and videos from any compatible MCP client.
Generate AI images, video, music, and sound effects, and upscale them, from any MCP client.
Remote MCP for RunComfy: ComfyUI deployments, hosted models, LoRA training. 31 tools.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables Claude Desktop to interact with local ComfyUI installations for AI-powered image generation, including workflow management, model selection, real-time monitoring, and custom workflow execution through natural language.1418MIT
- AlicenseNot gradedqualityDmaintenanceEnables Claude to generate images via ComfyUI from natural language requests, automating workflow construction and execution.1MIT
- AlicenseNot gradedqualityBmaintenanceMCP server that wraps ComfyUI for SDXL image generation. It exposes tools for generating images, listing models, and checking ComfyUI health, with presets and GPU resource coordination.1MIT
- AlicenseNot gradedqualityDmaintenanceEnables MCP clients to generate images using local ComfyUI with FLUX.2 Klein models optimized for Apple Silicon, plus model management and system diagnostics.MIT