wechat-mcp
Allows AI agents to interact with WeChat, including sending text messages, files, managing contacts and groups, and retrieving messages.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@wechat-mcp send a message to Alice saying I'm on my way"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
WeChat MCP Plugin
让 Codex 接管微信 — 通过 MCP 协议将微信能力暴露为 AI 可调用的工具。
概览
┌─────────────────────────────────────────────┐
│ Codex │
│ ┌──────────────────────────────┐ │
│ │ WeChat MCP Server │ │
│ │ (暴露 10+ 个工具给 Codex) │ │
│ └───────┬──────────────────────┘ │
│ │ stdio / JSON-RPC │
│ ┌───────▼──────────────────────┐ │
│ │ Wechaty + Puppet │ │
│ │ (微信协议桥接层) │ │
│ └───────┬──────────────────────┘ │
│ │ 注入/协议 │
│ ┌───────▼──────────────────────┐ │
│ │ 微信 (桌面版 / iPad 协议) │ │
│ └──────────────────────────────┘ │
└─────────────────────────────────────────────┘Related MCP server: weixin-mcp-server
快速开始
# 1. 安装依赖
bash scripts/setup.sh
# 2. 启动(扫码登录微信)
npm start
# 3. 注册到 Codex
codex plugin add wechat-mcp@personal
# 4. 在 Codex 中即可使用 WeChat 工具工具列表
工具 | 描述 |
| 获取登录状态和 Bot 信息 |
| 发送文本消息 |
| 发送文件/图片 |
| 获取联系人列表(支持搜索) |
| 获取群聊列表 |
| 获取最近消息 |
| 搜索历史消息 |
| 获取联系人详情 |
| 获取自身信息 |
| 搭建指南和故障排查 |
技术选型
协议: MCP (Model Context Protocol) over stdio
微信桥接: Wechaty + wechaty-puppet-wechat (UOS)
运行时: Node.js 18+
通信: JSON-RPC 2.0
目录结构
wechat-mcp/
├── .codex-plugin/
│ └── plugin.json # 插件清单
├── .mcp.json # MCP Server 配置
├── mcp/
│ ├── index.mjs # MCP Server 入口
│ └── wechaty-bridge.mjs # Wechaty 桥接封装
├── scripts/
│ └── setup.sh # 一键安装/检查脚本
├── skills/
│ └── SKILL.md # Codex 技能定义
├── package.json # Node.js 依赖
└── README.md许可证
MIT
Available Tools
10 toolswechat_contact_infoA
获取指定联系人的详细信息,包括昵称、备注名、地区、个性签名等。
Inputs: contactId (required).
wechat_get_contactsB
获取所有联系人或按关键词搜索联系人。返回昵称、备注、ID 等信息。
Inputs: query.
wechat_get_messagesA
获取最近收到的消息列表。默认返回最近 50 条。
Inputs: limit.
wechat_get_roomsA
获取所有群聊列表,包含群名称和成员数。
Inputs: no named parameters.
wechat_search_messagesA
按关键词搜索历史消息记录,支持按文本内容和发送者搜索。
Inputs: keyword (required), limit.
wechat_self_infoA
获取当前登录微信账号的个人信息。
Inputs: no named parameters.
wechat_send_fileA
向联系人或群聊发送文件或图片,需要提供本地文件的绝对路径。
Inputs: contact (required), filePath (required).
wechat_send_textA
向联系人或群聊发送文本消息。contact 参数可以是联系人的 ID、昵称或群名称。
Inputs: contact (required), message (required).
wechat_setup_guideA
获取 Wechaty 环境搭建指南、依赖状态和故障排查建议。
Inputs: no named parameters.
wechat_statusA
获取微信登录状态、Bot 运行信息和 Wechaty 初始化状态
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool targets a distinct action or resource: sending text/file, retrieving contacts/rooms/messages, searching history, and fetching status/self information. Even the seemingly similar contacts list and contact info tools are clearly differentiated by scope (list/search vs detailed profile).
All tools share the 'wechat_' prefix, and most follow a verb_noun pattern (wechat_send_text, wechat_get_contacts). However, several tools like wechat_status, wechat_contact_info, wechat_self_info, and wechat_setup_guide lack a leading verb, creating a mixed but still readable convention.
With 10 tools, the server is well-scoped for a WeChat bot, covering messaging, contacts, rooms, message history, and account info without unnecessary expansion. This falls comfortably within the ideal range for a domain-specific MCP server.
The tool set covers the core WeChat operations: sending text and files, listing contacts and rooms, retrieving recent messages, searching history, and accessing self/contact details. Minor gaps exist, such as no explicit tool for group member management or real-time event subscription, but these are not essential for typical bot workflows.
Maintenance
Related MCP Connectors
Email infrastructure for AI agents — send, receive, search, and reply to email over MCP.
Connect any AI agent to 1,000+ apps and 27,000+ actions through one remote MCP server (OAuth).
Drive WhatsApp from any MCP client: pair devices, send text and media, manage contacts and groups.
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides WeChat automation capabilities for AI development tools via the Model Context Protocol. It enables users to send messages, manage contacts, and handle file transfers through AI assistants like Claude and Cursor.2735MIT
- AlicenseNot gradedqualityCmaintenanceEnables WeChat automation on PC via MCP, supporting sending messages and files, searching contacts, retrieving chat history, and executing commands, compatible with WeChat 4.1+.2MIT
- FlicenseNot gradedqualityDmaintenanceEnables MCP clients to control the Windows WeChat desktop app, including reading conversations, sending messages, searching contacts, and monitoring new messages via UI automation.-
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to query local WeChat chat data through read-only MCP tools, including sessions, messages, contacts, search, and statistics, with everything processed locally.63 PyPI6MIT