Skip to main content
Glama
README.md
# sau-mcp

基于 [social-auto-upload](https://github.com/dreammis/social-auto-upload) 的 `sau` CLI,封装成 [MCP](https://modelcontextprotocol.io/) 服务,供 Cursor 等 AI 客户端调用。

**调用方法与目录说明 → [docs/MCP_API.md](./docs/MCP_API.md)**

支持:抖音 / 快手 / 小红书 / Bilibili 的 Cookie 校验与视频(图文)发布。不实现浏览器自动化本身,只做薄封装。

## 前置条件

1. 本机已安装并可运行 `social-auto-upload`(见上游文档)。
2. 在真实终端登录一次(不要走 MCP):

```powershell
sau douyin login --account <account>
sau douyin check --account <account>
```

## 安装 sau-mcp

```powershell
cd <SAU_MCP_ROOT>
python -m venv .venv
.venv\Scripts\activate
python -m pip install -e .
```

若已安装 `uv`,也可用 `uv venv` + `uv pip install -e .`。

## 环境变量

| 变量 | 说明 |
|------|------|
| `SAU_CMD` | `sau` 可执行文件路径(已在 PATH 时可省略) |
| `SAU_CWD` | `social-auto-upload` 仓库根目录 |
| `SAU_TIMEOUT` | 子进程超时秒数(默认 `600`) |

复制 `.env.example`,按本机路径填写。**不要把真实路径或账号名提交进仓库。**

## 本地运行(stdio)

```powershell
$env:SAU_CWD="<SAU_ROOT>"
$env:SAU_CMD="<SAU_ROOT>/.venv/Scripts/sau.exe"
python -m sau_mcp.server
```

## Cursor MCP 配置

参考 [cursor-mcp.example.json](./cursor-mcp.example.json),把占位符换成你的本机路径,再合并到 Cursor 的 MCP 设置或项目 `.cursor/mcp.json`。

保存后重启 Cursor / 刷新 MCP。

## MCP 工具

| 工具 | 作用 |
|------|------|
| `sau_health` | 检查 `sau --help` 与环境路径 |
| `douyin_check` | 抖音 Cookie 是否有效 |
| `douyin_upload_video` | 发布抖音视频 |
| `douyin_upload_note` | 发布抖音图文 |
| `kuaishou_*` / `xiaohongshu_*` / `bilibili_*` | 其他平台 |

登录(扫码 / 短信)**不**通过 MCP 暴露,需在本机终端执行。

## 对接 n8n

n8n 建议用 Execute Command 直接调 `sau`;MCP 面向 AI 客户端。

```powershell
sau douyin upload-video --account <account> --file <VIDEO_PATH> --title "<title>"
```

## 说明

- 上传在 MCP 所在机器上跑浏览器自动化。
- Cookie 会过期,发布前先 `douyin_check`。
- 属于模拟客户端发布,存在平台风控风险,请自行评估。

TDQS

B3.4/5.0

Scored across 10 tools

Disambiguation5/5

Each tool is uniquely identified by platform (douyin, kuaishou, xiaohongshu, bilibili) and action (check, upload_video, upload_note). No two tools overlap in purpose; check tools validate cookies while upload tools publish content.

Naming Consistency5/5

All tools follow a consistent pattern of platform_action (e.g., kuaishou_upload_video, bilibili_check), with douyin_upload_note as a logical variant. The utility sau_health also uses snake_case and fits the naming scheme.

Tool Count5/5

10 tools serve four platforms, each with a check and upload video action, plus an extra Douyin note upload and a health check. This is well-scoped and not excessive for the apparent purpose.

Completeness4/5

Core functionality (cookie validation and video upload) is covered for all platforms, and Douyin additionally supports image notes. Minor gaps exist, such as no note upload for other platforms and no management operations (list/delete), but these are not critical for the upload-focused domain.

Maintenance

ActivityStale
ResponsivenessNo issues