1. Conduid
  2. Developer Tools
  3. Wechat Official Account MCP
MCP server · Developer Tools

Wechat Official Account MCP

微信公众号MCP服务器 - WeChat Official Account MCP Server

Unclaimed MIT devtools
61Good

Scored a month ago · breakdown

About Wechat Official Account MCP

Wechat Official Account MCP is an MCP server published by xwang152-jack in the Developer Tools category: 微信公众号MCP服务器 - WeChat Official Account MCP Server.

The repository has 65 stars and 26 forks, with the last commit 11 days ago. Recent commit activity is the strongest signal that reported issues will get attention.

Install

From source
git clone https://github.com/xwang152-jack/wechat-official-account-mcp

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

✦

Ask AI about Wechat Official Account MCP

Powered by Claude · Grounded in docs

I know everything about Wechat Official Account MCP. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

Static checks derived from the repository 5 days ago. Heuristics on the source, not an audit.

  • ✓README presentThe repository ships documentation.
  • ✓License declaredUsable under a stated license.
  • !Tests presentNo tests found. Behaviour changes may go unnoticed between versions.
  • ✓Dependencies pinnedA lockfile pins dependency versions.
  • ✓No dynamic code executionSource scan found no eval, dynamic Function, or shell execution.
  • !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.

Releases

v2.2.1v2.2.1 · 25 May 2026v2.2.1 本次版本聚焦于补齐微信公众号开放接口中的高价值缺口,增强草稿管理、模板消息管理和永久图文素材管理能力,使 MCP 工具集更贴近公众号内容运营的真实工作流。 亮点 补齐 `wechat_draft.update`,支持按文章索引更新草稿中的单篇文章 补齐模板消息行业与模板管理能力,新增 `set_industry` 与 `add_template` 修正 `wechat_permanent_media` 中 `news` 图文素材的实际支持缺口…
v2.2.0v2.2.0 · 24 May 2026What's Changed fix: route mcp logs to stderr by @guoryu-cmyk in https://github.com/xwang152-jack/wechat-official-account-mcp/pull/5 fix: 修复 stdio 模式下日志输出污染 stdout 的问题 by @windmonk in…
v1.1.0v1.1.0 · 19 Nov 2025v1.1.0 发布说明 本次版本聚焦安全性、可用性与稳定性提升,完善了 MCP 模式认证能力,并修复素材上传时的数据库初始化问题。 重点特性 MCP 认证工具可用:`wechat_auth` 支持配置、令牌获取/刷新与配置查看 可选加密存储:为配置与令牌引入 AES 加密(`WECHAT_MCP_SECRET_KEY`) CORS 白名单:`CORS_ORIGIN` 环境变量控制跨域来源(含 SSE 传输) CLI 版本号:动态读取…
v1.0.2v1.0.2 · 14 Sep 2025

README

微信公众号 MCP 服务

为 AI 应用(Claude Desktop、Cursor 等)提供微信公众号 API 集成的 MCP 服务。

当前版本: v2.2.1 · 更新日志 · 开发者指南

  • 运行时: Node.js 20.17+
  • 协议: MCP (Model Context Protocol) · 存储: SQLite · 语言: TypeScript

快速开始

WECHAT_APP_ID=<your_app_id> WECHAT_APP_SECRET=<your_app_secret> npx wechat-official-account-mcp mcp

接入 Claude Desktop,在 claude_desktop_config.json 中添加:

{
  "mcpServers": {
    "wechat-official-account": {
      "command": "npx",
      "args": ["wechat-official-account-mcp", "mcp"],
      "env": {
        "WECHAT_APP_ID": "<your_app_id>",
        "WECHAT_APP_SECRET": "<your_app_secret>"
      }
    }
  }
}

推荐用环境变量而非 -a/-s 参数传 AppSecret,避免密钥出现在进程命令行里。

凭据会存入 ./data/wechat-mcp.db,其中 app_secret 等敏感字段默认 AES 加密(密钥未指定时自动生成于 ./data/.secret-key,权限 600)。


工具

对外暴露 14 个工具,按「读写分离」组织:只读与写入操作位于不同工具,便于客户端对写入操作做权限控制。所有工具返回 JSON。

