{
  "markdown": "# WeChat Channel for Claude Code\n\nA [Claude Code channel](https://code.claude.com/docs/en/channels-reference) that bridges your personal WeChat account to a Claude Code session via Tencent's [iLink bot API](https://ilinkai.weixin.qq.com). Two-way messaging with permission relay support.\n\n## Features\n\n- **Two-way chat** — WeChat messages arrive in Claude's context; Claude replies back to WeChat\n- **Permission relay** — tool-approval prompts are forwarded to WeChat so you can approve/deny remotely\n- **QR code login** — scan with WeChat to authenticate, credentials persist locally\n- **Sender allowlist** — restrict which WeChat users can reach your session\n- **Cursor persistence** — poller state survives reconnects so no messages are missed\n\n## Prerequisites\n\n- [Bun](https://bun.sh) runtime (v1.3+)\n- [Claude Code](https://code.claude.com) v2.1.81+\n- A personal WeChat account\n\n## Installation\n\n### Via Plugin Marketplace (recommended)\n\nAdd the marketplace and install:\n\n```bash\n# Add the marketplace\n/plugin marketplace add uetuluk/cc-wechat\n\n# Install the plugin\n/plugin install cc-wechat@cc-wechat\n```\n\nThen start Claude Code with the channel enabled:\n\n```bash\nclaude --channels plugin:cc-wechat@cc-wechat\n```\n\n> **Note:** During the research preview, custom channels require the development flag:\n> ```bash\n> claude --dangerously-load-development-channels plugin:cc-wechat@cc-wechat\n> ```\n\n### Via Local Plugin Directory\n\n```bash\ngit clone https://github.com/uetuluk/cc-wechat.git\ncd cc-wechat\nbun install\n\nclaude --plugin-dir . --dangerously-load-development-channels server:wechat\n```\n\n### Via npm\n\n```bash\nnpm install -g @uetuluk/cc-wechat\n```\n\n## Setup\n\nOn first run, a QR code dialog appears in Claude Code — scan it with WeChat to log in. Credentials are saved locally for subsequent sessions.\n\n## How It Works\n\n```\nWeChat App <-> iLink API (ilinkai.weixin.qq.com) <-> This channel (local) <-> Claude Code (stdio)\n```\n\nThe channel runs as an MCP server spawned by Claude Code. It polls WeChat's iLink long-polling endpoint for inbound messages and uses the MCP notification system to forward them to Claude.\n\n- WeChat messages arrive in Claude's context as `<channel source=\"wechat\" from_user_id=\"...\">` tags\n- Claude replies using the `wechat_reply` tool\n- Permission prompts forward to WeChat; respond with `yes <id>` or `no <id>`\n\n## Sender Allowlist\n\nEdit `access.json` to restrict which WeChat users can message Claude:\n\n```json\n{\n  \"allowed_senders\": [\"user123@im.wechat\"]\n}\n```\n\nAn empty list allows all senders (useful during initial setup to discover your user ID from the channel tags).\n\n## Configuration\n\n| File | Purpose |\n|------|---------|\n| `.mcp.json` | MCP server config (command + args) |\n| `credentials.json` | Saved bot token (auto-created on login) |\n| `access.json` | Sender allowlist |\n| `.context-tokens.json` | Persisted context tokens for replies |\n| `.poller-state.json` | Polling cursor (survives restarts) |\n\n## Architecture\n\n```\nsrc/\n  wechat-channel.ts   # Entry point: MCP server + orchestration\n  ilink-client.ts     # iLink HTTP client (login, poll, send)\n  poller.ts           # Long-poll loop with cursor management\n  types.ts            # TypeScript types for iLink API\n```\n\n## Development\n\n```bash\nbun install\nbun test\nbun run typecheck\n```\n\n## License\n\nMIT\n",
  "bytes": 3313,
  "sha": "82bee93a4abe5188046cb5dfc530d583cea2b4a54e445cc93ed4a385abf9d141",
  "repo_slug": "uetuluk/cc-wechat",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_uetuluk_cc_wechat_cc_wechat_180d5ad7/readme"
}