Skip to content

Channels: Push External Events into Sessions [Beta] โ€‹

Beta Feature: Channels is currently in Beta. Features and interfaces may be adjusted based on feedback.

A Channel is an MCP server that pushes messages, alerts, and webhooks into your running CodeBuddy Code session, allowing CodeBuddy Code to react to external events even when you're not at the terminal.

Channels can be two-way: CodeBuddy Code reads events and replies through the same channel, acting like a chat bridge. Events only arrive while a session is open; for continuous operation, run CodeBuddy Code in a background process or persistent terminal.

You can enable channels by installing plugins or using built-in channels. WeChat, Telegram, Discord, and the fakechat demo are all supported.

When CodeBuddy Code replies through a channel, the terminal shows the tool call and confirmation (e.g., "sent"), while the actual reply content appears on the corresponding chat platform.

This page covers:

To build your own channel, see the Channels Reference.

Supported Channels โ€‹

WeChat (Built-in) โ€‹

The WeChat channel is built into CodeBuddy Code and requires no plugin installation. It enables two-way messaging through WeChat ClawBot, supporting text, images, and file exchange.

Prerequisites:

  • WeChat version iOS 8.0.70 or above
  • Enable the ClawBot plugin in WeChat (WeChat > Me > Settings > Plugins > ClawBot)

QR Code Binding:

  1. In CodeBuddy Code, run /remote-control wechat or /remote-control and select wechat
  2. The terminal displays a QR code (if the QR code doesn't render correctly, a browser link will be provided)
  3. Scan the QR code with WeChat and confirm
  4. After successful binding, message reception starts automatically

Usage:

After binding, send messages in the WeChat ClawBot conversation, and they will automatically appear in the CodeBuddy Code session:

#wechat ยท user_id: Hello, help me look at this bug

CodeBuddy Code processes the message and replies via the WechatReply tool, with the reply appearing in WeChat.

Supported message types:

TypeReceiveSend
TextSupportedSupported
ImageSupported (auto-downloaded and decrypted locally)Supported (auto-encrypted and uploaded to CDN)
FileSupportedSupported

Credential Management:

After successful QR code scanning, credentials are saved to ~/.codebuddy/channels/wechat/credentials.json. On next startup, saved credentials are used automatically without re-scanning.

bash
# Check connection status
/remote-control wechat status

# Disconnect
/remote-control wechat stop

# Reconnect (using saved credentials)
/remote-control wechat start

Telegram โ€‹

Requires plugin installation. See the full Telegram plugin source.

  1. Create a bot via BotFather in Telegram and obtain a token
  2. Install the plugin: /plugin install telegram@claude-plugins-official
  3. Configure the token: /telegram:configure <token>
  4. Start: codebuddy --channels plugin:telegram@claude-plugins-official
  5. Send a message to the bot to get a pairing code, then run /telegram:access pair <code> to complete pairing

Discord โ€‹

Requires plugin installation. See the full Discord plugin source.

  1. Create an application and bot in the Discord Developer Portal
  2. Enable Message Content Intent and invite the bot to your server
  3. Install the plugin: /plugin install discord@claude-plugins-official
  4. Configure the token: /discord:configure <token>
  5. Start: codebuddy --channels plugin:discord@claude-plugins-official
  6. DM the bot to get a pairing code, then run /discord:access pair <code> to complete pairing

fakechat (Demo) โ€‹

fakechat is an officially supported demo channel that runs a chat UI on localhost, requiring no authentication or external services.

bash
# Install
/plugin install fakechat@claude-plugins-official

# Start
codebuddy --channels plugin:fakechat@claude-plugins-official

Open http://localhost:8787 to start chatting.

Quick Start โ€‹

Using the WeChat channel as an example, here's a quick walkthrough of the full two-way communication flow:

Step 1: Ensure ClawBot is Enabled

In WeChat, go to Me > Settings > Plugins, find ClawBot and enable it.

Step 2: QR Code Binding

Start CodeBuddy Code and run:

/remote-control wechat

The terminal displays a QR code. Scan it with WeChat and confirm the binding.

Step 3: Send a Message

In the WeChat ClawBot conversation, send:

Help me check what files are in the current directory

The message arrives in the CodeBuddy Code session, displayed as:

#wechat ยท user_id: Help me check what files are in the current directory

CodeBuddy Code executes the task and replies via the WechatReply tool, with the reply appearing in WeChat.

Step 4: Send an Image

Send a screenshot to ClawBot in WeChat. CodeBuddy Code will automatically download and recognize the image content. You can ask it to edit the image and send it back:

Add a hat to the person in the image

CodeBuddy Code uses the ImageEdit tool to process the image, then sends the edited image back to WeChat via WechatReply.

Security โ€‹

WeChat โ€‹

The WeChat channel ensures security through ClawBot's QR code authentication mechanism. Only the WeChat account that completed the QR code binding can send messages; messages from others are silently discarded.

Credentials (containing bot_token and account_id) are saved locally with permissions set to 600 (owner read/write only).

Plugin Channels โ€‹

Plugin channels like Telegram and Discord maintain a sender allowlist. Trusted senders are added through a pairing flow:

  1. Send any message to the bot
  2. The bot replies with a pairing code
  3. Confirm the pairing code in CodeBuddy Code
  4. The sender's ID is added to the allowlist

The allowlist also controls permission relay. People who reply through a channel can approve or deny tool calls, so only add trusted senders to the allowlist.

Other Security Considerations โ€‹

  • Configuring in .mcp.json alone is not sufficient to push messages; the channel must also be specified in --channels
  • Organizations can enforce unified controls via the channelsEnabled setting

Organization Controls โ€‹

Channel functionality is controlled by the channelsEnabled setting:

Plan TypeDefault Behavior
Individual usersAvailable; users enable per-session via --channels
Team/EnterpriseDisabled by default; admins must explicitly enable

Enabling Channels for Organizations โ€‹

Admins can set this in settings.json:

json
{
  "channelsEnabled": true
}

Once enabled, users in the organization can use --channels to connect channel servers to their sessions. If the setting is disabled, MCP servers still connect and tools remain available, but channel messages will not arrive.

Feature Comparison โ€‹

CodeBuddy Code has multiple features for connecting to external systems, each suited to different scenarios:

FeaturePurposeUse Case
Standard MCP ServerCodeBuddy Code queries it during tasks; does not push to sessionOn-demand reading or querying systems
Remote ControlControl a local session from remoteOperating an active session when away from your desk
ChannelPushes external events into a running local sessionChat bridges, webhook reception, alert response

Channels fill the gap by pushing events from non-CodeBuddy Code sources into a running local session:

  • Chat bridge: Ask CodeBuddy Code questions via WeChat, with answers appearing in WeChat, while the actual work runs on your machine using your real files
  • Webhook receiver: When webhooks from CI, error trackers, or deployment pipelines arrive, CodeBuddy Code already has your files open and remembers what you were debugging

Next Steps โ€‹

  • Build your own Channel: Create a channel for systems that don't have a plugin yet
  • Use /remote-control to manage all remote control connections