comfyui-mcp-server — Claude Code MCP server
Connects ComfyUI to an AI agent and exposes workflows as callable MCP tools. Use it to generate images or video from agent requests.
claude mcp add comfyui-mcp-server -- npx -y @metabrain-labs/comfyui-mcp-serverWhat comfyui-mcp-server does
comfyui-mcp-server connects an existing ComfyUI setup to an MCP host. It turns user-defined workflows into tools with configurable parameters, so an agent can submit image or video jobs, read results, save generated files, and upload source media from a local path or HTTP URL.
The server includes tools for workflow discovery and mounting, queueing and cancelling jobs, checking system status, listing model files, and retrieving outputs. API-format JSON workflows can be imported and saved, while an advanced mode accepts a complete ComfyUI API prompt. Communication works through STDIO or Streamable HTTP.
Node.js 18+ and ComfyUI 0.9.1+ are required. The server cannot execute a workflow without a running ComfyUI instance, so that connection must be ready before jobs are submitted.
What it helps with
- run ComfyUI workflows from an AI agent
- generate images and video through MCP
- upload source files into ComfyUI input
- save generated assets to a local directory
- inspect or cancel queued workflow jobs
Example prompts for the agent
- Connect to ComfyUI, find the available workflows, and run one to generate an image.
- Upload a local source file to ComfyUI, then use the matching workflow.
- Submit a workflow job, check its progress, and save the generated assets locally.
How to install comfyui-mcp-server
Platform CLI
claude mcp add comfyui-mcp-server -- npx -y @metabrain-labs/comfyui-mcp-serverPlatform CLI
codex mcp add comfyui-mcp-server -- npx -y @metabrain-labs/comfyui-mcp-serverConfig file
{
"mcpServers": {
"comfyui-mcp-server": {
"command": "npx",
"args": [
"-y",
"@metabrain-labs/comfyui-mcp-server"
]
}
}
}Config file
{
"servers": {
"comfyui-mcp-server": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@metabrain-labs/comfyui-mcp-server"
]
}
}
}Platform CLI
gemini mcp add comfyui-mcp-server npx -y @metabrain-labs/comfyui-mcp-serverStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about comfyui-mcp-server
How do I install comfyui-mcp-server in Claude Code?
Run claude mcp add comfyui-mcp-server -- npx -y @metabrain-labs/comfyui-mcp-server.
What does comfyui-mcp-server do?
It connects ComfyUI to an MCP host and gives an AI agent tools for running workflows, passing parameters, uploading assets, and retrieving generated files.
What does comfyui-mcp-server require?
It requires Node.js 18+ and ComfyUI 0.9.1+. An MCP client or AI agent is also needed to call the server.