#Claude Code Channel Openclaw MCP

20 messages · Page 1 of 1 (latest)

ruby fog
#

Setup: OpenClaw 2026.4.11, local gateway, Mac. Using openclaw mcp serve --claude-channel-mode on to connect Claude Code as an MCP channel client.

What I'm trying to do: Use OpenClaw's MCP bridge as Claude Code's channel provider for Telegram. I have multiple Telegram bot accounts configured (default, secondary-bot, claude-bot). I want Claude Code to only receive and send through "claude-bot" account, while the main agent uses "default".

What works:

• openclaw mcp serve connects successfully
• Bridge advertises experimental.claude/channel
• DMs to claude-bot arrive as Claude channel notifications ✓
• messages_send on claude-bot DM session works ✓

What's broken:

  1. Event filtering: Claude Code receives ALL channel notifications from ALL accounts (default, secondary, claude-bot), not just claude-bot. DMs to the main agent's bot also push to Claude Code. How do I filter so only claude-bot account events reach the MCP bridge?
  2. Group outbound routing: The group session is locked to accountId: "default". When I messages_send on that session, it sends from the main bot, not claude-bot. Is there a way to specify accountId on outbound group sends, or create a per-account group session?

Config (telegram accounts):

"accounts": {
"default": { "botToken": "...", "dmPolicy": "pairing" },
"secondary": { "botToken": "...", "dmPolicy": "pairing" },
"claude-bot": { "botToken": "...", "dmPolicy": "pairing" }
}

MCP config in ~/.claude.json:

"openclaw": {
"type": "stdio",
"command": "openclaw",
"args": ["mcp","serve","--claude-channel-mode","on","--token-file","path/to/token","--url","ws://127.0.0.1:18789"]
}

for some reason, this is not working, and the event filtering is not happening, so all messages that I send in any DM are being read by both the main agents. I'm not sure what the correct configuration for this is.

sly prairieBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> âś… Mark Solution

charred egretBOT
#

I checked the docs and source, and I don’t think this is a config mistake on your side. On 2026.4.11, this looks like a current limitation.

What’s happening

  1. No account-level event filter in the MCP bridge

    • openclaw mcp serve --claude-channel-mode on subscribes with sessions.subscribe and does not pass an account filter.
    • Gateway sessions.subscribe also does not accept/filter by accountId.
    • So Claude channel notifications are effectively fed from all session.message events visible to that bridge connection, not just claude-bot.
  2. messages_send cannot override accountId

    • The MCP tool only takes session_key and text.
    • The bridge reuses the conversation’s stored route, including channel, to, accountId, and threadId.
    • So for outbound sends, it uses whatever account is already recorded on that session.
  3. Telegram group sessions are not account-scoped

    • Group session keys are shaped like agent:<agentId>:telegram:group:<id> (or ...:topic:<id> for forum topics).
    • accountId is not part of the group session key.
#
  • Per-account session isolation exists for DMs via DM scope, but not for groups.

So the direct answers are:

  • How do I filter Claude Code so it only gets claude-bot events?
    On 2026.4.11, you can’t do that with bridge config alone.

  • Can I specify accountId on outbound messages_send for a group?
    No.

  • Can I create a per-account Telegram group session on the same agent?
    Not with current routing/session-key behavior.

Best workarounds right now

  1. Best fix: run Claude Code against a separate OpenClaw gateway/config that only has the claude-bot Telegram account enabled.
    That is the clean way to make notifications and sends stay on that bot.
#
  1. Partial fix: bind claude-bot to a separate agent using an account match in bindings.
    That helps keep routes/session stores separate, but it does not stop same-gateway MCP Claude notifications from other accounts.

  2. If you control the client: use events_poll / events_wait and filter by session/account in the client.
    But Claude Code’s built-in Claude channel push mode does not give you a server-side account filter today.

Relevant docs:

I’d file this as a feature gap / bug here:

The two asks I’d put in the issue:

  • account-scoped filtering for openclaw mcp serve / sessions.subscribe
  • account-scoped Telegram group routing, or an accountId override for messages_send
#

If you want, I can help you phrase the exact GitHub issue text.

ruby fog
#

yes please

charred egretBOT
#

Yep, I’d file it like this:

Title

MCP Claude channel bridge cannot filter Telegram notifications by account, and group messages_send cannot target non-default account

Body

### Version

OpenClaw 2026.4.11

### Environment

- local gateway
#
- macOS
- Claude Code connected via MCP stdio bridge
- command:
  `openclaw mcp serve --claude-channel-mode on --token-file <path> --url ws://127.0.0.1:18789`

