An MCP server that automates WeChat on macOS using the Accessibility API and screen capture. It enables LLMs to interact with WeChat chats programmatically.
Features
- 📨 Fetch recent messages from any chat (contact or group)
- ✍️ Send automated replies based on chat history
- 📷 Publish text-only Moments posts, with optional draft-only mode
- 👥 Add contacts using WeChat ID with configurable privacy
- 🔍 Smart chat search with exact name matching
- 🤖 5 specialized Claude Code sub-agents for smart WeChat automation
Quick Start
Installation
pip install wechat-mcp-server
Setup with Claude Code
# If installed via pip
claude mcp add --transport stdio wechat-mcp -- wechat-mcp
# If using uv for development
claude mcp add --transport stdio wechat-mcp -- uv --directory $(pwd) run wechat-mcp
Setup with Claude Desktop
// If installed via pip
{
"mcpServers": {
"wechat-mcp": {
"type": "stdio",
"command": "wechat-mcp"
}
}
}
// If using uv for development
{
"mcpServers": {
"wechat-mcp": {
"type": "stdio",
"command": "uv",
"args": [
"--directory",
"{path/to/wechat-mcp}",
"run",
"wechat-mcp"
],
}
}
}
Setup with Codex
# If installed via pip
codex mcp add wechat-mcp -- wechat-mcp
# If using uv for development
codex mcp add wechat-mcp -- uv --directory $(pwd) run wechat-mcp
macOS Permissions
⚠️ Important: Grant Accessibility permissions to your terminal:
- Open System Settings → Privacy & Security → Accessibility
- Add your terminal application (Terminal.app, iTerm2, etc.)
- Ensure WeChat is running before using the server
Usage
Basic Commands
# Run with default stdio transport
wechat-mcp --transport stdio
# Run with HTTP transport
wechat-mcp --transport streamable-http
# Run with SSE transport
wechat-mcp --transport sse
Available MCP Tools
fetch_messages_by_chat- Get recent messages from a chatreply_to_messages_by_chat- Send a reply to a chatadd_contact_by_wechat_id- Add a new contact using a WeChat ID and send a friend requestpublish_moment_without_media- Publish a text-only Moments post (no photos or videos); optionally only prepare a draft without posting viapublish=False
See detailed API documentation for full tool specifications.
Claude Code Sub-Agents
This project includes 5 intelligent sub-agents designed specifically for WeChat automation. They enable natural language control of WeChat through Claude Code.
Available Sub-Agents
- Chat-summarizer - Summarize chat history and extract key information
- Auto-replier - Auto-generate and send appropriate replies
- Message-searcher - Search chat history for specific content
- Multi-chat-checker - Monitor multiple chats and prioritize messages
- Chat-insights - Analyze relationship dynamics and communication patterns
📖 View complete sub-agents guide
Development
Local Setup with uv
# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
# Clone and setup
git clone https://github.com/yourusername/WeChat-MCP.git
cd WeChat-MCP
uv sync
# Run locally
uv run wechat-mcp --transport stdio
Documentation
- 📘 Detailed Guide - Complete API documentation and architecture
- 🤖 Sub-Agents Guide - How to use Claude Code sub-agents
Requirements
- macOS (uses Accessibility API)
- WeChat for Mac installed and running
- Python 3.12+
- Accessibility permissions for terminal
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License - see LICENSE file for details
Metadata
Release files for iflow-mcp_biboyqg-wechat-mcp-server 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| iflow_mcp_biboyqg_wechat_mcp_server-0.1.0.tar.gz | 155.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| iflow_mcp_biboyqg_wechat_mcp_server-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 179.5 kB
Release files / iflow_mcp_biboyqg_wechat_mcp_server-0.1.0.tar.gz
| Download URL | iflow_mcp_biboyqg_wechat_mcp_server-0.1.0.tar.gz |
|---|---|
| Size | 155.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0bcb1b986f8f8a74fead6634b99289539e2575b08860150fdabea2cd02e9a937
|
|
BLAKE2b-256 checksum How to use checksums |
128111d006e60f8e847568a727ed3ee901003ffeaa682caf6247920ca58457bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / iflow_mcp_biboyqg_wechat_mcp_server-0.1.0-py3-none-any.whl
| Download URL | iflow_mcp_biboyqg_wechat_mcp_server-0.1.0-py3-none-any.whl |
|---|---|
| Size | 24.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b60964216b11d7bfa929dcde6431b8eba3c33ce25d7619266f06f71a9d9fa95c
|
|
BLAKE2b-256 checksum How to use checksums |
352c52443cb3ce6d5ad312cb43119436eecc71d021bf742d86687944afff33be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|