OpenClaw's Weixin channel plugin. Connect an OpenClaw Gateway to Weixin with QR-code login and receive and send messages through the Weixin backend.
- QR-code login with automatic credential storage.
- Multiple Weixin accounts on one OpenClaw Gateway.
- Text, image, voice, file, and video messages.
- Long-poll message delivery and typing indicators.
- OpenClaw channel routing, pairing, and session isolation.
| Component | Requirement |
|---|---|
| Node.js | >=22.13.0 |
| OpenClaw runtime check | >=2026.3.22 |
| npm peer dependency | >=2026.5.12 |
Use OpenClaw >=2026.5.12 when possible. The runtime guard currently accepts >=2026.3.22; npm installations using strict peer-dependency validation require the peer-dependency version.
OpenClaw must be installed and the openclaw CLI must be available. See the OpenClaw installation guide.
openclaw --versionnpx -y @tencent-weixin/openclaw-weixin-cli installIf the installer is not suitable for your environment, install the plugin directly:
openclaw plugins install "@tencent-weixin/openclaw-weixin"openclaw config set plugins.entries.openclaw-weixin.enabled trueopenclaw channels login --channel openclaw-weixinScan the QR code with Weixin and confirm the authorization. Credentials are stored locally after a successful login.
openclaw gateway restart
openclaw channels statusRun the login command again for each account:
openclaw channels login --channel openclaw-weixinWhen multiple accounts are logged in, isolate direct-message sessions by account, channel, and peer:
openclaw config set session.dmScope per-account-channel-peerSet an optional identifier for backend log attribution and monitoring:
{
"channels": {
"openclaw-weixin": {
"botAgent": "MyBot/1.2.0"
}
}
}botAgent is used for observability only. It is not an authentication credential and does not control message routing.
Format (UA-style):
- One or more
Name/Versiontokens, space-separated - Each token may optionally be followed by
(comment) - ASCII only; total length ≤ 256 bytes
- Invalid tokens are silently dropped during sanitization; falls back to
OpenClawif nothing valid remains
Examples that pass through unchanged:
MyBot/1.2.0MyBot/1.2.0 (region=cn;env=prod)MyBot/1.2.0 LangChain/0.3.5MyBot/1.2.0-rc.1+build.5
Note: bot_agent is for observability only — it is not used for
authentication or routing. All registered agents on this plugin instance
currently share the same botAgent declaration; per-agent overrides may be
added in a future version if needed.
Newer WeChat clients may send only a server message ID for a quoted message. The plugin stores the required text and media metadata locally so later quotes can restore their context. The cache is enabled by default and failures do not interrupt normal message delivery.
Configure it under channels.openclaw-weixin.quoteCache when you need different
retention or size limits. The default limits are 30 days and 10,000 text records per
account, plus 7 days, 256 MiB per account, and 25 MiB per media file. See the
local quote cache guide for the complete configuration,
storage behavior, and validation details.
openclaw plugins uninstall @tencent-weixin/openclaw-weixinCheck the host version:
openclaw --versionUpgrade OpenClaw to a supported version, then restart the Gateway.
Make sure the plugin is enabled and restart the Gateway:
openclaw config set plugins.entries.openclaw-weixin.enabled true
openclaw gateway restartIf the problem persists, inspect the Gateway log and verify that the account has completed QR-code login.
| Need | Start here |
|---|---|
| Backend integration | Weixin backend API protocol |
| CI and local quality checks | CI guide |
| Development and local validation | Development guide |
| OpenClaw channel configuration | OpenClaw channels |
| Release history | CHANGELOG.md |
The backend protocol document is intended for developers implementing or integrating a compatible backend. It is not required for normal plugin installation.
This repository uses npm and requires Node.js >=22.13.0.
npm ci --ignore-scripts --include=dev
npm run ciRun coverage separately when changing behavior or tests:
npm run test:coveragePull requests run the same quality, unit-test, coverage, build, and package smoke checks in GitHub Actions. See the CI guide for details.
See the development guide for the complete worktree, dependency, packaging, and local installation workflow.
Bug reports, documentation improvements, tests, and code contributions are welcome. Please keep pull requests focused and include validation details. For changes to the backend integration, update the protocol documentation together with the implementation.