面向技术博主的 AI 内容加工流水线 MCP —— 从原始素材到公众号草稿箱
面向技术博主的 AI 内容加工流水线 MCP —— 从原始素材到公众号草稿箱,只存草稿,不自动发布。
npx wechat-writer-mcp
{
"mcpServers": {
"wechat-writer": {
"command": "npx",
"args": ["wechat-writer-mcp"],
"env": {
"WECHAT_APP_ID": "your_app_id",
"WECHAT_APP_SECRET": "your_app_secret"
}
}
}
}
AI指令: "导入 ./my-article.md,帮我排版成公众号格式,检查原创度后存入草稿箱"
| 工具 | 说明 | 输入 | 输出 |
|---|---|---|---|
import_source | 导入原始内容 | 本地 markdown 文件或网页 URL | raw_markdown + 标题/字数等元数据 |
transform_for_wechat | 公众号智能排版 | markdown 内容 | 适配 HTML + 3 个标题候选 + 摘要建议 |
estimate_originality | 原创度自评 | 文章内容 | 原创度评分 + 与历史草稿的相似段落 |
save_to_wechat_draft | 存入草稿箱 | 标题 + HTML 内容 | media_id + 后台链接 |
用户: 导入 ./my-article.md
AI: [调 import_source] 已读入 838 字 markdown
标题识别:《我用 Claude Code 三周做了一个 MCP Server》
用户: 帮我按公众号风格排版
AI: [调 transform_for_wechat]
- 代码块已处理为公众号可显示格式
- 已应用头尾模板
- 3 个标题候选:
1. 我用 Claude Code 三周做了一个 MCP Server
2. 我用 Claude Code 三周做了一个 MCP Server:完整实践指南
3. 一文读懂我用 Claude Code 三周做了一个 MCP Server
要哪个?
用户: 用 1,检查下原创度
AI: [调 estimate_originality]
深度原创(92/100)
建议:可以标记"原创"
历史比对:无重复内容
用户: OK 存草稿箱
AI: [调 save_to_wechat_draft]
✅ 已存入公众号草稿箱
→ 请前往 mp.weixin.qq.com → 内容管理 → 草稿箱 手动发送
npx wechat-writer-mcp
git clone https://github.com/datoushiwo/wechat-writer-mcp.git
cd wechat-writer-mcp
npm install
npm run build
cp .env.example .env
| 变量 | 必填 | 说明 |
|---|---|---|
WECHAT_APP_ID | ✅ | 公众号 AppID |
WECHAT_APP_SECRET | ✅ | 公众号 AppSecret |
WECHAT_COVERS_DIR | 封面图片目录,默认 ~/Pictures/wechat-covers | |
WECHAT_DEFAULT_AUTHOR | 默认作者名 | |
WECHAT_API_TIMEOUT | API 超时毫秒数,默认 15000 |
在 ~/.claude/mcp.json 或项目下 .claude/mcp.json 中添加:
{
"mcpServers": {
"wechat-writer": {
"command": "npx",
"args": ["wechat-writer-mcp"],
"env": {
"WECHAT_APP_ID": "your_app_id",
"WECHAT_APP_SECRET": "your_app_secret"
}
}
}
}
在 Cursor Settings → MCP 中添加,配置同上。
编辑 ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"wechat-writer": {
"command": "npx",
"args": ["wechat-writer-mcp"],
"env": {
"WECHAT_APP_ID": "your_app_id",
"WECHAT_APP_SECRET": "your_app_secret"
}
}
}
}
.env 已在 .gitignore 中draft/add,永远不调用 freepublish/submit 或 mass/sendestimate_originality 只与你自己的历史草稿比对,不能替代微信官方查重~/Pictures/wechat-covers/ 随机选取,无封面时自动生成占位图templates/wechat-header.html 和 templates/wechat-footer.html欢迎提 Issue 和 PR。
git clone https://github.com/datoushiwo/wechat-writer-mcp.git
cd wechat-writer-mcp
npm install
npm run dev # 开发模式
MIT
让 AI 帮你搞定公众号排版,你只管写内容。 ✍️
Source-derived launch command. Check the maintainer’s required arguments and credentials before running:
npx -y wechat-writer-mcpMerge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.
{
"mcpServers": {
"io-github-datoushiwo-wechat-writer-mcp": {
"command": "npx",
"args": [
"-y",
"wechat-writer-mcp"
]
}
}
}Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the client’s tool list, then try a read-only example from its documentation.
Claude Desktop setup referencewechat-writer-mcpnpmio.github.datoushiwo/wechat-writer-mcp works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.
~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.~/.cursor/mcp.jsonRestart Cursor for changes to take effect..vscode/mcp.jsonReload VS Code window for changes to take effect.~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect..mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.