Skip to content

WeChat Integration

MetaBot supports WeChat personal accounts via the ClawBot plugin (iLink Bot API), allowing you to chat with Claude Code agents directly in WeChat.

Gray Testing

WeChat ClawBot is currently in gray testing. Requires iPhone WeChat 8.0.70+. Android support coming soon.

Prerequisites

  • iPhone WeChat 8.0.70+
  • Gray test access: WeChat → Me → Settings → Plugins → ClawBot
  • MetaBot installed and ready to run

Setup

Run the installer and pick 3) WeChat ClawBot as the IM platform:

curl -fsSL https://raw.githubusercontent.com/xvirobotics/metabot/main/install.sh | bash

The installer will:

  1. Generate wechatBots config in bots.json
  2. Start MetaBot and wait for QR login
  3. Display the QR login URL directly in the terminal — open it and scan to bind
  ╔══════════════════════════════════════════════╗
  ║  WeChat ClawBot — Scan QR Code to bind      ║
  ╚══════════════════════════════════════════════╝

  https://ilinkai.weixin.qq.com/...

  Open the URL above in your browser, then scan the QR code with WeChat.

Multi-platform support: pick 5) Feishu + WeChat or 6) All.

Option B: Manual Setup

1. Add WeChat Bot Config

Add a wechatBots section to your bots.json:

{
  "wechatBots": [
    {
      "name": "wechat-assistant",
      "description": "WeChat AI assistant",
      "defaultWorkingDirectory": "/home/user/project"
    }
  ]
}

2. Start MetaBot

npm run dev

On first start, the terminal displays a QR code URL:

=== WeChat QR Login ===
Open this URL or scan the QR code: https://...
Waiting for scan...

3. Scan QR Code

Scan with WeChat and confirm authorization. After confirmation:

  • Bot token is saved to data/wechat-tokens.json
  • Subsequent restarts auto-restore the session
  • Terminal shows WeChat bot is running (long polling)

Start Chatting

Send a message to ClawBot in WeChat — MetaBot handles it and replies.

Config Fields

Field Required Default Description
name Yes Bot identifier
description No Bot description
defaultWorkingDirectory Yes Working directory for Claude
wechatBotToken No Pre-authenticated iLink token (optional)
ilinkBaseUrl No https://ilinkai.weixin.qq.com iLink API URL
maxTurns No unlimited Max conversation turns
maxBudgetUsd No unlimited Max cost per request
model No SDK default Claude model

Environment Variable Mode

For a single WeChat bot, use env vars instead of bots.json:

WECHAT_ILINK_ENABLED=true
CLAUDE_DEFAULT_WORKING_DIRECTORY=/home/user/project

Message Support

Type Receive Send Notes
Text Auto-splits long text (4000 char limit)
Image CDN encrypted transfer
Voice Prefers speech-to-text transcription
File CDN encrypted transfer
Video Handled as file

Differences from Feishu/Telegram

Feature Feishu Telegram WeChat
Connection WebSocket Long polling Long polling (35s)
Message editing ✅ Streaming cards ✅ Edit messages ❌ Not supported
Progress display Real-time card updates Real-time message edits Tool progress messages + final result
Group chats ❌ Private only
Public IP Not needed Not needed Not needed

Message Updates

WeChat doesn't support editing sent messages. MetaBot sends tool progress updates every 5 seconds (e.g. 🔧 Running... ✓ Read file.ts), then sends the final result as a new message.

Troubleshooting

Q: Nothing happens after scanning? Ensure ClawBot plugin is enabled in WeChat settings and you have gray test access.

Q: Token expired? Delete the entry from data/wechat-tokens.json and restart MetaBot to re-scan.

Q: Can't send messages? WeChat requires the user to message first — the bot cannot initiate conversations (context_token required).

Q: Unstable connection? iLink long polling has a 35-second timeout. Auto-reconnects with exponential backoff (max 60s).