# comfyui-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.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 10
- Author: MetaBrain-Labs
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/MetaBrain-Labs/ComfyUI-MCP-Server-TypeScript
- Updated: 2026-03-20
- HTML: https://affpapa.org/en/nevibecode/mcp/comfyui-mcp-server

## What it 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.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add comfyui-mcp-server -- npx -y @metabrain-labs/comfyui-mcp-server
```

### Codex

**Platform CLI**
```bash
codex mcp add comfyui-mcp-server -- npx -y @metabrain-labs/comfyui-mcp-server
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "comfyui-mcp-server": {
            "command": "npx",
            "args": [
                "-y",
                "@metabrain-labs/comfyui-mcp-server"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "comfyui-mcp-server": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@metabrain-labs/comfyui-mcp-server"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add comfyui-mcp-server npx -y @metabrain-labs/comfyui-mcp-server
```

## When to use it
- 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
- 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.

## Similar
- [comfyui](https://affpapa.org/en/nevibecode/skills/comfyui.md) — skill · 391 installs
- [comfyui-mcp](https://affpapa.org/en/nevibecode/mcp/comfyui-mcp.md) — MCP server · ★ 867
- [cli-anything-comfyui](https://affpapa.org/en/nevibecode/skills/cli-anything-comfyui.md) — skill · 546 installs
- [runcomfy-cli](https://affpapa.org/en/nevibecode/skills/runcomfy-cli.md) — skill · 380100 installs
- [muapi-workflow](https://affpapa.org/en/nevibecode/skills/muapi-workflow.md) — skill · 1000 installs
- [muapi-talking-baby-video](https://affpapa.org/en/nevibecode/skills/muapi-talking-baby-video.md) — skill · 655 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
