wechat-mcp-publisher
Provides tools for creating WeChat Official Account drafts, including HTML article drafts with automatic image upload and replacement with WeChat URLs, image-message drafts, and draft listing, retrieval, and deletion.
Click on "Install 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-mcp-publisherPublish /path/article.html as a WeChat draft with cover /path/cover.jpg"
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-mcp-publisher
WeChat Official Account draft publishing local MCP tool. It turns "written HTML → Official Account draft box" into a single LLM tool call: image upload, inline image replacement in the article body with WeChat URLs, cover material, and draft creation are all automated.
Based on the official mcp SDK (2.x MCPServer), stdio transport, single account, uv-managed dependencies.
Tools (5)
工具 | 用途 |
| Article draft: accepts HTML (or a |
| Image message draft: plain-text description + 1~20 images (in order) |
| Paginated draft box query |
| Draft details (including body) |
| Delete draft (does not delete materials along with it) |
The access_token is obtained internally, cached, and self-heals on expiration (stable_token + automatic refresh and retry once on 40001/42001); it is not exposed as a tool. Errors are uniformly converted into Chinese messages with handling suggestions (e.g., 40164 prompts adding the IP allowlist, 48001 prompts a verified account), and they contain no credentials.
Related MCP server: WeChat Official Account MCP Server
Installation
uv sync
cp .env.example .env # 填入 WECHAT_APP_ID / WECHAT_APP_SECRETGet credentials: mp.weixin.qq.com → Settings & Development → Basic Configuration. On the same page, add this machine's public IP to the IP allowlist, otherwise token retrieval returns 40164.
Once published to PyPI, you can also run it directly without cloning (in a directory containing .env):
uvx wechat-mcp-publisher
# 或 pip install wechat-mcp-publisher && wechat-mcp-publisherIn this case, the MCP client configuration can be simplified to "command": "uvx", "args": ["wechat-mcp-publisher"].
Connecting to MCP clients
Claude Code (recommended, one command):
claude mcp add wechat-mcp-publisher -- uv run --directory /你的路径/wechat-mcp-publisher python -m wechat_mcp_publisherProject-level configuration (this repository already includes .mcp.json, which takes effect when Claude Code is opened in this repository's directory; on first use, confirm trust in /mcp): no manual addition is required.
Claude Desktop / other clients: merge the snippet from examples/mcp-client-config.example.json into the corresponding configuration file.
Usage examples
Say to the LLM:
Help me publish /path/article.html as an Official Account article draft, using /path/cover.jpg as the cover.
Or for an image message:
Send these three images /a.jpg /b.jpg /c.jpg as an image message draft, with the caption: weekend shots.
A real API pipeline demo is available at examples/simple_usage.py (token → upload → create draft; also serves as a live smoke test).
Testing
uv run pytestAll endpoints are mocked via responses, so they can be run successfully without a real account.
Scope and known limitations
No markdown→HTML conversion: the article body input is HTML; use your existing md→html tool for conversion
No publishing (
freepublish): currently only goes as far as drafts; publishing is left for extension after account verificationPersonal unverified subscription accounts: the material/draft APIs return
48001; live verification requires a verified account (development and testing are unaffected)HTML WeChat compatibility: the WeChat editor only accepts a subset of HTML with inline styles; layout adaptation is handled by the upstream conversion tool; this tool neither validates nor fixes it
Material buildup: deleting a draft does not delete the permanent material images it occupies; with long-term use, clean them up occasionally in the Official Account backend
Single account: credentials come from
.env; no multi-account switching is provided
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables saving articles to WeChat Official Account drafts with support for rich text, automatic image upload, and Markdown rendering including Mermaid diagrams.1
- FlicenseNot gradedqualityDmaintenanceEnables management of WeChat Official Accounts by supporting draft creation, image uploads, and content publishing via the MCP protocol. It provides tools for interacting with the WeChat API, including secure token caching and draft list management.
- 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.821,300Apache 2.0
- FlicenseAqualityFmaintenanceEnables AI agents to publish articles to WeChat Official Account (微信公众号). Supports image upload, draft creation, and publishing via standardized MCP protocol.51
Related MCP Connectors
Publish Markdown or HTML to a shareable link from your AI assistant. OAuth, no API keys.
Publish HTML to private, unguessable, replace-in-place URLs from any MCP-compatible AI agent.
Publish to self-hosted WordPress from AI agents: markdown, images, SEO, and Notion sync.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/weinh/wechat_mcp_publisher'
If you have feedback or need assistance with the MCP directory API, please join our Discord server