ComfyUI MCP Server
Integrates ComfyUI with MCP, allowing the use of custom workflows. Requires a running ComfyUI server.
ComfyUI MCP Server
1. Overview
- A server implementation for integrating ComfyUI with MCP.
- ⚠️ IMPORTANT: This server requires a running ComfyUI server.
- You must either host your own ComfyUI server,
- or have access to an existing ComfyUI server address.
2. Debugging
2.1 ComfyUI Debugging
python src/test_comfyui.py
2.2 MCP Debugging
mcp dev src/server.py
3. Installation and Configuration
3.1 ComfyUI Configuration
-
Edit
src/.envto set ComfyUI host and port:COMFYUI_HOST=localhost COMFYUI_PORT=8188
3.2 Adding Custom Workflows
- To add new tools, place your workflow JSON files in the
workflowsdirectory and declare them as new tools in the system.
4. Built-in Tools
-
text_to_image
- Returns only the URL of the generated image.
- To get the actual image:
- Use the
download_imagetool, or - Access the URL directly in your browser.
- Use the
-
download_image
- Downloads images generated by other tools (like
text_to_image) using the image URL.
- Downloads images generated by other tools (like
-
run_workflow_with_file
-
Run a workflow by providing the path to a workflow JSON file.
# You should ask to agent like this. Run comfyui workflow with text_to_image.json -
example image of CursorAI

-
-
run_workflow_with_json
-
Run a workflow by providing the workflow JSON data directly.
# You should ask to agent like this. Run comfyui workflow with this { "3": { "inputs": { "seed": 156680208700286, "steps": 20, ... (workflow JSON example) }
-
5. How to Run
5.1 Using UV (Recommended)
-
Example
mcp.json:{ "mcpServers": { "comfyui": { "command": "uv", "args": [ "--directory", "PATH/MCP/comfyui", "run", "--with", "mcp", "--with", "websocket-client", "--with", "python-dotenv", "mcp", "run", "src/server.py:mcp" ] } } }
5.2 Using Docker
- Downloading images to a local folder with
download_imagemay be difficult since the Docker container does not share the host filesystem. - When using Docker, consider:
- Set
RETURN_URL=falsein.envto receive image data as bytes. - Set
COMFYUI_HOSTin.envto the appropriate address (e.g.,host.docker.internalor your server's IP). - Note: Large image payloads may exceed response limits when using binary data.
- Set
5.2.1 Build Docker Image
# First build image
docker image build -t mcp/comfyui .
{
"mcpServers": {
"comfyui": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-p",
"3001:3000",
"mcp/comfyui"
]
}
}
}
5.2.2 Using Existing Images
Also you can use prebuilt image.
{
"mcpServers": {
"comfyui": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-p",
"3001:3000",
"overseer66/mcp-comfyui"
]
}
}
}
5.2.3 Using SSE Transport
-
Run the SSE server with Docker:
docker run -i --rm -p 8001:8000 overseer66/mcp-comfyui-sse -
Configure
mcp.json(change localhost to your IP or domain if needed):{ "mcpServers": { "comfyui": { "url": "http://localhost:8001/sse" } } }
NOTE: When adding new workflows as tools, you need to rebuild and redeploy the Docker images to make them available.
Related Servers
Scout Monitoring MCP
sponsorPut performance and error data directly in the hands of your AI assistant.
Alpha Vantage MCP Server
sponsorAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
My MCP Server
A remote MCP server deployable on Cloudflare Workers without authentication.
Proteus Workflow Engine
A modern, extensible multi-agent workflow engine with real-time monitoring and a web visualization interface.
Vega-Lite
Generate visualizations from fetched data using the VegaLite format and renderer.
OpenFGA
An MCP server for managing authorization models with OpenFGA, an open-source authorization system.
Mermaid MCP Server
Converts Mermaid diagrams to PNG or SVG images.
MCP Aggregator
An MCP (Model Context Protocol) aggregator that allows you to combine multiple MCP servers into a single endpoint allowing to filter specific tools.
godot-mcp-runtime
Playwright MCP for Godot, screenshots, SceneTree manipulation, and arbitrary GDScript execution at runtime through a local UDP bridge.
Vibe-Coder
A structured development workflow for LLM-based coding, including feature clarification, planning, phased development, and progress tracking.
Pathmode
Build structured intent specs through Socratic AI conversation. Describe a problem or paste a support ticket — Claude challenges vague thinking, asks pointed questions, and builds a structured spec. Exports as intent.md, .cursorrules, or CLAUDE.md.
AI Development Assistant MCP Server
An AI assistant for development tasks, including taking screenshots, architecting solutions, and performing code reviews.