LinekForge/claude-code-wechat
让 Claude Code 住进你的微信——收消息、发文件、定时问好、远程审批
Platform-specific configuration:
{
"mcpServers": {
"claude-code-wechat": {
"command": "npx",
"args": [
"-y",
"claude-code-wechat"
]
}
}
}Add the config above to .claude/settings.json under the mcpServers key.
让 Claude Code 住进你的微信——收消息、发文件、定时问好、远程审批,像一个真正在的人。
基于微信官方 ClawBot ilink API + Anthropic 官方 Channels 协议。不逆向,不模拟协议。
微信 (iOS) → ClawBot → ilink API → [本插件] → Claude Code Session
↕
Claude Code ← wechat_reply / wechat_send_file → ilink API → 微信1. 扫码登录
npx claude-code-wechat setup2. 生成 MCP 配置
npx claude-code-wechat install3. 启动
claude --dangerously-load-development-channels server:wechat打开微信,找到 ClawBot,发消息。终端里出现,Claude 回复自动发回微信。
<details> <summary>从源码安装</summary>
git clone https://github.com/LinekForge/claude-code-wechat.git
cd claude-code-wechat
bun install
bun setup.ts</details>
<details> <summary>白名单管理</summary>
首次使用时,第一个发消息的人自动加入白名单。也可以手动管理:
npx claude-code-wechat setup --allow <id> <昵称>
npx claude-code-wechat setup --list</details>
wechat-channel.ts ← 主入口:MCP Server + 工具 + 轮询
├── types.ts ← 接口和常量
├── config.ts ← 路径、CDN、超时、日志
├── allowlist.ts ← 白名单管理
├── ilink-api.ts ← ilink HTTP 调用层
├── media.ts ← 媒体加解密、CDN 上传下载
├── chat-log.ts ← 聊天记录持久化和回放
└── heartbeat.ts ← 心跳调度和热加载
setup.ts ← 独立 CLI:扫码登录 + 白名单管理接收(微信 → Claude)
| 类型 | 处理方式 | |------|---------| | 文字 | 直接转发 | | 图片 | CDN 下载 + AES 解密,Claude 可查看 | | 文件 | CDN 下载 + AES 解密,Claude 可读取 | | 视频 | CDN 下载 + ffmpeg 抽帧,Claude 可查看关键帧 | | 语音 | 微信 ASR 自动转文字 | | 引用 | 显示被引用的原文 |
发送(Claude → 微信)
| 类型 | 使用方式 | |------|---------| | 文字 | `wechat_reply
Loading reviews...