Skip to main content
Glama
README.md
# Comfy AE Video Factory MCP

一个用于 AI 短视频自动化流水线的 MCP Server:把 ComfyUI 图生图/图生视频、FFmpeg 后处理、After Effects 模板包装、审核与多平台发布准备串起来。

> 设计目标:让 Cursor / Claude Desktop / ChatGPT MCP 客户端可以调用这些工具,自动完成「生成 → 包装 → 审核 → 导出 → 发布包」的流程。

## 能力

- 调用本地或云端 ComfyUI workflow
- 查询 ComfyUI 任务历史
- 使用 FFprobe 分析视频
- 使用 FFmpeg 转码、裁切、抽帧、拼接
- 生成 AE 自动替换素材 JSX 脚本
- 调用 aerender 渲染 After Effects 模板
- 创建标准化视频生产任务 manifest
- 生成抖音 / 小红书 / B站 / YouTube Shorts / TikTok 发布包配置
- 提供基础内容审核占位接口,便于以后接第三方审核 API

## 安装

```bash
npm install
npm run build
```

## 运行

```bash
npm start
```

## 在 MCP 客户端中配置

```json
{
  "mcpServers": {
    "comfy-ae-video-factory": {
      "command": "node",
      "args": ["/absolute/path/comfy-ae-video-factory-mcp/dist/index.js"],
      "env": {
        "COMFY_LOCAL_URL": "http://127.0.0.1:8188",
        "VIDEO_FACTORY_ROOT": "/absolute/path/workspace",
        "FFMPEG_BIN": "ffmpeg",
        "FFPROBE_BIN": "ffprobe",
        "AERENDER_BIN": "/Applications/Adobe After Effects 2025/aerender"
      }
    }
  }
}
```

Windows 示例:

```json
{
  "AERENDER_BIN": "C:\\Program Files\\Adobe\\Adobe After Effects 2025\\Support Files\\aerender.exe"
}
```

## 推荐工作流

1. `pipeline_create_job` 创建生产任务目录和 manifest
2. `comfy_submit_workflow` 提交 ComfyUI 图生视频 workflow
3. `comfy_get_history` 查询结果
4. `media_probe` 检查视频规格
5. `ffmpeg_transcode` 统一比例、码率、帧率
6. `ae_generate_jsx` 生成 AE 模板替换脚本
7. `ae_render_template` 调用 aerender 输出最终包装视频
8. `review_video_package` 做审核占位
9. `platform_prepare_package` 生成各平台发布包

## AE 模板接入方式

推荐在 AE 工程里预先创建这些占位层:

- `{{MAIN_VIDEO}}`
- `{{TITLE}}`
- `{{SUBTITLE}}`
- `{{LOGO}}`
- `{{CTA}}`

然后用本项目生成的 JSX 替换素材和文字,再通过 aerender 输出。

## 安全说明

这个 MCP Server 会执行本地命令,因此默认限制:

- 所有输入输出文件必须在 `VIDEO_FACTORY_ROOT` 目录下
- FFmpeg 参数走白名单化封装,而不是直接暴露任意 shell
- AE 渲染支持 `dryRun`,建议先测试命令

## GitHub 上传

```bash
git init
git add .
git commit -m "init comfy ae video factory mcp"
git branch -M main
git remote add origin git@github.com:YOUR_NAME/comfy-ae-video-factory-mcp.git
git push -u origin main
```

## 备注

MCP 官方 TypeScript SDK 支持创建 server、注册 tools,并通过 stdio 或 Streamable HTTP 连接 MCP 客户端。这里使用 stdio,适合本地自动化集成。

TDQS

B3.2/5.0

Scored across 9 tools

Disambiguation5/5

Each tool clearly targets a distinct domain: AE scripts vs rendering, ComfyUI submission vs history, media probing vs transcoding, pipeline job creation, platform packaging, and review. No overlapping purposes.

Naming Consistency4/5

Names mostly follow a consistent verb_noun pattern with domain prefixes (ae_, comfy_, ffmpeg_, media_, pipeline_, platform_, review_). The only minor inconsistency is 'media_probe' which reverses the order (noun_verb) compared to others like 'ffmpeg_transcode'.

Tool Count5/5

9 tools cover the key operations for a video factory: AE template generation and rendering, ComfyUI workflow management, media processing, pipeline orchestration, and platform publishing. The count is well-scoped without unnecessary bloat.

Completeness4/5

Covers essential workflows: AE template manipulation, ComfyUI interaction, media transcoding/probing, pipeline job creation, and platform packaging. Minor gap: the review tool is a placeholder, and there is no explicit tool for asset management or user input validation, but core functionality is present.

Maintenance

ActivityInactive
ResponsivenessNo issues