Skip to content
MCP Servers
Skill

/configure

Set up the WeChat channel — scan QR code to login, check channel status. Use when the user asks to configure WeChat, login, or check channel status.

BOOST
From plugin
weixin
5662 skills1 MCP
Install
$ npx -y skills add m1heng/claude-plugin-weixin --skill configure --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/configure

Context preview

The summary Claude sees to decide when to auto-load this skill.

Set up the WeChat channel — scan QR code to login, check channel status. Use when the user asks to configure WeChat, login, or check channel status.

SKILL.md

configure.SKILL.md
name: configure
description: Set up the WeChat channel — scan QR code to login, check channel status. Use when the user asks to configure WeChat, login, or check channel status.
user-invocable: true
allowed-tools:
  - Read
  - Write
  - Bash(ls *)
  - Bash(mkdir *)
  - Bash(bun *)

/weixin:configure — WeChat Channel Setup

Manages WeChat iLink Bot login and credential storage. Credentials live in `~/.claude/channels/weixin/credentials.json`.

Arguments passed: `$ARGUMENTS`

---

Dispatch on arguments

No args — status and guidance

Read both state files and give the user a complete picture:

1. **Credentials** — check `~/.claude/channels/weixin/credentials.json` for `token` and `baseUrl`. Show set/not-set; if set, show token first 6 chars masked.

2. **Access** — read `~/.claude/channels/weixin/access.json` (missing file = defaults: `dmPolicy: "pairing"`, empty allowlist). Show:

  • DM policy and what it means
  • Allowed senders: count and list
  • Pending pairings: count with codes and sender IDs

3. **What next** — concrete next step based on state:

  • No credentials → *"Run `/weixin:configure login` to scan QR code and connect."*
  • Credentials set, nobody allowed → *"Send a message to the bot on WeChat. It replies with a code; approve with `/weixin:access pair <code>`."*
  • Credentials set, someone allowed → *"Ready. Message the bot on WeChat to reach the assistant."*

`login` — QR code login

This is a TWO-STEP process. The scripts are in the plugin install directory. Find the plugin root by looking for the `login-qr.ts` file:

~/.claude/plugins/cache/m1heng-plugins/weixin/*/login-qr.ts

Use `ls` to resolve the wildcard and get the actual path.

**Step 1: Fetch and display QR code**

bun <plugin-root>/login-qr.ts

This script:

  • Fetches a QR code from `https://ilinkai.weixin.qq.com/`
  • Renders it in the terminal using `npx qrcode-terminal`
  • Shows the direct link (user can open in WeChat)
  • Outputs JSON as the last line: `{"qrcode":"...","url":"..."}`

**Wait for the user** after showing the QR code. Tell them: *"用微信扫描二维码,或在微信中打开上面的链接。扫码完成后告诉我。"*

Extract the `qrcode` value from the last line of output — you'll need it for step 2.

**Step 2: Poll for scan result**

After the user says they've scanned (or just proceed after showing the QR):

bun <plugin-root>/login-poll.ts <qrcode>

This script polls the WeChat API for scan status. It outputs one line:

  • `scaned` — user scanned, waiting for confirmation on phone
  • `expired` — QR expired (exit code 1). Offer to re-run step 1.
  • `timeout` — timed out (exit code 1). Offer to re-run step 1.
  • `{"token":"...","baseUrl":"...","accountId":"...","userId":"..."}` — success!

Credentials saved and scanner added to allowlist. (exit code 0)

On success, tell the user:

  • *"✅ 微信连接成功!"*
  • Credentials saved, user added to allowlist
  • *"重启 Claude Code 会话以启用微信频道"*

On `scaned`, tell the user *"已扫码,请在微信上点击确认..."* and note the poll script is still running.

`clear` — remove credentials

Delete `~/.claude/channels/weixin/credentials.json`.

`baseurl <url>` — set custom API base URL

For testing or alternative iLink endpoints. Read existing credentials.json, update `baseUrl`, write back.

---

Implementation notes

  • The channels dir might not exist if the server hasn't run yet. Missing file

= not configured, not an error.

  • The server reads credentials.json once at boot. Credential changes need a

session restart. Say so after saving.

  • `access.json` is re-read on every inbound message — policy changes via

`/weixin:access` take effect immediately, no restart.

  • Default API base URL is `https://ilinkai.weixin.qq.com/`.
  • The QR code URL is a WeChat mini-program link. It works when scanned with

WeChat's QR scanner OR when opened in WeChat's built-in browser.

Read more
Ships withweixin

WeChat (微信) channel plugin for Claude Code — receive and reply to WeChat messages directly in your terminal. Uses the WeChat iLink Bot API with HTTP long-poll. No public webhook needed.

Get the whole plugin
Stats
566
Stars
34
Forks
Quiet
Maintenance
TypeScript
Language
7mo ago
Last commit
7mo ago
Created
6d ago
Added

Repo: m1heng/claude-plugin-weixin

Other skills on weixin.

access
Skill

access

Manage WeChat channel access — approve pairings, edit allowlists, set DM policy. Use when the user asks to pair, approve someone,…

@m1heng@m1hengInstall Skill