cerberuschina

WeChat Agent Unigateway — Development skill for Claude Code

Development community

One WeChat (iLink/ClawBot) entry, many local agents - a dependency-free Python gateway that fans a single personal-WeChat bot binding out to Claude Code, Hermes, WorkBuddy or anything speaking A2A / H.

How to install WeChat Agent Unigateway

This entry records only its repository, not the path inside it, so there is no exact command to give. Open cerberuschina/WeChat-agent-unigateway and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What WeChat Agent Unigateway does

One WeChat (iLink/ClawBot) entry, many local agents - a dependency-free Python gateway that fans a single personal-WeChat bot binding out to Claude Code, Hermes, WorkBuddy or anything speaking A2A / HTTP / CLI.

Alternatives in Development

  • Wechat Article — 微信公众号文章:作者-编辑-读者三Agent协作 15.9k ★
  • AutoSwarm — AutoSwarm: All Your Agents, Working as One (Codex · Claude Code · DeepSeek Harness · Muse · Grok · WorkBuddy· 1.9k ★
  • Clawbot — Clawdbot完整配置指南:从安装到Claude Code中转 875 ★

README

agent-gateway

**一个微信,接住本机所有 agent。**

A tiny local gateway that owns **one** WeChat (iLink / ClawBot) binding and fans it out to **N** agents — Claude Code, Hermes, CodeBuddy/WorkBuddy, or anything that speaks A2A, HTTP, or a command line. Stdlib only, no dependencies, single process, localhost only.


它解决什么问题

要给一个 agent 接上微信,通常得给它一个微信号、在微信里装 **ClawBot 插件**、扫码绑定 —— 三个 agent 就是三个微信、三台手机、三次绑定。

这个网关把那一层收成一个:**只绑一个微信**,网关自己持有那个 bot 身份, 往里分给本机的多个 agent。微信上看到的是一个联系人,背后是一整个机房的 agent。

                        ┌──────────────── agent-gateway(本进程) ────────────────┐
微信(一个号)           │                                                        │
  └ ClawBot 插件 ──长轮询──►  ilink.py  ──►  router.py  ──► backends.py          │
       ▲                  │   getupdates       /c /h /w         │                  │
       │                  │   游标 + context_token              │                  │
       └─── sendmessage ──┤                                    ├──► A2A  :8800  Hermes
                          │                                    ├──► A2A  :8799  Claude Code
                          │                                    └──► exec  ……    WorkBuddy / 任意 CLI
                          └────────────────────────────────────────────────────────┘

关键点:**同一个 bot 身份只能有一个进程在长轮询**。所以网关是那个唯一进程, 后面的 agent 谁都不碰微信。

两种接法

**① 虚拟 iLink(推荐,agent 零改动)** —— 网关伪装成腾讯的 iLink 服务端, agent 照常扫码、照常长轮询,但对面是网关;网关给它一个**虚拟微信号**。

微信 ──► 网关(持有唯一真凭证)──► 虚拟 iLink 服务端 :18500
                                      ▲            ▲
                     WEIXIN_BASE_URL─┘            └─ base_url 指过来
                     (Hermes 微信渠道)                (Claude / WorkBuddy 的微信接入)

Agent 那边什么都不用改,只要把微信的 base-url 指向 `http://127.0.0.1:18500` (Hermes 是环境变量 `WEIXIN_BASE_URL`)。两种接入方式:

  • 它已经绑过微信(Hermes 微信渠道就是这种:它的扫码 URL 写死在腾讯那边,没法重绑): 配 "virtual": {"reuse_real_token_for": "hermes"},它拿原来的 token 直接被网关接住。
  • 它还没绑:它那边正常弹二维码 → 你在 /bind/ 上批准 → 它拿到网关签发的 虚拟号;不想人工点就把它写进 `"auto_a