Content
# WECHATY-MCP-SSE
The wechaty-mcp-sse server implemented in TypeScript provides Wechaty-related functionalities for connecting large language models like Claude with Wechaty.
This is the MCP version of [chat-wechat](https://github.com/atorber/chat-wechat), which greatly simplifies the implementation.
## Features
- Query friend information using nickname
- Query group information using group name
- Send messages to friends
- Send messages to groups
## MCP Configuration Information
```
{
"mcpServers": {
"wechaty-mcp-sse": {
"url": "http://localhost:8083/sse"
}
}
}
```
## Usage Example
- Query friend information
<img src="./docs/findfriend.png" alt="Find Friend" height="300" />
- Send a message to a friend
<img src="./docs/sendmsg.png" alt="Send Message" height="300" />
## Installation and Running
1. Install dependencies
```bash
cd mcp-sse-server
npm install
```
2. Create environment configuration file
```bash
cp .env.example .env
```
3. Start the development server
```bash
npm run dev
```
4. Build the production version
```bash
npm run build
```
5. Start the production server
```bash
npm start
```
## MCP Tool Description
1. **findFriend**: Find a friend
- Parameters:
- nickname: Friend's nickname (required)
- Returns:
- Success: Returns the friend list in the format: `{ content: [{ type: "text", text: "[{\"wxid\":\"xxx\",\"name\":\"xxx\",\"index\":1}, ...]" }] }`
- Failure: `{ content: [{ type: "text", text: "User「{nickname}」does not exist" }] }`
2. **findRoomByTopic**: Find a group
- Parameters:
- topic: Group name (required)
- Returns:
- Success: Returns the group list in the format: `{ content: [{ type: "text", text: "[{\"wxid\":\"xxx\",\"name\":\"xxx\"}]" }] }`
- Failure: Returns an empty list
3. **sendMessageToFriendByNickname**: Send a message to a friend using their nickname
- Parameters:
- nickname: Friend's nickname (required)
- message: Message content (required)
- Returns:
- Success: `{ content: [{ type: "text", text: "Message sent to「{nickname}」successfully, sent at {timestamp}" }] }`
- Failure: `{ content: [{ type: "text", text: "User「{nickname}」does not exist" }] }`
- Multiple matches: `{ content: [{ type: "text", text: "Multiple users found for「{nickname}」, please use WeChat ID to send the message or specify which friend to send to" }, { type: "text", text: "[{\"wxid\":\"xxx\",\"name\":\"xxx\",\"index\":1}, ...]" }] }`
4. **sendMessageToRoomByTopic**: Send a message to a group using the group name
- Parameters:
- topic: Group name (required)
- message: Message content (required)
- Returns:
- Success: `{ content: [{ type: "text", text: "Message sent to「{topic}」successfully, sent at {timestamp}" }] }`
- Failure: `{ content: [{ type: "text", text: "Group「{topic}」does not exist" }] }`
- Multiple matches: `{ content: [{ type: "text", text: "Multiple groups found for「{topic}」, please use WeChat ID to send the message or specify which group to send to" }, { type: "text", text: "[{\"wxid\":\"xxx\",\"name\":\"xxx\",\"index\":1}, ...]" }] }`
5. **sendMessageToFriendByWxId**: Send a message to a friend using their WeChat ID
- Parameters:
- wxid: Friend's WeChat ID (required)
- message: Message content (required)
- Returns:
- Success: `{ content: [{ type: "text", text: "Message sent to「{wxid}」successfully, sent at {timestamp}" }] }`
- Failure: `{ content: [{ type: "text", text: "User「{wxid}」does not exist" }] }`
6. **sendMessageToRoomByWxId**: Send a message to a group using the group's WeChat ID
- Parameters:
- wxid: Group's WeChat ID (required)
- message: Message content (required)
- Returns:
- Success: `{ content: [{ type: "text", text: "Message sent to「{wxid}」successfully, sent at {timestamp}" }] }`
- Failure: `{ content: [{ type: "text", text: "Group「{wxid}」does not exist" }] }`
## Containerized Deployment
You can use Docker for containerized deployment. An example Dockerfile is as follows:
```dockerfile
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY dist/ ./dist/
EXPOSE 8083
USER node
CMD ["node", "dist/index.js"]
```
You Might Also Like
OpenWebUI
Open WebUI is an extensible web interface for customizable applications.

NextChat
NextChat is a light and fast AI assistant supporting Claude, DeepSeek, GPT4...

cherry-studio
Cherry Studio is a multilingual project for creative collaboration.
smileyCoin
Smileycoin (SMLY) is a cryptocurrency using multiple proof-of-work algorithms.
markmap-mcp-server
Markmap MCP Server converts Markdown to interactive mind maps easily.
mcp-manager
simple web ui to manage mcp (model context protocol) servers in the claude app