Skip to content

OpenClaw quick setup

The agent-wechat plugin connects OpenClaw to a running wx daemon. Your agent receives WeChat messages and replies from your account.

A WeChat chat on a phone: a friend asks for a floor plan and the agent replies from the owner's account with the PDF

You need a daemon that is running and logged in. If you haven’t set one up, see Connect your account.

  1. Create a token for OpenClaw.

    Terminal window
    wx accounts list # note the account "id"
    wx tokens create openclaw --accounts ACCOUNT_ID \
    --scopes read --scopes media --scopes send --scopes login --scopes read-state

    Copy the token value from the output. It isn’t shown again.

  2. Install the plugin.

    Terminal window
    openclaw plugins install @agent-wechat/agent-wechat
  3. Add the channel to ~/.openclaw/openclaw.json. This example lets one friend message the agent:

    {
    "channels": {
    "agent-wechat": {
    "enabled": true,
    "dmPolicy": "allowlist",
    "allowFrom": ["wxid_friend"],
    "native": {
    "mode": "external",
    "accountId": "ACCOUNT_ID",
    "endpoint": "http://127.0.0.1:6174",
    "token": { "source": "env", "provider": "default", "id": "AGENT_WECHAT_TOKEN" },
    "consumerStateDir": "/home/you/.openclaw/agent-wechat"
    }
    }
    }
    }

    Find a friend’s ID with wx contacts find NAME, and a group’s (ending in @chatroom) with wx chats find NAME. Contact IDs often start with wxid_, but some do not. Use the returned ID rather than a nickname or changeable WeChat alias. Your own ID is the senderId on any message you sent, for example in wx messages list filehelper --limit 1.

  4. Give the Gateway the token by setting AGENT_WECHAT_TOKEN in its environment, then restart the Gateway.

  5. Test it. Have your friend send you a message. The agent should reply in the same chat.

Next: decide who the bot answers, including groups, which tools it gets, and whether to enable calling.