MCP channel server crashes when receiving inbound Telegram notification

Resolved 💬 3 comments Opened Mar 20, 2026 by hanfour Closed Mar 24, 2026

Description

The Telegram channel plugin's MCP server crashes immediately upon receiving an inbound message. The server process exits when it writes a notifications/claude/channel JSON-RPC notification to stdout, suggesting Claude Code closes the server's stdin (or sends a signal) in response.

Environment

  • Claude Code: 2.1.80
  • macOS Darwin 24.6.0 (Apple Silicon)
  • Bun: 1.3.11
  • Plugin: telegram@claude-plugins-official v0.0.1

Steps to Reproduce

  1. Install telegram plugin: /plugin install telegram@claude-plugins-official
  2. Configure token: /telegram:configure <token>
  3. Pair and approve a user via /telegram:access pair <code>
  4. Set policy to allowlist: /telegram:access policy allowlist
  5. /reload-plugins
  6. DM the bot from Telegram

Expected Behavior

The inbound message should appear as a <channel source="telegram" ...> notification in the Claude Code session, and the MCP server should remain running.

Actual Behavior

The MCP server process exits immediately after writing the notifications/claude/channel JSON-RPC message to stdout. The server does not crash — Claude Code appears to terminate it.

Evidence

  • Outbound works: mcp__plugin_telegram_telegram__reply successfully sends messages to Telegram.
  • Server is stable standalone: Running bun server.ts directly (not via MCP) keeps the server alive and correctly outputs the notification JSON to stdout:

``json
{"method":"notifications/claude/channel","params":{"content":"we","meta":{"chat_id":"8036446914","message_id":"24","user":"8036446914","user_id":"8036446914","ts":"2026-03-20T14:00:16.000Z"}},"jsonrpc":"2.0"}
``

  • Server crashes under MCP: When spawned by Claude Code as an MCP server, the bun server.ts process disappears within seconds of receiving a Telegram DM. getUpdates returns empty (message was consumed) but no notification reaches the session.
  • Confirmed no webhook conflict, no multiple polling sessions, token is valid (getMe succeeds).

Additional Context

  • Multiple Claude Code sessions each spawn their own instance of the Telegram MCP server, causing Telegram polling conflicts (409). This is a secondary issue — the primary bug occurs even with a single session.
  • The experimental: { 'claude/channel': {} } capability is declared in the server's MCP capabilities.

🤖 Generated with Claude Code

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