Content
# Tool List
MCP Server WeChat is a server that provides WeChat chat record retrieval and message sending functions based on MCP technology, implemented using [pywechat](https://github.com/Hello-Mr-Crab/pywechat) for automated WeChat operations.
## Features
This server provides the following main functions:
- Retrieve WeChat chat records (for a specified date)
- Send a single message to a single friend
- Send multiple messages to a single friend
- Send messages to multiple friends
## Available Tools
- `wechat_get_chat_history` - Retrieves WeChat chat records for a specific date
- Required parameters:
- `to_user` (string): Friend or group chat remark or nickname
- `target_date` (string): Target date, in the format YY/M/D, e.g., 25/3/22
- `wechat_send_message` - Sends a single message to a single WeChat friend
- Required parameters:
- `to_user` (string): Friend or group chat remark or nickname
- `message` (string): Message to be sent
- `wechat_send_multiple_messages` - Sends multiple messages to a single WeChat friend
- Required parameters:
- `to_user` (string): Friend or group chat remark or nickname
- `messages` (array): List of messages to be sent (input as a string separated by commas)
- `wechat_send_to_multiple_friends` - Sends a single or multiple messages to multiple WeChat friends
- Required parameters:
- `to_user` (array): List of friends or group chat remarks or nicknames (input as a string separated by commas)
- `message` (string/array): Message(s) to be sent (a single message will be sent to all friends; multiple messages separated by commas and matching the number of friends will be sent to corresponding friends)
## Installation
### stdio version
```bash
pip install mcp_server_wechat
# Upgrade to the latest version
pip install --upgrade mcp_server_wechat
```
### sse version/Streamable_HTTP version
```bash
python -m venv venv # Create a virtual environment
venv/scripts/activate # Activate the environment
pip install -r requirements.txt
```
## Usage Examples
### Configure as an MCP Service
Add the following to your MCP configuration:
stdio version
```json
{
"mcpServers": {
"wechat": {
"command": "python",
"args": ["-m", "mcp_server_wechat","--folder-path=directory to store chat history"]
}
}
}
```
sse version
Start command
```bash
python -m mcp_server_wechat_sse --folder-path=x:\xxxxx #Default folder can be modified in the code
```
```json
{
"mcpServers": {
"wechat": {
"url": "http://localhost:3000/sse"
}
}
}
```
Streamable_HTTP version
Start command
```bash
python -m mcp_server_wechat_Streamable_HTTP --folder-path=x:\xxxxx #Default folder can be modified in the code
```
```json
{
"mcpServers": {
"wechat": {
"url": "http://localhost:3000/mcp"
}
}
}
```
### Invocation Examples
1. Retrieve chat records:
```json
{
"name": "wechat_get_chat_history",
"arguments": {
"to_user": "John Doe",
"target_date": "25/3/22"
}
}
```
2. Send a single message:
```json
{
"name": "wechat_send_message",
"arguments": {
"to_user": "John Doe",
"message": "Hello, this is a test message"
}
}
```
3. Send multiple messages:
```json
{
"name": "wechat_send_multiple_messages",
"arguments": {
"to_user": "John Doe",
"messages": "Hello","This is the first message","This is the second message"
}
}
```
4. Send to multiple friends (single message):
```json
{
"name": "wechat_send_to_multiple_friends",
"arguments": {
"to_user": ["John Doe", "Jane Doe", "Bob Smith"],
"message": "Hello everyone, this is a group message" or "Hello, John","Hello, Jane","Hello, Bob"
}
}
```
## Debugging
You can use the MCP inspector to debug the server:
```bash
npx @modelcontextprotocol/inspector python -m mcp_server_wechat
```
## Actual Effect Display
<table>
<tr>
<td align="center" width="33%">
<img src="https://raw.githubusercontent.com/panxingfeng/mcp_server_wechat/main/test.png" width="330" /><br>
<em>inspector test</em>
</td>
<td align="center" width="33%">
<img src="https://raw.githubusercontent.com/panxingfeng/mcp_server_wechat/main/multi-tool-test.gif" width="330" /><br>
<em>Test based on my own UI (similar to Cherry Studio)</a></em>
</td>
<td align="center" width="34%">
<img src="https://raw.githubusercontent.com/panxingfeng/mcp_server_wechat/main/Streamable_HTTP_test.png" width="330" /><br>
<em>Test based on Cherry Studio's Streamable_HTTP</a></em>
</td>
</tr>
</table>
## Precautions
- Using this tool requires keeping the WeChat desktop version logged in
- Retrieving chat records and sending messages require ensuring the WeChat window can be normally operated
- During use, please do not manually operate the WeChat window to avoid interfering with automated operations
- Please do not use this tool for any behavior that violates WeChat service agreements
## License
mcp_server_wechat uses the MIT license. This means you can freely use, modify, and distribute this software, but you must comply with the terms and conditions of the MIT license. See the LICENSE file in the project repository for details.
Connection Info
You Might Also Like
awesome-mcp-servers
A collection of MCP servers.
cc-switch
All-in-One Assistant for Claude Code, Codex & Gemini CLI across platforms.
git
A Model Context Protocol server for Git automation and interaction.
lumen
Cut Claude Code costs and latency with precise, local semantic search across...
Omni-Adapter
Omni-Adapter is a multi-platform image generation adapter integrating AI...
brave-search
Brave Search MCP Server integrates web and local search with flexible filtering.