Social Publisher MCP
# Social Publisher MCP
Social Publisher MCP 是一个用于多平台内容自动发布的本地 MCP 服务。它把内容准备、素材校验、平台登录检查、发布确认和发布执行封装成标准工具,供 Codex、Claude、Cursor、自研 Agent 或任何支持 MCP/stdio 的智能体调用。
项目目标是让智能体可以在用户确认后,安全、统一地完成短视频和图文内容的多平台发布。
## 功能
- 多平台发布内容准备与字段适配
- 视频、图片等本地素材路径校验
- 平台登录和登录状态检查
- 发布前确认机制,避免误发
- 本地发布记录和状态查询
- 支持 Codex、其他通用智能体以及自己构建的智能体通过 MCP 调用
当前支持的平台包括:
- 抖音
- 小红书 / Rednote
- 快手
- Bilibili
- 视频号
- YouTube
不同平台的可用能力取决于本地配置和适配器接入情况。
## 适用场景
- 让 Codex 帮你准备并发布视频或图文内容
- 在自己的 Agent 工作流中统一接入多平台发布能力
- 将内容生产脚本、运营后台或自动化流水线接入 MCP 发布服务
- 为自建智能体提供标准化的社交媒体发布工具
## 安装
```powershell
npm install
npm run build
```
如果需要使用 Python 相关的平台适配能力,建议使用 Python 3.10-3.12。Windows 用户可以通过 conda 创建独立环境:
```powershell
conda create -n social-publisher python=3.12
conda activate social-publisher
```
## 配置
复制示例配置文件:
```powershell
Copy-Item .env.example .env
```
然后根据自己的平台账号、浏览器路径和运行环境修改 `.env`。
常见配置项包括:
```env
SOCIAL_PUBLISHER_DOUYIN_ENGINE=sau
SOCIAL_PUBLISHER_DOUYIN_ACCOUNT=creator
SOCIAL_PUBLISHER_PYTHON_BIN=C:\Path\To\python.exe
SAU_LOCAL_CHROME_PATH=C:\Program Files\Google\Chrome\Application\chrome.exe
SAU_LOCAL_CHROME_HEADLESS=false
```
首次使用前,建议先完成对应平台登录,并使用备用账号验证发布流程。
## 在 Codex 中使用
构建完成后,将 MCP server 配置为启动本项目的 `dist/index.js`:
```json
{
"mcpServers": {
"social-publisher": {
"command": "node",
"args": [
"D:\\path\\to\\social-publisher-mcp\\dist\\index.js"
]
}
}
}
```
把路径替换成你本机的项目路径即可。配置完成后,Codex 就可以调用本项目提供的 MCP 工具完成登录检查、内容准备和发布。
## 在自建智能体中使用
任何支持 MCP stdio 的智能体或应用都可以启动这个服务:
```powershell
node dist/index.js
```
启动后,通过 MCP 协议调用工具即可。典型流程是:
1. 调用 `list_platforms` 查看平台能力。
2. 调用 `login_platform` 或 `check_platform_auth` 完成登录检查。
3. 调用 `prepare_post` 准备发布内容。
4. 向用户展示平台、账号、标题、素材、标签等发布摘要。
5. 用户确认后调用 `publish_post` 执行发布。
6. 调用 `check_publish_status` 查询发布记录。
## MCP 工具
- `list_platforms`:查看支持的平台和适配器状态
- `login_platform`:启动平台登录流程
- `check_platform_auth`:检查平台登录状态
- `prepare_post`:校验内容并生成平台发布参数
- `publish_post`:在用户确认后执行发布
- `check_publish_status`:查询本地发布记录和状态
## 本地开发
```powershell
npm install
npm run check
npm run build
npm run dev
```
## 安全说明
- 发布前应由用户明确确认平台、账号、标题、素材、标签和发布时间。
- 不要把账号 Cookie、Token、密钥或本地登录数据提交到 Git。
- 首次接入新平台时,建议先使用备用账号验证完整流程。
- 使用自动化发布能力时,请遵守各平台服务条款、内容规范和账号安全要求。
## License
MIT
TDQS
Scored across 6 tools
Each tool targets a distinct aspect of the social publishing workflow: platform enumeration, auth management, post preparation, publishing, and status retrieval. Even the two auth-related tools are clearly separated by their actions (starting a login vs. checking existing auth state).
All tool names follow a consistent verb_noun pattern in snake_case (list_platforms, login_platform, check_platform_auth, prepare_post, publish_post). The slight variation in check_publish_status still adheres to the same style and is easily readable.
With six tools, the server is well-scoped for its purpose, covering the essential operations of platform discovery, authentication, post preparation, publishing, and status checking without unnecessary redundancy or bloat.
The core lifecycle is covered: login/check auth, prepare, publish, and check status. Minor gaps exist, such as no logout or auth refresh operation and no list of previously published posts, but these are not critical to the main publishing workflow and can be worked around.