wechat-mcp-publisher
wechat-mcp-publisher
微信公式アカウントの下書き作成ローカル MCP ツール。「作成済み HTML → 公式アカウント下書き箱」を1回の LLM ツール呼び出しに変換します:画像アップロード、本文内の埋め込み画像の微信 URL への置換、カバー素材、下書き作成まで全て自動で完了します。
公式 mcp SDK(2.x MCPServer)に基づき、stdio トランスポート、単一アカウント、uv で依存関係を管理します。
ツール一覧(5個)
ツール | 用途 |
| 図文記事の下書き:HTML(または |
| 画像メッセージの下書き:プレーンテキストの説明 + 1〜20枚の画像(順序どおり) |
| 下書き箱をページングで照会 |
| 下書きの詳細(本文含む) |
| 下書きを削除(関連素材は削除しない) |
access_token は内部で取得・キャッシュされ、失効時は自己修復します(stable_token + 40001/42001 の自動更新リトライを1回実行)。ツールとしては公開されません。エラーは一律、対処ヒント付きの中国語メッセージに変換されます(例:40164 は IP ホワイトリスト追加のヒント、48001 は認証済みアカウントが必要というヒント)。また、認証情報は含まれません。
Related MCP server: WeChat Official Account MCP Server
インストール
uv sync
cp .env.example .env # 填入 WECHAT_APP_ID / WECHAT_APP_SECRET認証情報の取得:mp.weixin.qq.com → 設定と開発 → 基本設定。同じページで本機のパブリック IP を IP ホワイトリストに追加する必要があります。追加しないと token の取得時に 40164 エラーが発生します。
PyPI に公開されているので、クローンしなくても直接実行できます(.env を含むディレクトリで):
uvx wechat-mcp-publisher
# 或 pip install wechat-mcp-publisher && wechat-mcp-publisherこの場合、MCP クライアントの設定は "command": "uvx", "args": ["wechat-mcp-publisher"] と簡略化できます。
MCP クライアントへの接続
Claude Code(推奨、1コマンド):
claude mcp add wechat-mcp-publisher -- uv run --directory /你的路径/wechat-mcp-publisher python -m wechat_mcp_publisherプロジェクトレベルの設定(本リポジトリには既に .mcp.json が組み込まれており、Claude Code を本リポジトリのディレクトリで開けばそのまま有効になります。初回は /mcp で信頼の確認が必要です):手動での追加は不要です。
Claude Desktop / その他のクライアント:examples/mcp-client-config.example.json 内のスニペットを対応する設定ファイルにマージしてください。
使用例
LLM にこう伝えます:
/path/article.html を公式アカウントの図文記事下書きとして作成してください。カバーは /path/cover.jpg を使ってください
または画像メッセージ:
この3枚の画像 /a.jpg /b.jpg /c.jpg を画像メッセージ下書きとして作成してください。説明文:週末の写真
実際の API フローのデモは examples/simple_usage.py を参照してください(token → アップロード → 下書き作成、実機スモークテストを兼ねます)。
テスト
uv run pytestすべての API は responses でモックされており、実際のアカウントがなくても実行できます。
スコープと既知の制限
markdown→HTML 変換は行いません:本文の入力は HTML です。変換は既存の md→html ツールで行ってください
公開は行いません(
freepublish):現在は下書きまでです。公開はアカウント認証後の拡張で対応予定です個人の未認証購読号:素材/下書き API は
48001を返します。実機検証には認証済みアカウントが必要です(開発とテストには影響しません)HTML の微信互換性:微信エディターはインラインスタイルの HTML サブセットのみ認識します。レイアウトの調整は上流の変換ツールが担当し、本ツールは検証も修正も行いません
素材の蓄積:下書きを削除しても、その下書きが使用している永久素材の画像は削除されません。長期間使用する場合は、ときどき公式アカウント管理画面でクリーンアップしてください
単一アカウント:認証情報は
.envから取得し、複数アカウントの切り替えは提供しません
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