> ## Documentation Index
> Fetch the complete documentation index at: https://comfyreel.org/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP 服务器

> 让 ComfyReel Agent 或任何本地 MCP 客户端读取并编辑画布。

ComfyReel 通过 HTTP 提供一个 [MCP](https://modelcontextprotocol.io) 服务器。内置的 [ComfyReel Agent](https://comfyreel.org/zh/guides/agent.md)就用它，你也可以接入任何其他本地 MCP 客户端，例如终端里的 Claude Code 或 Codex。

## 开启

在 ComfyReel Agent 全局设置里勾选 **开启 MCP：允许 Agent 读写画布**。接口地址：

```
POST http://127.0.0.1:8188/comfyreel/mcp?project=<project-id>
```

项目 id 就是 ComfyReel 网址里的 `project` 参数。画布工具由该项目打开着的 ComfyReel 标签页执行，没有打开时会超时。

Claude Code 的接入方式：

```bash theme={null}
claude mcp add --transport http comfyreel "http://127.0.0.1:8188/comfyreel/mcp?project=<project-id>"
```

## 工具

| 分组 | 工具 |
| - | - |
| 查看 | `server_info`、`get_canvas`、`view_nodes`、`list_models`、`focus` |
| 搭建 | `add_node`（text、image、video、audio、script、edit；`url` 可把对话里上传的附件放成图片、视频或音频节点）、`update_node`、`connect`、`delete_nodes`、`group_nodes` |
| 生成 | `run_nodes`、`wait_nodes`、`apply_tool`（高清、抠图、扩图、多角度、打光、全景、图层分离、场景预设、视频高清、音视频分离、静音、截取、音轨分离、去字幕、主体消除、改文字） |
| 剧本 | `create_script`、`script_action`（准备资产、生成分镜、视频、配音）、`read_screenplay`、`write_screenplay` |
| 智能剪辑 | `assemble_cut`（按镜头顺序拼剧本的视频，带配音、配乐和转场）、`get_timeline`、`edit_timeline`、`add_subtitles`、`add_transition` |
| 视频分析 | `analyze_video`（镜头切换和联系表）、`extract_frames` |
| 3D 导演台 | `director_apply`（角色、道具、机位、环境、动画、截图、录制）、`director_code` |
| 主体库与工作区 | `subjects`、`canvases`（列出、读取、搜索和新建画布，提供打开卡片）、`list_files`、`read_file`、`write_file` |
| 自定义工作流 | `custom_workflow`（检查 API 格式工作流的标记，并为某个功能安装它） |
| 对话 | `plan`（步骤可列出节点）、`suggest_prompts`、`episode_check`、`handoff`、`run_subagents` 和 `ask_user`（后两个只在 ComfyReel Agent 对话中可用；`ask_user` 可以问一个问题，也可以用 `questions[]` 一次问最多 8 个，选择题或填空均可） |

`run_nodes` 和 `apply_tool` 会立即返回；用相同的 id 调用 `wait_nodes`，再用 `view_nodes` 检查结果。关闭自动生成时，会发起生成的工具会先在 ComfyReel Agent 对话里请求你确认；`run_nodes` 可以逐个节点过目、改提示词或跳过。ComfyReel Agent 设置里的 **外部 MCP 客户端可直接生成** 开启时（默认），对话以外的客户端也能直接生成。

> [!NOTE]
>
> MCP 服务器是你本地 ComfyUI 的一部分，自身没有登录机制。任何能访问你 ComfyUI 端口的人都能使用它，所以开启 MCP 时请让 ComfyUI 只监听本机或可信网络。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.