comfyui
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@comfyuigenerate an image of a red fox in the snow, save it to /Users/me/outputs"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
comfy_mcp
An MCP server that lets an AI agent (Claude Code, Cline, or any MCP client) generate images on a remote ComfyUI machine and save them into the local workspace.
The model is a swappable workflow file. Drop an exported ComfyUI API workflow into workflows/ and the agent can use it by name. No code change needed.
Tools
Tool | Arguments | Returns |
| none | Names of the workflow files in |
|
| Absolute paths of the saved images |
Each call gets a fresh random seed, so ComfyUI does not return a cached image. Jobs time out after 280 s.
Related MCP server: ComfyUI MCP Server
Requirements
Python 3.10 or newer (the
mcppackage does not support 3.9, which macOS ships).A reachable ComfyUI server with the models your workflows name. The bundled
sdxl.jsonneedssd_xl_base_1.0.safetensorsandsd_xl_refiner_1.0.safetensors.
Setup
python3.12 -m venv .venv
.venv/bin/pip install -r requirements.txtRegister it with Claude Code (user scope, so every project sees it):
claude mcp add comfyui -s user -e COMFY_HOST=http://<gpu-host>:8188 \
-- <path-to-repo>/.venv/bin/python <path-to-repo>/server.pyOr in Cline's MCP settings:
"comfyui": {
"command": "<path-to-repo>/.venv/bin/python",
"args": ["<path-to-repo>/server.py"],
"env": { "COMFY_HOST": "http://<gpu-host>:8188" },
"timeout": 300
}COMFY_HOST defaults to http://localhost:8188.
Adding a workflow
Build the graph in ComfyUI and export it with Workflow > Export (API).
Set the positive prompt node's
textto%PROMPT%and the negative prompt node'stextto%NEGATIVE%.Save it as
workflows/<name>.json.list_workflowspicks it up on the next call.
Security
ComfyUI has no authentication. Do not bind it to 0.0.0.0 on an untrusted network. The setup this was built for binds ComfyUI to the GPU machine's Tailscale IP, with a firewall rule limited to 100.64.0.0/10, so only tailnet devices can reach it.
Design notes
comfy_mcp_guide/README.md covers why each design choice was made: ComfyUI over A1111 or raw diffusers, placeholder substitution over node IDs, the mcp 2.x FastMCP to MCPServer rename, and the seed randomization.
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Remote MCP for RunComfy: ComfyUI deployments, hosted models, LoRA training. 31 tools.
Build and run visual creative-production workflows from your AI agent.
Design, save, and run outcome-aligned AI workflows and verifiers, with reliable image output.
LLM chat, text tools, image generation, editing, batch image jobs, and asynchronous video generation
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables comprehensive ComfyUI workflow automation including image generation, workflow management, node discovery, and system monitoring through natural language interactions with local or remote ComfyUI servers.3138 PyPI14MIT
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to interact with local ComfyUI installations to list nodes, validate workflows, and execute image generation workflows directly without requiring an HTTP server.1MIT
- AlicenseNot gradedqualityDmaintenanceExposes ComfyUI workflows as callable MCP tools, enabling LLMs to run image generation workflows via API.89 PyPIMIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to generate images and videos through natural language by exposing ComfyUI workflows as parameter-configurable MCP tools.10MIT