weflow
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., "@weflow总结一下我和张三上周的聊天内容"
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.
WeFlow MCP Server
把 WeFlow 的本地 HTTP API 包装成 MCP 工具,让你的 AI 助手直接读取本机微信聊天记录、 会话、联系人和群成员。
数据完全在本地流转:MCP 只与 127.0.0.1:5031 通信,不经过任何外部服务器。
提供的工具
工具 | 说明 |
| 检查 API 服务与 Token 是否可用 |
| 列出/搜索会话,获取 |
| 读取聊天记录(支持时间范围、关键词、分页、ChatLab 格式、媒体导出) |
| 搜索联系人,把名字解析成 |
| 获取群成员及发言统计 |
Related MCP server: wechat-mcp-server
前置条件
WeFlow 正在运行
启用 API 服务:WeFlow →「设置 → API 服务」→ 打开开关
拿到 Access Token:同一设置页面里显示,复制备用
默认监听 127.0.0.1:5031。若你改过端口,用 WEFLOW_PORT 指定。
安装
git clone https://github.com/rfdiosuao/WeFlow-MCP.git
cd WeFlow-MCP
npm install配置
在 MCP 客户端中注册本服务。所有客户端都是同一套配置:
{
"mcpServers": {
"weflow": {
"command": "node",
"args": ["<绝对路径>/weflow-mcp/src/index.js"],
"env": {
"WEFLOW_TOKEN": "你的 Access Token"
}
}
}
}各客户端配置位置
WorkBuddy:
~/.workbuddy/mcp.jsonClaude Desktop:
claude_desktop_config.jsonCursor:
.cursor/mcp.json(项目级)或全局配置
不要把真实 Token 提交到 Git 仓库。建议用环境变量或在本地配置文件中引用。
环境变量
变量 | 必填 | 默认值 | 说明 |
| ✅ | — | WeFlow「设置 → API 服务」中的 Access Token |
|
| API 主机 | |
|
| API 端口 | |
|
| 请求超时(毫秒) |
使用示例
配好之后,直接用自然语言提问即可:
「我和张三最近聊了什么?帮我总结一下」
「在项目群里搜一下提到『上线时间』的消息」
「这个月群里谁发言最多?」
「把上周和客户的对话整理成纪要」
AI 会自动按 搜索联系人 → 取 wxid → 读消息 的顺序调用工具。
工作原理
AI 助手 ──MCP(stdio)──▶ weflow-mcp ──HTTP──▶ WeFlow 本地 API (127.0.0.1:5031)
│
▼
本地微信数据库常见问题
返回 401 Unauthorized Token 不对。回到 WeFlow 设置页重新复制,注意别带上多余空格。
无法连接 / ECONNREFUSED
WeFlow 没启动,或 API 服务开关没打开。先用 weflow_health 确认。
调用超时
大群或大时间跨度查询较慢。缩小时间范围,或调大 WEFLOW_TIMEOUT。
找不到某个群
群聊不在联系人列表里。用 weflow_list_sessions 按群名搜索。
相关文档
WeFlow HTTP API 完整文档:
docs/HTTP-API.md
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Let ChatGPT, Claude & Cursor use your Mac: email, calendar, iMessage, Teams, files. Local, free.
Zero-setup MCP gateway securely connecting AI to your tools with authentication and workflows
Your personal data for AI — Telegram, bank, courses, Zoom & more, scoped to you.
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Related MCP Servers
- AlicenseAqualityFmaintenanceEnables Claude Code to read encrypted WeChat chat history from local database, search messages, view sessions and contacts.418Do What The F*ck You Want To Public
- FlicenseCqualityDmaintenanceMCP server for reading local WeChat data, enabling AI assistants to query chat history, contacts, sessions, and more via MCP tools.207-
- AlicenseCqualityCmaintenanceEnables to access and manage WeChat data (sessions, contacts, Moments) through the local WeFlow HTTP API.1218 npm1MIT
- FlicenseNot gradedqualityBmaintenanceProvides AI clients read-only access to WeChat chat history by extracting and decrypting the local Mac database, enabling search, summary, and analysis of messages.-