Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions agent-tools/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@

<CardGroup cols={2}>
<Card title="Comfy Cloud MCP" icon="cloud" href="/agent-tools/cloud">
Connect to the hosted MCP server at <code>cloud.comfy.org/mcp</code>. Generate images, video, audio, and 3D on Cloud GPUs, search templates/models/nodes, run workflows, and share saved workflows from chat.

Check warning on line 16 in agent-tools/index.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

agent-tools/index.mdx#L16

Did you really mean 'GPUs'?
</Card>
<Card title="Comfy Partner MCP" icon="plug" href="/agent-tools/partner-mcp">
Run a local MCP server using the Comfy Partner-Node SDK. Provides unified <code>generate_image</code>, <code>generate_video</code>, <code>generate_3d</code>, and more tools across 30+ partner providers.
</Card>
<Card title="Comfy Local MCP" icon="server" href="/agent-tools/local">
First-party local MCP server that drives your **own** ComfyUI install via <code>comfy-cli</code> — run workflows and inspect the nodes and models your machine actually has. *Early preview.*
</Card>
<Card title="Comfy CLI" icon="terminal" href="/agent-tools/comfy-cli">
Short agent-oriented overview of <code>comfy generate</code>. For the complete CLI guide, see [Getting started](/comfy-cli/getting-started).
</Card>
Expand All @@ -27,28 +30,24 @@

## Which One Should I Use?

