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 |
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。