wechat-writer-mcp
Integrates with WeChat Official Account API to manage drafts: import raw content (Markdown or URLs), format for WeChat, estimate originality, and save drafts to the WeChat draft box, without auto-publishing.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@wechat-writer-mcp Import blog.md, format for WeChat, check originality, save draft"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
wechat-writer-mcp
面向技术博主的 AI 内容加工流水线 MCP —— 从原始素材到公众号草稿箱,只存草稿,不自动发布。
⚡ 快速开始
一键启动
npx wechat-writer-mcpMCP 配置
{
"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,帮我排版成公众号格式,检查原创度后存入草稿箱"Related MCP server: Wenyan MCP Server
🛠️ 核心功能
4 个专业工具 - 导入素材、智能排版、原创检测、存入草稿箱
官方 API - 基于微信公众号草稿箱 API,完全合规
内容加工 - 段落切分、代码块处理、超链接转脚注、头尾模板、标题候选
安全第一 - 永远只存草稿箱,永远不自动群发/发布
即插即用 - 支持 Claude Code、Cursor、Claude Desktop
📦 工具列表
工具 | 说明 | 输入 | 输出 |
| 导入原始内容 | 本地 markdown 文件或网页 URL | raw_markdown + 标题/字数等元数据 |
| 公众号智能排版 | markdown 内容 | 适配 HTML + 3 个标题候选 + 摘要建议 |
| 原创度自评 | 文章内容 | 原创度评分 + 与历史草稿的相似段落 |
| 存入草稿箱 | 标题 + 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 直接运行(推荐)
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变量 | 必填 | 说明 |
| ✅ | 公众号 AppID |
| ✅ | 公众号 AppSecret |
| 封面图片目录,默认 | |
| 默认作者名 | |
| API 超时毫秒数,默认 15000 |
前置条件
公众号 AppID/AppSecret:mp.weixin.qq.com → 开发 → 基本配置
IP 白名单:将你的出口 IP 添加到公众号后台 → 开发 → 基本配置 → IP 白名单
客户端配置
在 ~/.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"
}
}
}
}⚠️ 注意事项
安全:AppSecret 永远不要提交到 Git,
.env已在.gitignore中权限:只调用
draft/add,永远不调用freepublish/submit或mass/send查重:
estimate_originality只与你自己的历史草稿比对,不能替代微信官方查重封面:默认从
~/Pictures/wechat-covers/随机选取,无封面时自动生成占位图模板:可自定义
templates/wechat-header.html和templates/wechat-footer.html
🗺️ Roadmap
v0.1 - MVP:4 个核心 tool + 公众号草稿箱 API
自定义排版主题
封面图片 AI 推荐
掘金同步发布(v2)
发布后数据反馈
多标题 A/B 建议
🤝 贡献
欢迎提 Issue 和 PR。
git clone https://github.com/datoushiwo/wechat-writer-mcp.git
cd wechat-writer-mcp
npm install
npm run dev # 开发模式📄 License
MIT
让 AI 帮你搞定公众号排版,你只管写内容。 ✍️
Available Tools
4 toolsestimate_originalityA
对内容做原创度自评,辅助决策是否点"原创"标记。基于用户自己的历史草稿做比对,不能替代微信官方查重。
Inputs: content (required), check_against_history.
import_sourceA
导入原始内容(本地 markdown 文件或 URL 网页),准备进行公众号加工。返回 raw_markdown 和元数据。
Inputs: source_type (required), url, path.
save_to_wechat_draftA
将加工好的内容存入公众号草稿箱。永远只存草稿,不会自动群发/发布。存入后需手动到公众号后台发布。
Inputs: title (required), html_content (required), author, digest, +5 more.
transform_for_wechatA
将 markdown 内容转换为公众号适配的 HTML 格式。自动段落切分、代码块处理、超链接转脚注、添加头尾模板,并生成 3 个标题候选。
Inputs: raw_markdown (required), title, apply_template.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a distinct purpose: importing source content, transforming it for WeChat, checking originality, and saving as draft. No functional overlap exists.
All tools follow a consistent verb_noun snake_case pattern (estimate_originality, import_source, transform_for_wechat, save_to_wechat_draft).
Four tools cover the end-to-end workflow of preparing a WeChat article without superfluous or missing pieces, appropriate for the focused domain.
The set covers the core cycle of import, transform, originality check, and save. Minor gaps like listing/editing existing drafts are absent but not critical for the primary use case.
Related MCP Connectors
Draft, edit, organise, schedule and publish a Writavo Site's content from any AI assistant.
Get content approved & published faster: draft, send approval links and publish from your AI chat.
Draft social posts from your AI assistant; schedules or publishes only after you confirm.
Draft, schedule, and analyze content for Substack, Medium, LinkedIn, X, Bluesky, and Threads.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables saving articles to WeChat Official Account drafts with support for rich text, automatic image upload, and Markdown rendering including Mermaid diagrams.1MIT
- AlicenseNot gradedqualityBmaintenanceBridges AI writing and content platforms by enabling AI agents to format Markdown and publish posts directly to WeChat Official Accounts with automatic image handling. It supports conversational theme management and streamlined drafting to eliminate the need for manual copy-pasting between editors.93 npm1,357Apache 2.0
- AlicenseAqualityFmaintenanceEnables AI agents to publish articles to WeChat Official Account (微信公众号). Supports image upload, draft creation, and publishing via standardized MCP protocol.51ISC
- AlicenseAqualityDmaintenanceEnables publishing HTML articles and image messages to WeChat Official Account drafts via LLM tool calls, with automatic image upload and URL replacement.51MIT