comfy-mcp
MCP server that enables AI agents to control a local ComfyUI instance for image generation, allowing workflow understanding, parameter modification, execution, and model discovery.
README
comfy-mcp
MCP (Model Context Protocol) server for controlling a local ComfyUI instance from AI agents like Claude Cowork or Claude Code.
Lets an agent understand, modify, and execute ComfyUI workflows — enabling iterative AI-assisted image generation. Should work with any MCP-compatible agent, though it was built with Claude Cowork in mind.
Features
- Workflow understanding — Parse workflow JSON and get a human-readable description of nodes, connections, and parameters
- Parameter modification — Change prompts, seeds, models, samplers, resolution, and any other workflow parameter
- PNG workflow extraction — Extract embedded workflow metadata from ComfyUI-generated PNG images
- Workflow execution — Submit workflows, track progress, and retrieve generated images inline
- Reproducible outputs — Output PNGs have workflow metadata embedded automatically, so images can be dragged back into ComfyUI to reproduce or tweak results with all nodes, connections, and widget values intact
- Model discovery — List available checkpoints, LoRAs, VAEs, ControlNet models, samplers, and schedulers
- Image upload — Upload input images for img2img, ControlNet, and other input-dependent workflows
- Queue management — Monitor, cancel, and clear the execution queue
- Workflow storage — Save and load workflows locally for reuse
Platform support
Developed and tested on Windows. Should work on macOS and Linux but this has not been tested.
Requirements
- Node.js 22+
- A running ComfyUI instance
Setup
npm install
npm run build
Configuration
Add to your MCP client settings. For Claude Code / Claude Cowork, add to .claude/settings.json:
{
"mcpServers": {
"comfyui": {
"command": "node",
"args": ["C:\\path\\to\\comfy-mcp\\dist\\index.js"],
"env": {
"COMFYUI_HOST": "127.0.0.1:8000"
}
}
}
}
For development, use tsx instead:
{
"mcpServers": {
"comfyui": {
"command": "npx",
"args": ["tsx", "C:\\path\\to\\comfy-mcp\\src\\index.ts"],
"env": {
"COMFYUI_HOST": "127.0.0.1:8000"
}
}
}
}
Set COMFYUI_HOST to match your ComfyUI instance (default: 127.0.0.1:8000).
Tools
| Tool | Description |
|---|---|
get_system_stats |
GPU, VRAM, RAM, and system info |
get_object_info |
Available node types and their schemas |
list_models |
Checkpoints, LoRAs, VAEs, and other model files |
describe_workflow |
Human-readable workflow analysis |
set_workflow_parameters |
Modify workflow parameters by node ID |
search_workflow_nodes |
Find nodes by class type or title |
extract_workflow_from_image |
Extract workflow from PNG metadata |
execute_workflow |
Run a workflow and return images (with embedded metadata for reproducibility) |
get_execution_status |
Check job status |
get_execution_result |
Retrieve output images |
upload_image |
Upload input images to ComfyUI |
get_image |
Download images from ComfyUI |
get_queue |
View running and pending jobs |
cancel_execution |
Stop a running job |
clear_queue |
Clear all pending jobs |
get_history |
View execution history |
save_workflow |
Save workflow to local storage |
load_workflow |
Load a saved workflow |
list_workflows |
List saved workflows |
Typical usage flow
- Extract a workflow from a PNG or load a saved one
- Describe the workflow to understand its structure
- Check available models
- Modify parameters (prompt, seed, model, etc.)
- Execute and view the result
- Drag the output PNG back into ComfyUI to reproduce or continue iterating
PNG metadata
Output images automatically embed the full workflow in ComfyUI-compatible PNG metadata. This means any image generated through this server can be dragged directly into the ComfyUI canvas to restore all nodes, connections, and widget values. If you provide the original UI-format workflow (via the ui_workflow parameter), exact node positions and group labels are preserved; otherwise, the server auto-generates a clean left-to-right layout from the API-format workflow.
Environment variables
| Variable | Default | Description |
|---|---|---|
COMFYUI_HOST |
127.0.0.1:8000 |
ComfyUI API host and port |
COMFYUI_WORKFLOWS_DIR |
~/.comfy-mcp/workflows |
Local workflow storage directory |
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.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
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.