WeChat Local Agent MCP
Provides local-first, read-only access to the owner's WeChat chat history, enabling search, summarization, day/range pagination, unread and event queries, group member lists, and structured message details, with optional gated enrichment for media, OCR, files, voice, and links.
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 Local Agent MCPSummarize yesterday's messages from the 'Project' group chat."
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 Local Agent MCP
A local-first, stdio-only MCP for letting an Agent search and summarize the computer owner's own WeChat history. It provides stable day/range pagination, bulk chat workflows, unread/event queries, context, structured message details, and explicitly gated OCR/file/voice/link enrichment.
This is an independent community project. It is not affiliated with or endorsed by Tencent or WeChat. Use it only for data you own or are authorized to access, subject to local law and applicable terms.
Give this repository to an Agent
Tell an installation-capable Agent:
Clone https://github.com/hetiankong/wechat-local-agent-mcp, read AGENTS.md in
full, and follow it to install and verify the local read-only WeChat MCP.
Do not expose keys or message contents during setup.AGENTS.md is the complete platform decision tree, safety contract, install
runbook, verification checklist, troubleshooting guide, and large-chat recipe.
For a manual macOS Apple Silicon install:
git clone https://github.com/hetiankong/wechat-local-agent-mcp.git
cd wechat-local-agent-mcp
./scripts/install.sh --register-codex
./scripts/bootstrap-macos.shFor Windows 11 amd64 PowerShell:
git clone https://github.com/hetiankong/wechat-local-agent-mcp.git
cd wechat-local-agent-mcp
.\scripts\install.ps1 -RegisterCodexThe installer downloads an official r266-tech/wechat-cli release and fails
closed unless its .sha256 sidecar verifies. No WeChat databases, keys, decoded
media, messages, or account identifiers are included in this repository.
An offline pair can be supplied through WECHAT_CLI_RELEASE_ZIP and
WECHAT_CLI_RELEASE_SHA256 without weakening checksum verification.
Related MCP server: wx4py-mcp
Product workflows
Core tools include:
resolve_chat,sessions,search,timelineread_chat_day,read_chat_range,read_multiple_chats_daycount_messages,unread,read_events,group_memberscontext,message_details
Optional tools include message_media, ocr_message_images,
extract_message_files, transcribe_message_voice, and
fetch_message_links. Each is independently gated by environment variables;
ordinary reads never expose media paths or debug/key fields.
Read 900 messages from one day
Ask the Agent:
读取“项目群”今天的全部消息。先 resolve_chat 和 count_messages,再循环
read_chat_day(limit=200),每次使用 next_cursor,直到 done=true。逐页总结后按
时间顺序合并,重要结论保留消息 ID、发送者和时间。This takes about five bounded MCP calls, avoids offset drift, and keeps the
summary traceable. period accepts today/今天, yesterday/昨天,
this_week/本周, last_week/上周, recent-hour forms, or any YYYY-MM-DD.
Security boundary
Core subprocess calls use argv arrays,
shell=False, closed stdin, timeouts, bounded output, an allowlist, and strict read-only mode.The MCP has no generic SQL/command execution, export, send/reply, UI control, or indefinite watcher.
macOS setup keeps SIP enabled and uses a managed shadow app rather than re-signing the installed WeChat app.
The reviewed wxkey patch never receives or stores an administrator password; macOS Authorization Services owns the prompt.
Network link fetching is disabled by default and blocks credentials, private IPs, unsafe redirects, non-text content, and oversized responses.
See SECURITY.md for reporting and data-handling details.
Development
python3 -m venv .venv
.venv/bin/python -m pip install -e . pytest
.venv/bin/python -m pytest -qThe Python unit/security suite does not require WeChat data. Live acceptance must emit only counts, booleans, and field names—not user data.
Acknowledgements
The query runtime and key bootstrap build on the work of
r266-tech/wechat-cli and
r266-tech/wxkey. The architecture was
also informed by the local-data work of
labazhou2024/chatlog-keeper,
Thearas/wechat-db-decrypt-macos,
tomqiaozc/wx-dump-mac,
cocohahaha/wechat-decrypt-macos,
and ylytdeng/wechat-decrypt.
Licenses and exact usage are documented in THIRD_PARTY_NOTICES.md.
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
- Alicense-qualityDmaintenanceMCP server that enables AI agents to fetch and summarize WeChat public articles, supporting export to HTML, Markdown, Obsidian, Notion, and OneNote.Last updated5MIT
- Flicense-qualityCmaintenanceMCP server for WeChat PC automation, enabling message sending, voice/video calls, and AI-powered listening through Cursor or WorkBuddy.Last updated2
- Flicense-qualityDmaintenanceMCP server for WeChat automation, supporting message sending, chat history retrieval, and contact list management via SSE protocol.Last updated5
- FlicenseCqualityDmaintenanceMCP server for reading local WeChat data, enabling AI assistants to query chat history, contacts, sessions, and more via MCP tools.Last updated205
Related MCP Connectors
Managed LinkedIn MCP server for AI agents: search, connect, message and enrich on accounts you own.
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Local-first RAG engine with MCP server for AI agent integration.
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/hetiankong/wechat-local-agent-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server