Back to Browse

Wechat Writer MCP Server

Developer ToolsUse Caution4.2MCP RegistryLocal
Free

Server data from the Official MCP Registry

面向技术博主的 AI 内容加工流水线 MCP —— 从原始素材到公众号草稿箱

About

面向技术博主的 AI 内容加工流水线 MCP —— 从原始素材到公众号草稿箱

Security Report

4.2
Use Caution4.2High Risk

This MCP server for WeChat content management is well-structured with appropriate security controls. Authentication is properly implemented via environment variables, and the server correctly restricts itself to draft operations only. Minor code quality issues around input validation and error handling exist but do not pose significant security risks. Permissions align well with the stated purpose of content transformation and draft management. Supply chain analysis found 8 known vulnerabilities in dependencies (1 critical, 3 high severity). Package verification found 1 issue.

7 files analyzed · 15 issues found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

Permissions Required

This plugin requests these system permissions. Most are normal for its category.

env_vars

Check that this permission is expected for this type of plugin.

HTTP Network Access

Connects to external APIs or services over the internet.

File System Read

Reads files on your machine. Normal for tools that analyze or process local data.

File System Write

Writes or modifies files on your machine. Check that this is expected for the tool.

What You'll Need

Set these up before or after installing:

微信公众号 AppID(mp.weixin.qq.com → 开发 → 基本配置)Optional

Environment variable: WECHAT_APP_ID

微信公众号 AppSecret(mp.weixin.qq.com → 开发 → 基本配置)Required

Environment variable: WECHAT_APP_SECRET

封面图片目录,默认 ~/Pictures/wechat-coversOptional

Environment variable: WECHAT_COVERS_DIR

草稿默认作者名Optional

Environment variable: WECHAT_DEFAULT_AUTHOR

微信 API 超时毫秒数,默认 15000Optional

Environment variable: WECHAT_API_TIMEOUT

How to Install

Add this to your MCP configuration file:

{
  "mcpServers": {
    "io-github-datoushiwo-wechat-writer-mcp": {
      "env": {
        "WECHAT_APP_ID": "your-wechat-app-id-here",
        "WECHAT_APP_SECRET": "your-wechat-app-secret-here",
        "WECHAT_COVERS_DIR": "your-wechat-covers-dir-here",
        "WECHAT_API_TIMEOUT": "your-wechat-api-timeout-here",
        "WECHAT_DEFAULT_AUTHOR": "your-wechat-default-author-here"
      },
      "args": [
        "-y",
        "wechat-writer-mcp"
      ],
      "command": "npx"
    }
  }
}

Documentation

View on GitHub

From the project's GitHub README.

wechat-writer-mcp

面向技术博主的 AI 内容加工流水线 MCP —— 从原始素材到公众号草稿箱,只存草稿,不自动发布

⚡ 快速开始

一键启动

npx wechat-writer-mcp

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,帮我排版成公众号格式,检查原创度后存入草稿箱"

🛠️ 核心功能

  • 4 个专业工具 - 导入素材、智能排版、原创检测、存入草稿箱
  • 官方 API - 基于微信公众号草稿箱 API,完全合规
  • 内容加工 - 段落切分、代码块处理、超链接转脚注、头尾模板、标题候选
  • 安全第一 - 永远只存草稿箱,永远不自动群发/发布
  • 即插即用 - 支持 Claude Code、Cursor、Claude Desktop

📦 工具列表

工具说明输入输出
import_source导入原始内容本地 markdown 文件或网页 URLraw_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 直接运行(推荐)

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_TIMEOUTAPI 超时毫秒数,默认 15000

前置条件

  1. 公众号 AppID/AppSecret:mp.weixin.qq.com → 开发 → 基本配置
  2. 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/submitmass/send
  • 查重estimate_originality 只与你自己的历史草稿比对,不能替代微信官方查重
  • 封面:默认从 ~/Pictures/wechat-covers/ 随机选取,无封面时自动生成占位图
  • 模板:可自定义 templates/wechat-header.htmltemplates/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 帮你搞定公众号排版,你只管写内容。 ✍️

Reviews

No reviews yet

Be the first to review this server!