类别 工具
内容 wechat_content_read / wechat_content_write — 草稿与发布
素材 wechat_media_read / wechat_media_write — 永久/临时素材、图文内图片
用户 wechat_audience_read / wechat_audience_write — 粉丝、标签、黑名单
互动 wechat_engagement_read / wechat_engagement_write — 文章评论
消息 wechat_messaging_read / wechat_messaging_write — 模板/客服/订阅/群发
数据 wechat_statistics — 发表内容、消息、接口统计(只读)
长尾 search_actions + execute_read_action / execute_write_action

每个域工具用一个 action 参数选择具体操作,例如:

wechat_content_read  { "action": "list", "count": 10 }     # 列出草稿
wechat_content_write { "action": "add", "articles": [...] } # 新建草稿
wechat_content_write { "action": "submit", "mediaId": "..." } # 提交发布

菜单、二维码、短链、客服账号、账号配额、自动回复、商品卡片、认证配置等长尾能力未单独建工具,先用 search_actions 检索动作 ID(共 101 个),再用 execute_read_action / execute_write_action 执行。服务端 instructions 已说明该用法。


配置

环境变量 说明
WECHAT_APP_ID / WECHAT_APP_SECRET 公众号凭据(也可用 -a / -s)
WECHAT_MCP_SECRET_KEY 敏感字段加密密钥;未设置时自动生成本地密钥
WECHAT_MCP_SECRET_KEY_FILE 本地密钥文件路径,默认 ./data/.secret-key
DB_PATH 数据库路径,默认 ./data/wechat-mcp.db
MCP_HTTP_TOKEN HTTP 模式下的 Bearer 鉴权令牌
CORS_ORIGIN HTTP 模式下的来源白名单(逗号分隔)
DEBUG 开启调试日志

AppID / AppSecret 获取:微信公众平台 → 开发 → 基本配置。


远程部署(Streamable HTTP)

MCP_HTTP_TOKEN=$(openssl rand -hex 32) \
CORS_ORIGIN=https://your-client.example \
npx wechat-official-account-mcp mcp -m http -p 3000
端点 说明
POST /mcp MCP 端点(无状态)
GET /healthz 探活,不鉴权

⚠️ 微信 IP 白名单:公众号 API 要求调用方 IP 在账号后台白名单内,否则报 40164 invalid ip。 部署到服务器后,需把该服务器出口 IP 加入「公众号后台 → 开发 → 基本配置 → IP 白名单」。

--mode sse 保留但已废弃(该传输无鉴权且被 MCP 规范取代),建议改用 http。

也可以直接用 Docker:docker compose up -d(见 docker-compose.yml)。 systemd + nginx 常驻部署的配置与运维步骤与环境强相关,不入库,保存在本地 deploy/。


开发

npm install
npm run dev -- mcp -a <app_id> -s <app_secret>   # 开发模式
npm run check && npm run lint && npm test         # 静态检查与测试
npm run verify                                    # 端到端校验(协议层 / 字段映射 / HTTP 鉴权)
npm run build                                     # 构建到 dist/

相关文档:CHANGELOG · CLAUDE.md(架构与开发规范)· 微信官方文档 · MCP 规范


安全

  • 凭据加密:app_secret / access_token / encoding_aes_key 默认 AES 加密落库(enc: 前缀);日志对敏感字段脱敏
  • HTTP 鉴权:--mode http 下设置 MCP_HTTP_TOKEN 后所有 /mcp 请求需带 Authorization: Bearer,未设置时启动即告警
  • CORS:仅接受 CORS_ORIGIN 白名单内的来源,不使用通配符
  • 输入校验:全部工具经 Zod schema 运行时校验,HTML 内容经 sanitizeHtmlContent() 清理
  • 凭据不外泄:wechat_auth 的返回只含 appId 与布尔标记,不返回任何密钥或令牌

许可证

MIT · 作者 xwang152-jack <xwang152@163.com>

README fetched from the repository 5 days ago. The original is authoritative.

Questions

About Wechat Official Account MCP

How do I install Wechat Official Account MCP?

No package has been published for this server, so install it from source: clone the repository and follow its README.

Is Wechat Official Account MCP safe to use with an AI agent?

Its trust score is 61 out of 100 (good). It passes 4 of the 6 static security checks run so far; the failures are listed above. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Wechat Official Account MCP still maintained?

Yes — the latest release is v2.2.1 (25 May 2026), and the last commit was 11 days ago. The repository has 65 stars and 4 open issues.