claude-code-wechat-channel
v0.2.0
Published
Claude Code Channel plugin for WeChat — bridge WeChat messages into Claude Code sessions via the official ilink API
Downloads
550
Maintainers
Readme
Claude Code WeChat Channel
将微信消息桥接到 Claude Code 会话的 Channel 插件。
基于微信官方 ClawBot ilink API(与 @tencent-weixin/openclaw-weixin 使用相同协议),让你在微信中直接与 Claude Code 对话。
工作原理
微信 (iOS) → WeChat ClawBot → ilink API → [本插件] → Claude Code Session
↕
Claude Code ← MCP Channel Protocol ← wechat_reply tool前置要求
- Node.js >= 18(或 Bun >= 1.0)
- Claude Code >= 2.1.80
- claude.ai 账号登录或 API key(
ANTHROPIC_API_KEY) - 微信 iOS 最新版(需支持 ClawBot 插件)
快速开始
1. 微信扫码登录
npx claude-code-wechat-channel setup终端会显示二维码,用微信扫描并确认。凭据保存到 ~/.claude/channels/wechat/account.json。
2. 生成 MCP 配置
npx claude-code-wechat-channel install这会在当前目录生成(或更新) .mcp.json,指向本插件。
3. 启动 Claude Code + WeChat 通道
claude --dangerously-load-development-channels server:wechat4. 在微信中发消息
打开微信,找到 ClawBot 对话,发送消息。消息会出现在 Claude Code 终端中,Claude 的回复会自动发回微信。
命令说明
| 命令 | 说明 |
|------|------|
| npx claude-code-wechat-channel setup | 微信扫码登录 |
| npx claude-code-wechat-channel install | 生成 .mcp.json 配置 |
| npx claude-code-wechat-channel start | 启动 MCP Channel 服务器 |
| npx claude-code-wechat-channel help | 显示帮助 |
技术细节
- 消息接收: 通过
ilink/bot/getupdates长轮询获取微信消息 - 消息发送: 通过
ilink/bot/sendmessage发送回复 - 认证: 使用
ilink/bot/get_bot_qrcodeQR 码登录获取 Bearer Token - 协议: 基于 MCP (Model Context Protocol) 的 Channel 扩展
注意事项
- 当前为 research preview 阶段,需要使用
--dangerously-load-development-channels标志 - Claude Code 会话关闭后通道也会断开
- 微信 ClawBot 目前仅支持 iOS 最新版
- 每个 ClawBot 只能连接一个 agent 实例
License
MIT
