Model Context Protocol for WeChat
claude mcp add --transport stdio jettchent-wechat-mcp uv --directory <path-to-wechat-agent> run -m src.mcp
How to use
This MCP server integrates WeChat by leveraging the wechat-exporter setup. It reads chat history with a specified user and can send messages back to that user through the agent. To use it, configure Claude Desktop to run the MCP server, then enable MCP in the client. For each conversation, it’s recommended to include the special resource allcontacts://all_contacts in share context so the MCP can access contact information when addressing messages. The two primary capabilities are: reading messages from a specific chat history with a user, and sending messages to that user via the WeChat agent. Once the MCP is active, you can ask it to retrieve conversation history with a given user or push messages to that user through the configured agent, enabling interactive, chat-driven workflows.
How to install
Prerequisites:
- macOS with WeChat 3.x installed
- a working uv installation on your machine
- a customized WeChat agent setup based on the wechat-exporter tutorial (see the repository for guidance)
Installation steps:
- Install uv (if not already installed).
- macOS (example):
- brew install uv
- or follow the official uv installation guide for your platform
- macOS (example):
- Prepare the WeChat agent.
- Clone the wechat-exporter repository and modify it as described in the tutorial:
git clone https://github.com/JettChenT/wechat-exporter.git /path/to/wechat-agent
Follow the tutorial to adjust the agent for MCP use and note the absolute path to this folder
- Clone the wechat-exporter repository and modify it as described in the tutorial:
git clone https://github.com/JettChenT/wechat-exporter.git /path/to/wechat-agent
- Ensure Python/WeChat agent dependencies are installed if required by the modified agent.
- For example, if the agent requires Python packages, create a virtual environment and install them as documented by the agent’s repo
- Create your claude_desktop_config.json and insert the MCP configuration as shown in the example, replacing <path-to-wechat-agent> with the absolute path to the wechat-agent directory.
- Start Claude Desktop and enable MCP. Ensure the agent path is reachable by the MCP process and that the WeChat application can be accessed by the agent as configured.
Note: The exact commands to install uv or to run the agent may differ depending on your environment. Always refer to the official installation instructions for uv and the wechat-agent you are using.
Additional notes
Tips:
- Keep the wechat-agent directory path absolute and stable to avoid runtime path resolution issues.
- For reliability, run the agent in a directory that has proper permissions for reading chat history and sending messages.
- If messages fail to send, verify that WeChat desktop is running and that the agent has the necessary permissions to access WeChat data.
- The recommended share context resource allcontacts://all_contacts should be included in each conversation to ensure context is available for addressing contacts.
- If you update the wechat-agent code, restart the MCP to pick up changes.
- Ensure your environment variables (if any) required by the agent are properly configured in the MCP configuration’s env section.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP