Telegram channel MCP server dies shortly after startup on Windows

Resolved 💬 7 comments Opened Mar 21, 2026 by AhSnahp Closed May 23, 2026

Telegram channel MCP server dies shortly after startup on Windows

Environment

  • Claude Code: v2.1.81
  • OS: Windows 11 Pro (10.0.26200)
  • Shell: Git Bash (MINGW64)
  • Bun: 1.3.11
  • Node: v24.14.0
  • Plugin: telegram@claude-plugins-official (v0.0.1, commit 61c0597779bd)
  • Auth: claude.ai (Pro/Max, not Team/Enterprise)

Description

The Telegram channel plugin's MCP server starts and processes initial messages, then silently dies. After the crash, the bot stops responding to Telegram messages entirely. Claude Code continues running normally — only the channel server process is gone.

Steps to reproduce

  1. Install the Telegram plugin: /plugin install telegram@claude-plugins-official
  2. Configure the token: /telegram:configure <token>
  3. Start with channels: claude --channels plugin:telegram@claude-plugins-official
  4. Startup banner confirms: Listening for channel messages from: plugin:telegram@claude-plugins-official
  5. DM the bot on Telegram — it responds with a pairing code (server is alive)
  6. Approve the pairing: /telegram:access pair <code>
  7. Wait ~2-3 minutes
  8. Send another message on Telegram — no response

Diagnosis

After the bot stops responding, calling the Telegram Bot API directly confirms no one is polling:

curl "https://api.telegram.org/bot<token>/getUpdates?limit=1&timeout=0"
# Returns pending updates (200 OK, result array non-empty)
# If the server were polling, this would return 409 Conflict or empty results

tasklist | grep bun shows no bun processes running — the server process has exited.

Manual run works fine

Running the server manually with stdin held open works correctly and maintains polling indefinitely:

cd ~/.claude/plugins/cache/claude-plugins-official/telegram/0.0.1
sleep 60 | bun server.ts 2>&1
# Output: "telegram channel: polling as @MothsLightbot"
# Server stays alive and responds to messages for the full 60 seconds

This suggests the issue is in how Claude Code manages the child process stdio pipes on Windows, not in the server itself.

Expected behavior

The channel MCP server should remain running for the lifetime of the Claude Code session, maintaining the Telegram long-polling connection.

Actual behavior

The server starts, processes a few initial messages (pairing codes), then exits silently. No error output visible in the terminal. The --channels startup banner remains, but the underlying bun process is gone.

Possible cause

The server uses StdioServerTransport from @modelcontextprotocol/sdk. On Windows, stdio pipe handling for child processes may differ from Unix — if the pipe buffer fills or a write fails, the transport closes and the server interprets it as a shutdown signal. The server's shutdown handler (telegram channel: shutting down) fires, and the async bot-polling IIFE is canceled.

Workaround

None found. The server cannot be run standalone because it requires the MCP stdio connection to Claude Code to deliver channel events.

View original on GitHub ↗

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