cc2wx logo

cc2wx

Community
roxorlt

Claude Code ↔ WeChat bridge via MCP Channel protocol

Publisherroxorlt
Repositorycc2wx
LanguageJavaScript
Forks
4
Stars
10
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    cc2wx exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    10 stars and 4 forks from the linked repository.

cc2wx

   ██████╗ ██████╗██████╗ ██╗    ██╗██╗  ██╗
  ██╔════╝██╔════╝╚════██╗██║    ██║╚██╗██╔╝
  ██║     ██║      █████╔╝██║ █╗ ██║ ╚███╔╝
  ██║     ██║     ██╔═══╝ ██║███╗██║ ██╔██╗
  ╚██████╗╚██████╗███████╗╚███╔███╔╝██╔╝ ██╗
   ╚═════╝ ╚═════╝╚══════╝ ╚══╝╚══╝ ╚═╝  ╚═╝
      Claude Code ↔ WeChat Bridge
              by roxorlt

用手机微信和本地 Claude Code 实时对话。

Experimental — 本项目依赖 Claude Code Channels(research preview)和微信 ClawBot(灰度测试中),两者均为实验性功能,随时可能变更。

Read this in English

工作原理

cc2wx 是一个 MCP Channel Server,通过微信 iLink Bot API 接收微信消息,再通过 Claude Code 的 Channel 协议 实时推送给本地运行的 Claude Code 会话。Claude 的回复通过 weixin_reply 工具发回微信。

前提条件

  • Node.js >= 18
  • Claude Code CLI >= 2.1.81(需支持 Channels 和 Permission Relay)
  • 微信 ClawBot 灰度资格 — 打开微信 → 我 → 设置 → 插件,看是否有「微信 ClawBot」。如果没有,说明你的微信号尚未被灰度到,暂时无法使用
  • macOS / Linux(macOS 下自动使用 caffeinate 防休眠,Linux 直接运行)

快速开始

方式一:npx 一键运行(推荐)

bash
npx cc2wx login    # 首次:扫码登录 → 自动启动 Claude Code
npx cc2wx start    # 后续:使用已保存凭证启动

方式二:从源码运行

bash
git clone https://github.com/roxorlt/cc2wx.git
cd cc2wx
npm install
npm run login      # 首次登录
npm start          # 后续启动

登录流程

终端会显示二维码,用微信扫码确认授权。登录成功后自动启动 Claude Code。

凭证保存在 ~/.weixin-bot/credentials.json,后续无需重复扫码。

启动后

在手机微信里给自己的微信号发消息,Claude Code 会实时收到并回复。

底层等价于:

bash
caffeinate -i claude \
  --dangerously-load-development-channels server:cc2wx \
  --effort max

权限确认(Permission Relay)

cc2wx 支持 Claude Code 的 Permission Relay 协议。当 Claude 需要执行敏感操作时(如运行 Bash 命令、编辑文件),权限请求会转发到你的微信,你可以在手机上批准或拒绝。

无需 --dangerously-skip-permissions,所有权限确认通过微信完成。

微信收到的权限提示:

🔐 Claude 请求权限
工具: Bash
说明: List files in current directory

ls -1 /Users/you/project/

回复 yes 批准 / always 始终批准 / no 拒绝
回复效果
yes / ok / 好 / y批准本次操作
always / 始终 / 总是批准并记住,同类工具后续自动批准
no / 不 / 拒绝 / n拒绝本次操作

「始终批准」的工具列表保存在 ~/.cc2wx/always-allow.json,重启后仍然有效。删除该文件即可重置。

安全须知

Permission Relay vs --dangerously-skip-permissions

推荐使用 Permission Relay(默认行为)。通过微信逐一确认每个敏感操作,安全可控。

如果你确定只在可信环境中使用,也可以添加 --dangerously-skip-permissions 跳过所有权限确认。此参数跳过所有权限确认,意味着 Claude Code 可以不经确认地执行任意 Bash 命令、编辑文件等。微信消息会作为 prompt 输入,理论上存在 prompt injection 风险。

userId 白名单

设置白名单只允许你自己的微信 userId 触发 Claude:

在 .mcp.json 中配置:

json
{
  "mcpServers": {
    "cc2wx": {
      "command": "npx",
      "args": ["tsx", "cc2wx.ts"],
      "env": {
        "CC2WX_ALLOWED_USERS": "your_user_id"
      }
    }
  }
}

或通过环境变量:

bash
CC2WX_ALLOWED_USERS=your_user_id npm start

首次运行不设白名单,发一条消息后在终端日志中找到 from=xxx 获取你的 userId。

caffeinate -i

npm start 和 npm run login 使用 caffeinate -i 阻止 macOS 空闲休眠(屏幕可以关闭),确保息屏后微信消息仍能送达。Claude Code 退出时 caffeinate 自动结束。

命令

npx 方式

命令说明
npx cc2wx login扫码登录 → 保存凭证 → 自动启动 Claude Code
npx cc2wx start使用已保存凭证启动 Claude Code(含防休眠)
npx cc2wx serve单独运行 MCP server(调试用,不启动 Claude)

源码方式

命令说明
npm run login扫码登录 → 保存凭证 → 自动启动 Claude Code
npm start使用已保存凭证启动 Claude Code(含防休眠)
npm run serve单独运行 MCP server(调试用,不启动 Claude)

特性

  • 微信消息实时推送到 Claude Code 会话
  • 长回复自动分段发送(每段 ≤ 2000 字,按段落拆分)
  • 权限确认转发到微信(Permission Relay),无需 --dangerously-skip-permissions
  • 「始终批准」持久化,常用操作无需重复确认
  • 登录凭证本地持久化,无需重复扫码
  • 息屏防休眠,合盖也能保持通信
  • userId 白名单过滤

已知限制

  • ClawBot 灰度 — 微信 ClawBot 功能尚在灰度测试中,不是所有微信号都能用
  • Channels research preview — Claude Code 的 Channel 功能也是实验性的
  • 单 context_token 回复上限 — iLink API 每条收到的消息最多回复约 10 条,超长回复可能丢失尾段
  • 语音转录依赖 ClawBot STT — 语音消息使用 ClawBot 服务端转录,转录失败时无法处理
  • macOS / Linux — macOS 自动 caffeinate 防休眠,Linux 直接运行(Windows 未测试)

更新日志

v1.3.2 (2026-03-24)

  • 解决了一些bug

v1.3.1 (2026-03-24)

  • 修复多条 permission 同时到达时的时序冲突问题

v1.3.0 (2026-03-24)

  • 支持接收来自微信的文件和语音消息

v1.2.0 (2026-03-24)

  • 支持接收来自微信的图片和视频消息

v1.1.0 (2026-03-24)

  • Permission Relay — 权限确认转发到微信,回复 yes/always/no,不再需要 --dangerously-skip-permissions
  • Always Allow 持久化 — 常用工具「始终批准」后自动通过,列表保存在 ~/.cc2wx/always-allow.json,重启不丢失

v1.0.2 (2026-03-23)

  • 支持 npx cc2wx 一键运行

v1.0.0 (2026-03-23)

  • 首次发布
  • 微信消息实时桥接到 Claude Code
  • macOS 防休眠

致谢

License

MIT


English

cc2wx bridges your WeChat messages to a local Claude Code session in real time.

How it works

Prerequisites

  • Node.js >= 18, Claude Code CLI >= 2.1.81
  • WeChat with ClawBot plugin access (currently in grayscale rollout — not all accounts have it)
  • macOS or Linux (macOS auto-wraps with caffeinate to prevent idle sleep)

Quick start

bash
npx cc2wx login   # first time: scan QR → auto-launches Claude Code
npx cc2wx start   # subsequent runs (reuses saved credentials)

Or from source:

bash
git clone https://github.com/roxorlt/cc2wx.git && cd cc2wx && npm install
npm run login   # scan QR → auto-launches Claude Code
npm start       # subsequent runs

Permission Relay

When Claude needs to run sensitive operations, approval prompts are forwarded to your WeChat. Reply yes to approve once, always to auto-approve that tool type going forward, or no to deny. No --dangerously-skip-permissions needed.

The always-allow list is persisted at ~/.cc2wx/always-allow.json. Delete it to reset.

Security

Set CC2WX_ALLOWED_USERS to your WeChat userId (find it in startup logs) to restrict who can interact with Claude through your session.

License

MIT

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "roxorlt-cc2wx": {
      "command": "npx",
      "args": [
        "-y",
        "cc2wx"
      ]
    }
  }
}

Use cc2wx MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once cc2wx is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add cc2wx as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the cc2wx MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "roxorlt-cc2wx": {
      "command": "npx",
      "args": [
        "-y",
        "cc2wx"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the cc2wx MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the cc2wx MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use cc2wx to help me with this task?
cc2wx
Sure. I read it.
Here is what I found using cc2wx.

Frequently asked questions

What is the cc2wx MCP server used for?

cc2wx is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use cc2wx MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use cc2wx with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use cc2wx MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With cc2wx connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect cc2wx MCP to TypingMind?

cc2wx runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does cc2wx MCP provide in TypingMind?

cc2wx exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use cc2wx MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If cc2wx requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