内容
cp-pro 📱
> 最完整的 **Post for Me** MCP 服务器 — 在任意 MCP 客户端上发布、调度、编辑、删除和分析社交媒体帖子,支持 **9 个平台**。
[](https://www.npmjs.com/package/postforme-mcp-pro)
[
[](https://github.com/helbertparanhos/postforme-mcp-pro/stargazers)
[](https://github.com/helbertparanhos/postforme-m/network/members)
[](https://github.com/helbertparanhos/postforme-mcp-pro/issues)
[
[](https://www.typescriptlang.org/)
[](https://nodejs.org/)
[](https://modelcontextprotocol.io/)
[](https://claude.ai/code)
[](https://cursor.sh)
[](https://claude.ai/download)
[](https://www.instagram.com/helbertparanhos)
[](https://www.youtube.com/@stratacademy)
[](https://www.linkedin.com/in/helbert-paranhos/)
[](https://buymeacoffee.com/helbertparanhos)
[](https://stratacademy.com`postforme-mcp-pro` 封装了 [Post forhttps://www.postforme API,提供 **27+ MCP 工具**(每个操作一个工具),以及一个forme_raw` 出口和只读安全模式。与官方 MCP 不同,官方 MCP 只提供文档搜索和沙盒代码执行工具(模式”),而这里操作都是一个一流直接调用的工具,因此发布、调度、拉结果,而无需编写 SDK的平台: · Facebook · TikTok · · X · LinkedIn Bluesky · Threads 为什么选择这个服务器
27+ 类型工具**_post`、`schedule_post`、`publish_now`、`create_draft`、`upload_media`、`list_account_feeds`、`list_post_results`,账户和 webhook 管理等。
- **高级快捷方式** — `publish_now` / `schedule_post` / `create_draft` / `reschedule_post` / `upload_media` 将常见的多步骤流程合并为。
- **一步** — `upload接受本地文件路径,获取签名 URL字节,然后返回一个可 `media_url`。
每个平台的调整**platform_configurations` 模拟 Instagram Reels、X polls、TikTok 隐私、YouTube 可见性等,并对宽容。
- **只读安全模式** — `POSTFORME_READONLY=true` 阻止所有写入;适用于仅分析会话。
- **`postforme_raw`** — 调用任何端点以获得 100% 的 API 覆盖率,即使是全新端点。
- **弹性客户端** — Bearer 身份验证,429/5xx 报错重试,带有回退,错误消息可操作。
## 安装
```bash
npm install
npm run build
```
或在发布后直接运行(无需克隆):
```bash
npx postforme-mcp-pro
```
## 配置
复制 `.` → `.env`您的密钥:
| 变量 | 必需 | 描述 |
| --- | --- | --- |
| `POSTFORME_API_KEY` | ✅ | 您的 Post for Me API 密钥(仪表盘 → 设置 → API 密钥)。 |
| `POSTFORME_BASE_URL` | — | 自托管/开源部署的 API 基本 URL。默认为 `https://api.postforme.dev`。 |
| `POSTFORME_READONLY` | — | `true` 阻止所有写入工具(仅读取 + `postforme_raw` GET 请求)。 |
| `POSTFORME_DISABLE_RAW` | — | `true` 删除 `postforme_raw` 工具。 |
| `POSTFORME_TIMEOUT_MS` | — | 每个请求的超时时间(默认为 `60000`)。 |
| `POSTFORME_MAX_RETRIES` | — | 429/5xx/网络错误的最多重试次数(默认为 `3`)。 |
## 本地测试
```npx @modelcontextprotocol/inspector node dist/index.js
```
## 添加到 Claude Code
`.claude/settings.json` → `mcpServers`:
```json
"postforme": {
"command": "node",
"args": ["projects/postforme-mcp-pro/dist/index.js"],
"env": { "POSTFORME_API_KEY": "pfm_xxx" }
}
```
## 添加到 Claude 桌面版
`%APPDATA%\Claude\claude_desktop_config.json`(Windows)/ `~/Library/Application Support/Claude/claude_desktop_config.json`(macOS):
```json
"postforme": {
"command": "node",
"args": ["/abs/path/projects/postforme-mcp-pro/dist/index.js"],
"env": { "POSTFORME_API_KEY": "pfm_xxx" }
}
```
Cursor 在其 MCP 文件中使用相同的配置格式。
## 工具
### 社交账户
| 工具 | 描述 |
| --- | --- |
| `list_social_accounts` | 列出连接的账户(按平台/用户名过滤)。 |
| `get_social_account` | 按 ID 获取一个账户。 |
| `create_social_account` | 通过提供凭证连接账户。 |
| `update_social_account` | 更新存储的凭证/元数据。 |
| `create_auth_url` | 启动 OAuth 连接流程(返回 URL)。 |
| `disconnect_social_account` | 撤销账户的访问权限。 |
| `list_account_feeds` | **分析:** 账户的最新动态 + 参与度指标。 |
### 帖子
| 工具 | 描述 |
| --- | --- |
| `create_post` | 在账户之间创建帖子(现在发布、调度或草稿)。 |
| `publish_now` | 快捷方式:立即发布。 |
| `schedule_post` | 快捷方式:调度到 ISO-8601 时间。 |
| `create_draft` | 快捷方式:保存为草稿。 |
| `get_post` | 按 ID 获取帖子。 |
| `list_posts` | 列出帖子(按状态过滤)。 |
| `update_post` | 编辑标题/媒体/账户/调度/配置。 |
| `reschedule_post` | 快捷方式:更改调度时间。 |
| `delete_post` | 删除帖子。 |
### 结果和预览
| 工具 | 描述 |
| --- | --- |
| `list_post_results` | **分析:** 每个平台的发布结果。 |
| `get_post_result` | 按 ID 获取一个帖子结果。 |
| `create_post_preview` | 预览帖子在每个平台上的显示效果。 |
### 媒体
| 工具 | 描述 |
| --- | --- |
| `create_media_upload_url` | 获取签名上传 URL(2 步流程)。 |
| `upload_media` | **一步:** 上传本地文件或远程 URL → 返回 `media_url`。 |
### Webhooks
| 工具 | 描述 |
| --- | --- |
| `list_webhooks` · `get_webhook` · `create_webhook` · `update_webhook` · `delete_webhook` | 管理事件订阅。 |
### 出口
| 工具 | 描述 |
| --- | --- |
| `postforme_raw` | 直接调用任何 `/v1/...` 端点(方法、路径、参数、正文)。 |
## 配套技能
`/postforme`(在 [`skill/SKILL.md`](skill/SKILL.md) 中)将这些工具编排成引导工作流:`post`、`schedule`、`campaign`、`analytics`、`accounts`、`media`。复制到 `.claude/skills/` 中,在 Claude Code 中使用。
## 示例
```
您:使用 ./hero.png 图片在 instagram 和 x 上发布“Lançamos a v2 🚀”
→ list_social_accounts (获取 instagram + x 账户 ID)
→ upload_media { file_path: "./hero.png" } → media_url
→ create_post_preview (可选,确认外观)
→ publish_now { social_accounts: [...], caption: "...", media: [{ url: media_url }] }
→ list_post_results (报告每个平台的成功/链接)
```
## 与官方 MCP 的比较
| | postforme-mcp-pro | 官方 `post-for-me-mcp` |
| --- | --- | --- |
| 工具模型 | **27 个类型工具**,每个操作一个工具 | 2 个工具(文档搜索 + 代码执行沙盒) |
| 调用 | 直接工具调用 | 模型必须在沙盒中编写 SDK 代码 |
| 快捷方式 | `publish_now` / `schedule_post` / `create_draft` / `upload_media` | — |
| 安全 | `POSTFORME_READONLY` 模式 + SSRF/文件读取强化 | — |
| 出口 | `postforme_raw`(任何 `/v1` 端点) | 代码执行 |
| 配套技能 | `/postforme` 引导工作流 | — |
## 安全
`upload_media` 加强了对 SSRF(DNS 解析 + 公共单播 IP 验证,无重定向,大小限制)的远程获取,并将本地文件读取限制为已识别的媒体扩展名(可选到 `POSTFORME_MEDIA_DIR`)。`postforme_raw` 路径已验证,以保持在版本化的 API 接口上。参见 [REVIEW.md](REVIEW.md) 以获取完整审核。
## 许可证
MIT © Helbert Paranhos Academy