| | Comfy Cloud MCP | Comfy Partner MCP | Comfy CLI |
|---|---|---|---|
| **Type** | Remote (hosted) | Local MCP server | Local CLI |
| **Requires** | Comfy Cloud subscription | [Comfy API key](/development/api-development/getting-an-api-key) | [Comfy API key](/development/api-development/getting-an-api-key) |
| **Models** | Comfy Cloud models (pre-installed) | 30+ partner providers (BFL, Ideogram, Kling, Runway, Veo, ElevenLabs, etc.) | Partner nodes via `comfy generate` |
| **Workflows** | Full ComfyUI workflow execution | Partner API generation (no custom workflows) | One-shot partner API calls (no workflow JSON) |
| **GPU** | Cloud GPUs (no local GPU needed) | No GPU needed (API-based) | No GPU needed (API-based) |
| **Best for** | Chat-driven agents, template search | Unified MCP tools across providers | Scripts, CI, batch jobs |
| | Comfy Cloud MCP | Comfy Partner MCP | Comfy Local MCP | Comfy CLI |
|---|---|---|---|---|
| **Type** | Remote (hosted) | Local MCP server | Local MCP server | Local CLI |
| **Requires** | Comfy Cloud subscription | [Comfy API key](/development/api-development/getting-an-api-key) | Local ComfyUI + [comfy-cli](https://github.com/Comfy-Org/comfy-cli) | [Comfy API key](/development/api-development/getting-an-api-key) |
| **Models** | Comfy Cloud models (pre-installed) | 30+ partner providers (BFL, Ideogram, Kling, Runway, Veo, ElevenLabs, etc.) | Your local models and custom nodes | Partner nodes via `comfy generate` |

Check warning on line 37 in agent-tools/index.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

agent-tools/index.mdx#L37

Did you really mean 'Kling'?

Check warning on line 37 in agent-tools/index.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

agent-tools/index.mdx#L37

Did you really mean 'Veo'?
| **Workflows** | Full ComfyUI workflow execution | Partner API generation (no custom workflows) | Full local ComfyUI workflow execution | One-shot partner API calls (no workflow JSON) |
| **GPU** | Cloud GPUs (no local GPU needed) | No GPU needed (API-based) | Your local GPU | No GPU needed (API-based) |

Check warning on line 39 in agent-tools/index.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

agent-tools/index.mdx#L39

Did you really mean 'GPUs'?
| **Best for** | Chat-driven agents, template search | Unified MCP tools across providers | Driving your own local ComfyUI from chat | Scripts, CI, batch jobs |

---

## What about local ComfyUI?

Many people ask about driving a **local** ComfyUI install with an agent instead of (or alongside) Comfy Cloud MCP.

**Why did Comfy Cloud MCP ship first?** The hosted server at `cloud.comfy.org` is something only the Comfy team can build and operate. That is why our first-party MCP release is Cloud-based.

**Local agents are not new.** Hooking an agent up to ComfyUI on your own machine has been possible since ComfyUI was open-sourced. A running local server exposes workflows and APIs that MCP bridges and other tools can call.
Want to drive a **local** ComfyUI install with an agent instead of (or alongside) Comfy Cloud MCP? Comfy now ships a first-party option.

**Better local agent UX is on the roadmap.** Improving the first-party local agent experience is part of our vision. Cloud MCP was the piece we could ship first; more local polish will follow.
**Comfy Local MCP (first-party).** [**comfy-local-mcp**](https://github.com/Comfy-Org/comfy-local-mcp) is our official local MCP server — a thin wrapper over [comfy-cli](https://github.com/Comfy-Org/comfy-cli) that lets AI agents run workflows on **your own** ComfyUI and inspect the nodes, custom nodes, and models your install actually has. It is an **early preview**. See [**Comfy Local MCP**](/agent-tools/local) for setup and client configuration.

**Community MCP servers you can try today.** Several community projects already connect MCP clients to a local ComfyUI instance:
**Community MCP servers.** Several community projects also connect MCP clients to a local ComfyUI instance:

| Project | Repository |
| --- | --- |
Expand Down
156 changes: 156 additions & 0 deletions agent-tools/local.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
---
title: "Comfy Local MCP"
sidebarTitle: "Local MCP"
description: "Drive your own local ComfyUI from AI agents (Claude Code, Claude Desktop, Cursor) with the first-party comfy-local-mcp server — run workflows, collect outputs, and inspect the nodes and models your install actually has."
icon: "server"
---

<Warning>
**Early preview.** `comfy-local-mcp` is an early proof-of-concept. The core loop (`server_info → run_workflow → fetch_outputs`) is validated end-to-end against a live local ComfyUI, but tools and behavior may still change.

Check warning on line 9 in agent-tools/local.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

agent-tools/local.mdx#L9

Did you really mean 'run_workflow'?
</Warning>

[**comfy-local-mcp**](https://github.com/Comfy-Org/comfy-local-mcp) is Comfy's **first-party local MCP server** — the official way to drive a **local** ComfyUI install from AI agents (Claude Code, Claude Desktop, Cursor, and other MCP clients). It is a thin wrapper over [comfy-cli](https://github.com/Comfy-Org/comfy-cli): each tool shells out to the `comfy` command, so `comfy-cli` is the engine and there is no code shared with the [Comfy Cloud MCP](/agent-tools/cloud).

Check warning on line 12 in agent-tools/local.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

agent-tools/local.mdx#L12

Did you really mean 'Comfy's'?

Unlike the cloud and partner servers, it talks to the ComfyUI running on **your own machine** — so it can run your workflows and inspect the nodes, custom nodes, and models your install actually has.

---

## Requirements

- **Python 3.10+**
- **[comfy-cli](https://github.com/Comfy-Org/comfy-cli)** on your `PATH` (`pip install comfy-cli`) — the engine every tool wraps
- **A ComfyUI workspace** — create one with `comfy install` if you don't have one (an existing checkout works via `comfy set-default <path>`)
- **A running ComfyUI** — start it with `comfy launch` before using the tools; nothing here launches ComfyUI implicitly

---

## Installation

From a checkout of the [repository](https://github.com/Comfy-Org/comfy-local-mcp):

```bash
pip install . # or `pip install -e .` for a working copy
```

This puts a `comfy-local-mcp` console script on your `PATH` — that command is the MCP server (it speaks MCP over stdio). Point your AI client at it below.

<Note>
**`COMFY_BIN` (optional).** MCP clients launch the server with their own environment, which often does **not** include your shell's `PATH`. If `comfy` lives in a virtualenv or a non-standard location, set `COMFY_BIN` to its absolute path (for example `/path/to/venv/bin/comfy`). Every client example below shows where it goes; drop it if `comfy` is already on the environment your client launches the server with.

Check warning on line 38 in agent-tools/local.mdx

View check run for this annotation

Mintlify / Mintlify Validation (dripart) - vale-spellcheck

agent-tools/local.mdx#L38

Did you really mean 'virtualenv'?
</Note>

---

## Configure your AI client

All clients speak the same MCP stdio contract: run the `comfy-local-mcp` command as a server. Pick your client.

### Claude Code

One command registers the server:

```bash
claude mcp add comfy-local -e COMFY_BIN=/path/to/venv/bin/comfy -- comfy-local-mcp

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

Does claude mcp add -e KEY=VALUE -- (env flag after the server name) work correctly in the current Claude Code CLI, or is env flag placement before the name required?

💡 Result:

In the current Claude Code CLI, the environment variable flag must be placed before the server name. Placing the env flag after the server name is not supported and will cause the command to fail or be parsed incorrectly [1][2][3]. According to official documentation and technical discussions, all configuration options—including --env (or -e), --transport, and --scope—must precede the server name [1][2][3]. The -- separator is then used to delineate the end of these configuration flags and the start of the command that launches the server [4][5]. A known issue in the CLI exists where the parser may greedily consume the server name as part of the env-var value if the syntax is not strictly followed [6]. To ensure the command is parsed as intended, you should use the following order: claude mcp add [OPTIONS] -- [args...] For example: claude mcp add --env KEY=VALUE --transport stdio -- Documentation explicitly advises placing at least one other option (such as --transport) between the --env flag and the server name if you encounter parsing difficulties, as this helps prevent the CLI from incorrectly treating the server name as an additional environment variable pair [4][5].

Citations:


Move -e before the server name

claude mcp add comfy-local -e COMFY_BIN=/path/to/venv/bin/comfy -- comfy-local-mcp is parsed incorrectly on supported Claude Code versions. Use claude mcp add -e COMFY_BIN=/path/to/venv/bin/comfy comfy-local -- comfy-local-mcp instead. Tiny typo, big nope.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@agent-tools/local.mdx` at line 52, The Claude MCP add example is using the
wrong argument order, so update the command in the local setup docs to place the
environment flag before the server name. Fix the `claude mcp add` example under
the comfy-local entry so `-e COMFY_BIN=/path/to/venv/bin/comfy` appears before
`comfy-local`, matching the supported parsing order for Claude Code versions.

```

Or check it into a project with a `.mcp.json` at the repo root:

```json
{
"mcpServers": {
"comfy-local": {
"command": "comfy-local-mcp",
"env": { "COMFY_BIN": "/path/to/venv/bin/comfy" }
}
}
}
```

### Claude Desktop

Edit `claude_desktop_config.json` (Settings → Developer → Edit Config; on macOS it lives at `~/Library/Application Support/Claude/claude_desktop_config.json`), add the server, then restart Claude Desktop:

```json
{
"mcpServers": {
"comfy-local": {
"command": "comfy-local-mcp",
"env": { "COMFY_BIN": "/path/to/venv/bin/comfy" }
}
}
}
```

### Cursor

Add the server to `~/.cursor/mcp.json` (global) or `.cursor/mcp.json` (per project):

```json
{
"mcpServers": {
"comfy-local": {
"command": "comfy-local-mcp",
"env": { "COMFY_BIN": "/path/to/venv/bin/comfy" }
}
}
}
```

---

## Quickstart

Zero to a generated image:

<Steps>
<Step title="Install the pieces">
```bash
pip install comfy-cli # the engine
comfy install # create a ComfyUI workspace (skip if you have one)
pip install . # this MCP server → the `comfy-local-mcp` command
```
</Step>
<Step title="Launch ComfyUI and leave it running">
```bash
comfy launch
```
</Step>
<Step title="Add the server to your client">
Use the snippet for your client above, then restart / reload it so the tools appear.
</Step>
<Step title="Ask your agent to run a workflow">
For example:

> "Confirm my local ComfyUI is running, then run the workflow at `~/workflows/txt2img.json` and show me the image."

Under the hood the agent calls `server_info` to confirm ComfyUI is up, `run_workflow` to execute the workflow JSON, and `fetch_outputs` to collect the result.
</Step>
</Steps>

---

## Tools

Each tool maps onto a `comfy-cli` command, run with `--where local`. Highlights:

| Tool | Purpose |
|---|---|
| `server_info()` | Is a local ComfyUI running, where, and which workspace. **Call first.** |
| `run_workflow(workflow_path, wait=True)` | Run a workflow JSON; `wait=False` submits async and returns a `prompt_id`. |
| `job_status` / `wait_for_job` / `watch_job` | Poll, wait on, or stream a submitted job. |
| `fetch_outputs(prompt_id, out_dir)` | Copy a finished job's outputs into `out_dir`. |
| `launch_comfyui` / `stop_comfyui` | Start or stop the local ComfyUI. |
| `search_templates` / `fetch_template` | Find a built-in template and write its runnable workflow JSON. |
| `search_nodes` / `get_node` / `list_nodes` | Inspect the node classes in your **live local** install (custom nodes included). |
| `search_models` | List the model files on disk. |
| `validate_workflow` | Pre-flight a workflow against the live `object_info` before a slow run. |

Node introspection and model search read your **live install** — custom nodes included — which is the local differentiator from the cloud MCP. See the [repository](https://github.com/Comfy-Org/comfy-local-mcp) for the full tool list and reference.

---

## Related

- [Comfy Cloud MCP](/agent-tools/cloud) — hosted MCP server, no local install or GPU needed
- [Comfy Partner MCP](/agent-tools/partner-mcp) — local server for 30+ partner providers via the Comfy API
- [Comfy CLI](/agent-tools/comfy-cli) — drive local ComfyUI and partner generation from the terminal
- [comfy-local-mcp on GitHub](https://github.com/Comfy-Org/comfy-local-mcp) — source, install, and tool reference
4 changes: 4 additions & 0 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
"agent-tools/index",
"agent-tools/cloud",
"agent-tools/partner-mcp",
"agent-tools/local",
"agent-tools/comfy-cli"
]
},
Expand Down Expand Up @@ -2812,6 +2813,7 @@
"zh/agent-tools/index",
"zh/agent-tools/cloud",
"zh/agent-tools/partner-mcp",
"zh/agent-tools/local",
"zh/agent-tools/comfy-cli"
]
},
Expand Down Expand Up @@ -5546,6 +5548,7 @@
"ja/agent-tools/index",
"ja/agent-tools/cloud",
"ja/agent-tools/partner-mcp",
"ja/agent-tools/local",
"ja/agent-tools/comfy-cli"
]
},
Expand Down Expand Up @@ -8364,6 +8367,7 @@
"ko/agent-tools/index",
"ko/agent-tools/cloud",
"ko/agent-tools/partner-mcp",
"ko/agent-tools/local",
"ko/agent-tools/comfy-cli"
]
},
Expand Down
38 changes: 18 additions & 20 deletions ja/agent-tools/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@ title: "Agent Tools / MCP"
description: "Model Context Protocol (MCP) を使用して AI エージェントを ComfyUI に接続し、画像、動画、オーディオ、3D コンテンツを生成します。"
sidebarTitle: "概要"
icon: "robot"
translationSourceHash: a3644228
translationSourceHash: 1d8d589d
translationFrom: agent-tools/index.mdx
translationBlockHashes:
"_intro": 0fa0cdc1
"Which One Should I Use?": b4ba859d
"What about local ComfyUI?": 998a5729
"_intro": de00d389
"Which One Should I Use?": fa16d052
"What about local ComfyUI?": 26614358
"What is MCP?": bb62fbe5
---


ComfyUI は **MCP サーバー** と **Comfy CLI** を提供しているので、AI エージェントや開発者は、常に ComfyUI キャンバスを開かなくても、画像、動画、オーディオ、3D コンテンツを生成できます。

<Note>
Expand All @@ -26,6 +25,9 @@ ComfyUI は **MCP サーバー** と **Comfy CLI** を提供しているので
<Card title="Comfy Partner MCP" icon="plug" href="/ja/agent-tools/partner-mcp">
Comfy Partner-Node SDK を使用したローカル MCP サーバー。30以上のパートナープロバイダーに対応する統一された <code>generate_image</code>、<code>generate_video</code>、<code>generate_3d</code> などのツールを提供します。
</Card>
<Card title="Comfy Local MCP" icon="server" href="/ja/agent-tools/local">
公式のローカル MCP サーバーです。<code>comfy-cli</code> を使用して <strong>お使いの</strong> ComfyUI インストールを操作し、実際にマシンにあるノードやモデルを確認しながらワークフローを実行できます。<em>早期プレビュー。</em>
</Card>
<Card title="Comfy CLI" icon="terminal" href="/ja/agent-tools/comfy-cli">
<code>comfy generate</code> の短いエージェント向け概要。完全な CLI ガイドは [はじめに](/ja/comfy-cli/getting-started) をご覧ください。
</Card>
Expand All @@ -35,28 +37,24 @@ ComfyUI は **MCP サーバー** と **Comfy CLI** を提供しているので

## どちらを使うべき?

| | Comfy Cloud MCP | Comfy Partner MCP | Comfy CLI |
|---|---|---|---|
| **タイプ** | リモート(ホスト型) | ローカル MCP サーバー | ローカル CLI |
| **必要条件** | Comfy Cloud サブスクリプション | [Comfy APIキー](/ja/development/api-development/getting-an-api-key) | [Comfy APIキー](/ja/development/api-development/getting-an-api-key) |
| **モデル** | Comfy Cloud モデル(プリインストール済み) | 30以上のパートナープロバイダー(BFL、Ideogram、Kling、Runway、Veo、ElevenLabs など) | `comfy generate` によるパートナーノード |
| **ワークフロー** | 完全な ComfyUI ワークフロー実行 | パートナーAPI生成(カスタムワークフローなし) | 単発のパートナーAPI呼び出し(ワークフローJSON不要) |
| **GPU** | Cloud GPU(ローカル GPU 不要) | GPU不要(APIベース) | GPU不要(APIベース) |
| **最適な用途** | チャット駆動のエージェント、テンプレート検索 | プロバイダー間の統一MCPツール | スクリプト、CI、バッチジョブ |
| | Comfy Cloud MCP | Comfy Partner MCP | Comfy Local MCP | Comfy CLI |
|---|---|---|---|---|
| **タイプ** | リモート(ホスト型) | ローカル MCP サーバー | ローカル MCP サーバー | ローカル CLI |
| **必要条件** | Comfy Cloud サブスクリプション | [Comfy APIキー](/ja/development/api-development/getting-an-api-key) | ローカル ComfyUI + [comfy-cli](https://github.com/Comfy-Org/comfy-cli) | [Comfy APIキー](/ja/development/api-development/getting-an-api-key) |
| **モデル** | Comfy Cloud モデル(プリインストール済み) | 30以上のパートナープロバイダー(BFL、Ideogram、Kling、Runway、Veo、ElevenLabs など) | あなたのローカルモデルとカスタムノード | `comfy generate` によるパートナーノード |
| **ワークフロー** | 完全な ComfyUI ワークフロー実行 | パートナーAPI生成(カスタムワークフローなし) | 完全なローカル ComfyUI ワークフロー実行 | 単発のパートナーAPI呼び出し(ワークフローJSON不要) |
| **GPU** | クラウド GPU(ローカル GPU 不要) | GPU不要(APIベース) | あなたのローカル GPU | GPU不要(APIベース) |
| **最適な用途** | チャット駆動のエージェント、テンプレート検索 | プロバイダー間の統一MCPツール | チャットから自分のローカル ComfyUI を操作 | スクリプト、CI、バッチジョブ |

---

## ローカルのComfyUIは?

多くの方が、Comfy Cloud MCP の代わりに(または併用して)**ローカル**の ComfyUI インストールをエージェントで操作することについて質問されます。

**なぜ Comfy Cloud MCP が先にリリースされたのですか?** `cloud.comfy.org` のホスト型サーバーは、Comfy チームだけが構築し運用できるものです。そのため、当社のファーストパーティ MCP リリースはクラウドベースになりました。

**ローカルエージェントは新しいものではありません。** エージェントを自分のマシンの ComfyUI に接続することは、ComfyUI がオープンソース化されて以来可能でした。ローカルサーバーを実行すると、MCP ブリッジや他のツールが呼び出すことができるワークフローと API が公開されます。
エージェントを使って(Comfy Cloud MCP の代わりに、または併用して)**ローカル**の ComfyUI インストールを操作したいですか? Comfy は現在、ファーストパーティのオプションを提供しています。

**より優れたローカルエージェントの UX はロードマップに含まれています。** ファーストパーティのローカルエージェントエクスペリエンスの向上は、私たちのビジョンの一部です。Cloud MCP は最初にリリースできる部分でした。今後、さらなるローカル機能の改良が続きます
**Comfy Local MCP(ファーストパーティ)。** [**comfy-local-mcp**](https://github.com/Comfy-Org/comfy-local-mcp) は公式のローカル MCP サーバーです。[comfy-cli](https://github.com/Comfy-Org/comfy-cli) のシンプルなラッパーで、AI エージェントが**あなた自身の** ComfyUI でワークフローを実行し、インストールされているノード、カスタムノード、モデルを確認できるようにします。**早期プレビュー**です。セットアップとクライアント設定については [**Comfy Local MCP**](/ja/agent-tools/local) をご覧ください

**現在試用できるコミュニティ MCP サーバー** いくつかのコミュニティプロジェクトがすでに MCP クライアントをローカルの ComfyUI インスタンスに接続しています:
**コミュニティ MCP サーバー** いくつかのコミュニティプロジェクトも MCP クライアントをローカルの ComfyUI インスタンスに接続しています:

| プロジェクト | リポジトリ |
| --- | --- |
Expand Down
Loading
Loading