
roxorlt/cc2wx
Developer toolsThis page was translated automatically. Technical details may differ from the original. View the original
Claude Code ↔ WeChat bridge via MCP Channel protocol
Overview
— 本项目依赖 Claude Code Channels(research preview)和微信 ClawBot(灰度测试中),两者均为实验性功能,随时可能变更。 cc2wx 是一个 MCP Channel Server,通过微信 iLink Bot API 接收微信消息,再通过 Claude Code 的 Channel 协议 实时推送给本地运行的 Claude Code 会话。Claude 的回复通过 weixin_reply 工具发回微信。 - >= 18 - >= 2.1.81(需支持 Channels 和 Permission Relay) - — 打开微信 → 我 → 设置 → 插件,看是否有「微信 ClawBot」。如果没有,说明你的微信号尚未被灰度到,暂时无法使用 - (macOS 下自动使用 caffeinate 防休眠,Linux 直接运行) 终端会显示二维码,用微信扫码确认授权。登录成功后自动启动 Claude Code。 凭证保存在 ~/.weixin-bot/credentials.json,后续无需重复扫码。 cc2wx 支持 Claude Code 的 Permission Relay 协议。当 Claude 需要执行敏感操作时(如运行 Bash 命令、编辑文件),权限请求会转发到你的微信,你可以在手机上批准或拒绝。 「始终批准」的工具列表保存在 ~/.cc2wx/always-allow.json,重启后仍然有效。删除该文件即可重置。 如果你确定只在可信环境中使用,也可以添加 --dangerously-skip-permissions 跳过所有权限确认。此参数**,意味着 Claude Code 可以不经确认地执行任意 Bash 命令、编辑文件等。微信消息会作为 prompt 输入,理论上存在 prompt injection 风险。
Install
npx tsx cc2wx.tsConfiguration
{
"mcpServers": {
"cc2wx": {
"command": "npx",
"args": ["tsx", "cc2wx.ts"],
"env": {
"CC2WX_ALLOWED_USERS": "your_user_id"
}
}
}
}