Back to Articles
Feb 13, 20263 days ago

OpenClaw Connects to WeChat Personal Accounts, AI Agents Can Finally Work on WeChat

老杨啊@yhslgg

AI Summary

This article dives into an exciting breakthrough for AI enthusiasts and everyday WeChat users alike: the successful integration of the powerful OpenClaw AI Agent framework with personal WeChat accounts. For a long time, a major frustration existed because this immensely popular tool, capable of automating tasks across platforms like Feishu and Discord, lacked support for the world's most ubiquitous messaging app. The piece reveals how a developer solved this problem in just two days, creating an open-source solution that bypasses WeChat's restrictive web protocol to deliver a stable, functional AI assistant right inside your chats. The core of the guide walks through the elegant three-module pipeline that makes it all work, from using a more stable iPad protocol to receive messages without getting banned, to building a smart gateway that handles deduplication and intelligent routing, and finally connecting seamlessly to OpenClaw. It candidly shares crucial pitfalls to avoid, like message duplication turning your AI into a parrot, and provides a realistic breakdown of the surprisingly low monthly cost to run such a system. The potential use cases, from a smart technical Q&A bot in group chats to a personal knowledge manager, illustrate how this moves AI agents from being mere toys to genuine productivity tools. Ultimately, this article is a compelling blueprint for bringing advanced AI automation into your daily digital life. It demystifies the technical process with clear development prompts and a straightforward deployment guide, making it accessible even for those with modest technical skills. To see how you can build your own 24/7 WeChat AI assistant and explore the full range of its capabilities, the complete article is an essential and engaging read.

直接一个好家伙!!!OpenClaw 这个 GitHub 上 18 万 Star 的怪物级 AI Agent 项目,飞书能接、钉钉能接、Discord 能接,偏偏最多人用的微信个人号,它不支持???

这谁顶得住啊!天天在微信上聊天吹水,结果想让 AI 帮你干活都这么费劲?

大佬苍何@canghe,爆肝 2 天,直接把 OpenClaw 接入了微信个人号,还开源了!!!

今天老杨啊就来拆解一下这个项目的开发思路,小白跟着走也能搞定!🔥

【核心思路】

一条流水线,3 个核心模块:

微信消息 → iPad协议接收 → 消息中转网关 → OpenClaw Agent → AI回复 → 微信

不走微信 Web 协议(动不动封号),走 iPad 协议 + 消息中转,稳定性直接拉满!

【第一步:搞定消息接收——iPad 协议层】

要解决的问题:怎么稳定接收微信消息,还不被封号?

开发思路:

放弃 Web 协议(说封就封,谁用谁知道)

用 iPad 协议模拟 iPad 客户端登录

长连接接收消息推送,稳定性比 Web 协议高一个量级

让 AI 帮你写代码的 Prompt:

帮我实现一个基于 iPad 协议的微信消息接收模块,要求:1)模拟 iPad 客户端登录 2)支持扫码认证 3)长连接接收消息 4)输出标准化消息格式(包含发送者、消息类型、内容、群聊信息)

这一步最关键,协议选对了后面就顺了!!!

【第二步:消息中转网关——整个系统的大脑】

要解决的问题:消息格式转换、去重、限流、路由,一堆脏活累活。

开发思路:

用 TypeScript 写(跟 OpenClaw 技术栈一致,省事)

LRU 缓存做消息去重——微信同一条消息有时候推 2-3 次,不去重 AI 就变复读机😂

群聊 @触发 + 私聊直连——避免 AI 在群里疯狂刷屏的社死场面

多模型智能路由——闲聊用 DeepSeek 省钱,写代码上 Claude 靠谱

让 AI 帮你写代码的 Prompt:

帮我实现一个消息中转网关,TypeScript 编写,包含以下功能:1)基于消息ID+时间窗口的 LRU 去重缓存 2)群聊@触发机制(只有@机器人才回复)3)私聊消息直接转发 4)根据消息内容自动路由到不同大模型 5)"思考中..."状态提示机制

这一步是整个系统的核心,搞好了体验直接起飞!!!

【第三步:对接 OpenClaw——最后一公里】

要解决的问题:把消息推给 OpenClaw,再把 AI 回复转发回微信。

开发思路:

通过 Webhook 把标准化消息推给 OpenClaw Gateway

OpenClaw 处理完回调回来

中转网关把回复转发回微信

搞定会话状态管理,让 AI 记住上下文

让 AI 帮你写代码的 Prompt:

帮我实现 OpenClaw Webhook 对接模块:1)将标准化消息通过 HTTP POST 推送到 OpenClaw Gateway 2)接收 OpenClaw 的回调响应 3)维护会话状态(支持多轮对话上下文)4)错误重试和超时处理

三步搞定,整个系统就跑起来了!!!🚀

【踩坑提醒】

消息去重必须做:微信推送机制很迷,同一条消息推 2-3 次是常态,不做去重 AI 变复读机

用小号测试:虽然 iPad 协议比 Web 协议稳定得多,但毕竟是第三方接入,谨慎为上

固定 IP 部署:频繁换 IP 容易触发腾讯风控,别省这点服务器钱

别搞群发营销:腾讯的风控不是吃素的,老老实实当 AI 助手用

回复延迟要处理:大模型想几秒很正常,加个"思考中..."提示,不然对面以为你已读不回

【成本算一下】

OpenClaw:开源免费,0 元

大模型 API:GLM-5 开源免费,Claude/GPT 按量计费,日常使用约 30-50 元/月

云服务器(固定IP):50-100 元/月

总成本:100-150 元/月

一个月一百多块,换一个 24 小时在线的微信 AI 助手,这买卖太香了!!! 【能干啥?玩法太多了】

智能群聊助手:技术群里 @机器人问代码问题,再也不用忍受"百度一下"的回复

个人知识管家:文章链接丢给它,自动总结存 Notion,比收藏夹好用一万倍

日程提醒:跟它说"明天下午3点提醒我开会",到点微信戳你,比手机提醒靠谱

自动回复:有人加好友问"在吗",AI 直接回"在的,有什么事吗?",解放双手

全网资讯搜集:让 OpenClaw 自动搜集行业资讯,汇总发你,信息差直接拉满

【部署三步走】

# 第一步:克隆项目
git clone https://github.com/freestylefly/openclaw-wechat.git
# 第二步:配置环境变量
openclaw config set channels.wechat.apiKey "你的API Key"
openclaw config set channels.wechat.proxyUrl "你的代理地址"
openclaw config set channels.wechat.enabled true
# 第三步:安装插件,扫码登录
openclaw plugins install @canghe/openclaw-wechat

5 分钟搞定,不需要公司认证,不需要企业微信,普通个人号直接用!!!

卧槽说真的,OpenClaw + 微信这个组合太猛了。AI Agent 不再是实验室里的玩具,而是真正能帮你干活的微信好友。

项目地址:https://github.com/freestylefly/openclaw-wechat

懂 AI 的推友赶紧肝起来!有问题评论区吐槽,老杨啊随时回😂

觉得有用的话,转发一下让更多人看到!🔥

By
老杨啊