### What I'm trying to do

Use OpenClaw's MCP bridge as Claude Code's channel provider for Telegram in a multi-account setup.

I have multiple Telegram bot accounts configured and want:

- main agent to use `default`
- Claude Code MCP channel bridge to use only `claude-bot`

### Telegram config
#

```json5
"accounts": {
  "default": { "botToken": "...", "dmPolicy": "pairing" },
  "secondary": { "botToken": "...", "dmPolicy": "pairing" },
  "claude-bot": { "botToken": "...", "dmPolicy": "pairing" }
}

Claude MCP config

"openclaw": {
  "type": "stdio",
  "command": "openclaw",
  "args": [
#

"mcp",
"serve",
"--claude-channel-mode",
"on",
"--token-file",
"path/to/token",
"--url",
"ws://127.0.0.1:18789"
]
}


### What works

- `openclaw mcp serve` connects successfully
- bridge advertises `experimental.claude/channel`
#
- DMs to `claude-bot` arrive as Claude channel notifications
- `messages_send` on a `claude-bot` DM session works

### What is broken

#### 1. No account-level filtering for inbound channel notifications

Claude Code receives channel notifications from **all Telegram accounts** (`default`, `secondary`, `claude-bot`), not just `claude-bot`.

That means DMs sent to the main bot also show up in Claude Code's channel notifications.

#### 2. Group outbound routing is pinned to the stored session account

For Telegram group sessions, `messages_send` sends from the account already recorded on the session, which in my case is usually `accountId: "default"`.
#
I cannot find a way to:

- restrict the MCP bridge to only one Telegram account
- specify `accountId` on `messages_send`
- create a per-account Telegram group session so sends can come from `claude-bot`

### Expected behavior

At least one of these should be possible:

1. configure `openclaw mcp serve` / Claude channel mode to only subscribe to one `accountId`
2. filter inbound Claude channel notifications by `accountId`
3. specify `accountId` for outbound `messages_send`
4. support per-account Telegram group session routing
#
### Actual behavior

- bridge receives notifications for all accounts
- `messages_send` uses the session's stored route and account
- Telegram group sessions appear shared by group ID, not isolated by account

### Notes

From reading the current docs/source, this looks like a product limitation rather than a config typo:

- `messages_send` only takes `session_key` + `text`
- docs say it sends through the session's stored channel / recipient / account / thread route
- group session keys appear account-agnostic
- the MCP bridge seems to subscribe broadly to session events rather than with an account filter
#
If this is intentional, it would help to document the limitation clearly in the MCP docs.
If not intentional, this seems like a bug / missing feature for multi-account Telegram setups.

If you want, I can also tighten that into a shorter maintainer-friendly version.

ruby fog
#

yes

charred egretBOT
#

Here’s a tighter version:

### Summary

In a multi-account Telegram setup, `openclaw mcp serve --claude-channel-mode on` appears to subscribe Claude Code to **all** Telegram account events, not a specific `accountId`.

Also, for Telegram groups, `messages_send` appears to reuse the session's stored route/account and offers no way to send via a different account (for example `claude-bot` instead of `default`).

### Version

OpenClaw 2026.4.11

### Environment

- macOS
#
- local gateway
- Claude Code via MCP stdio
- command:
  `openclaw mcp serve --claude-channel-mode on --token-file <path> --url ws://127.0.0.1:18789`

### Config

Telegram accounts:

```json5
"accounts": {
  "default": { "botToken": "...", "dmPolicy": "pairing" },
  "secondary": { "botToken": "...", "dmPolicy": "pairing" },
  "claude-bot": { "botToken": "...", "dmPolicy": "pairing" }
}
#

Claude MCP:

```json
"openclaw": {
  "type": "stdio",
  "command": "openclaw",
  "args": ["mcp","serve","--claude-channel-mode","on","--token-file","path/to/token","--url","ws://127.0.0.1:18789"]
}

Repro

  1. Start MCP bridge in Claude channel mode.
  2. Configure multiple Telegram bot accounts.
#
3. Send DMs to different bot accounts (`default`, `secondary`, `claude-bot`).
4. Observe Claude Code channel notifications.
5. In a Telegram group session whose stored `accountId` is `default`, call `messages_send`.

### Actual behavior

- Claude Code receives channel notifications from **all configured Telegram accounts**
- there is no obvious way to filter bridge events to only `claude-bot`
- `messages_send` on a Telegram group session sends from the session’s stored account, for example `default`
- there is no obvious way to override `accountId` on outbound group sends
- there does not appear to be a per-account Telegram group session

### Expected behavior

At least one of these should be supported: