Skip to main content

Channels — 外部频道消息接入

启动参数:--channels / --dangerously-load-development-channels 状态:已解除 feature flag 和 OAuth 限制,可直接使用

概述

Channel 是一个 MCP 服务器,它将外部事件推送到你运行中的 Claude Code 会话中,以便 Claude 可以在你不在终端时做出反应。详细使用说明请参考以下文档: 本仓库现在内置了 微信 WeChat channel,不需要单独安装外部 marketplace 插件。

快速开始

# 启用频道监听(plugin 格式)
ccb --channels plugin:feishu@claude-code-feishu-channel

# 启用内置微信 channel
ccb weixin login
ccb --channels plugin:weixin@builtin

# 启用频道监听(server 格式)
ccb --channels server:my-slack-bridge

# 同时启用多个频道
ccb --channels plugin:feishu@claude-code-feishu-channel --channels server:discord-bot

# 开发模式(跳过 allowlist 检查,用于测试自定义 channel)
ccb --dangerously-load-development-channels server:my-custom-channel

支持的 Channel

Channel说明来源
Telegram官方 Telegram Bot 集成/plugin install telegram@claude-plugins-official
Discord官方 Discord Bot 集成/plugin install discord@claude-plugins-official
iMessagemacOS 原生消息/plugin install imessage@claude-plugins-official
飞书 (Feishu/Lark)双向消息、群组聊天、文件附件/plugin install feishu@claude-code-feishu-channel
微信 (WeChat)内置 channel,支持扫码登录、双向消息、附件透传ccb weixin login + ccb --channels plugin:weixin@builtin

微信内置 Channel

登录

ccb weixin login
已登录状态可清除:
ccb weixin login clear

会话启用

ccb --channels plugin:weixin@builtin

配对授权

首次收到未授权微信用户消息时,weixin channel 会回一条 6 位 pairing code。运营侧可在终端执行:
ccb weixin access pair <code>
确认后,该微信用户后续消息才会进入 Claude Code 会话。

相关文件

文件职责
src/services/mcp/channelNotification.ts频道 gate 逻辑、消息包装
src/services/mcp/channelAllowlist.ts频道开关(已默认开启)
src/services/mcp/useManageMCPConnections.tsMCP 连接管理中的频道注册
src/components/LogoV2/ChannelsNotice.tsx启动时频道状态提示
src/main.tsx--channels 参数解析
src/interactiveHelpers.tsxDev channels 确认对话框

参考链接