Home / MCP / ComfyUI MCP Server
Provides an MCP integration for ComfyUI, enabling workflows via HTTP SSE transport or local UV-based execution.
Configuration
View docs{
"mcpServers": {
"comfyui": {
"url": "http://localhost:8001/sse"
}
}
}This MCP Server enables you to integrate ComfyUI with MCP, letting you run ComfyUI-powered workflows from your MCP client. It supports running locally via UV as well as deploying with Docker and routing through an HTTP SSE transport for remote access. You can choose the method that fits your environment and scale your automation accordingly.
Start by choosing your preferred connection method. If you want to run the server locally, you can use UV to execute the MCP workflow runner alongside ComfyUI. If you prefer containerized deployment, you can run a Docker container that exposes the MCP interface. You can also connect through an HTTP SSE transport to use a remote endpoint.
Prerequisites you need before starting: you must have a running ComfyUI server available at the address you configure. You should also have UVX (the MCP runner) or Docker installed on your host depending on the deployment path you choose.
Recommended installation and run flow if you use UV to run the MCP server: follow the provided MCP command to start the compositor and connect to ComfyUI through the MCP gateway.
{
"mcpServers": {
"comfyui": {
"command": "uv",
"args": [
"--directory",
"PATH/MCP/comfyui",
"run",
"--with",
"mcp",
"--with",
"websocket-client",
"--with",
"python-dotenv",
"mcp",
"run",
"src/server.py:mcp"
]
}
}
}When using Docker, you can either build a custom image or run a prebuilt one. You may need to adjust how images access the host filesystem and how image payloads are transmitted.
Build a custom image example:
# Build your custom image
docker image build -t mcp/comfyui .{
"mcpServers": {
"comfyui": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-p",
"3001:3000",
"mcp/comfyui"
]
}
}
}{
"mcpServers": {
"comfyui": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-p",
"3001:3000",
"overseer66/mcp-comfyui"
]
}
}
}To connect via SSE, run the SSE server in Docker and configure the MCP client to use the SSE endpoint.
{
"mcpServers": {
"comfyui": {
"url": "http://localhost:8001/sse"
}
}
}When you add new workflows as tools, you need to rebuild and redeploy the Docker images to make them available.
Returns the URL of the generated image. To obtain the actual image, use the download_image tool or open the URL in a browser.
Downloads images generated by other tools using the provided image URL.
Executes a workflow by providing the path to a workflow JSON file.
Executes a workflow by providing the workflow JSON data directly.