wechat-agent-gateway is an independent Rust gateway for the official WeChat bot channel.
It is derived from the behavior and protocol flow of Tencent's official packages:
This project rewrites that WeChat channel layer in Rust, removes the OpenClaw-specific coupling, and exposes a generic event/action gateway interface so other agent backends can integrate through a translator layer.
It does three things:
- talks to the official WeChat bot protocol
- normalizes inbound WeChat messages into standard events
- accepts standard outbound actions and sends them back to WeChat
It is not an agent, does not run model inference, and does not own backend business state.
- QR code login
- account persistence
- text send and receive
- typing
- inbound:
text / image / voice / file / video - outbound:
text / image / file / video - media upload, download, and decryption
- continues working after restart
Outbound voice is intentionally not implemented because the official package does not expose it as a standard outbound path.
See .env.example.
Most commonly used variables:
WECHAT_GATEWAY_BINDWECHAT_GATEWAY_PORTWECHAT_GATEWAY_URLWECHAT_GATEWAY_STATE_PATHWECHAT_GATEWAY_BASE_URLWECHAT_GATEWAY_CDN_BASE_URLRUST_LOG
Start the server:
cargo runLogin:
cargo run -- loginPull and start:
docker compose up -dCompose loads container runtime settings from .env.docker.
Login inside the container:
docker compose exec wechat-agent-gateway wechat-agent-gateway loginPublished image:
ghcr.io/mgrsc/wechat-agent-gateway
Release tags:
mainlatestvX.Y.ZX.Y.Zlatestalso updates onmain
GET /v1/healthGET /v1/accountsPOST /v1/accounts/login/startGET /v1/accounts/login/{login_id}POST /v1/events/pullPOST /v1/mediaGET /v1/media/{media_id}GET /v1/conversations/{conversation_id}POST /v1/actions
For full interface details, deployment notes, and troubleshooting, see AGENT_README.md.