mcp_server_wechat
基于MCP技术,操作微信发送消息和获取历史记录
claude mcp add --transport stdio panxingfeng-mcp_server_wechat python -m mcp_server_wechat --folder-path=存放历史记录的目录
How to use
This MCP server provides automation for WeChat using the pywechat toolset. It can fetch chat history for a specific date and send messages to one or more friends, including single messages, multiple messages to a single friend, and broadcasting to multiple friends. The server exposes tools named wechat_get_chat_history, wechat_send_message, wechat_send_multiple_messages, and wechat_send_to_multiple_friends. To operate, configure the MCP service to point to the server entry (the -m mcp_server_wechat module) and then call the available actions via the MCP protocol, supplying the required arguments as documented in the examples. For example, you can request a specific day’s chat history for a user, send a single message to a friend, or perform a batch send to several friends.
How to install
Prerequisites:
- Python 3.8+ installed on your system
- Internet access to install packages
Install the MCP server package and its dependencies:
pip install mcp_server_wechat
(Optional) Upgrade to the latest version:
pip install --upgrade mcp_server_wechat
If you are using a standard (stdio) deployment, you can run the server directly by invoking the module:
pip install mcp_server_wechat
For SSE Streamable_HTTP variants, ensure you have the appropriate environment and access paths as described in the project docs.
Quick start (example)
- Create a virtual environment (recommended):
python -m venv venv
source venv/bin/activate # On Windows use: venv\Scripts\activate
- Install the package and dependencies:
pip install -r requirements.txt # if provided by the project
pip install mcp_server_wechat
- Run the server (stdio version):
python -m mcp_server_wechat --folder-path=path/to/history
- If using a container or different runtime, adjust the commands accordingly to your environment.
Additional notes
- The server requires the WeChat desktop client to be logged in and operable for UI automation to work.
- When fetching chat history or sending messages, ensure the target chats (friends or groups) are accessible and not blocked by any window focus restrictions.
- Do not manually interact with WeChat during automated operations to avoid disrupts in the automation flow.
- If you encounter permission or environment issues, verify Python is properly installed and that the folder-path used for storing history exists and is writable.
- This server adheres to the MIT-style guidelines of the project; review licenses as needed.
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