Discord plugin MCP server silently crashes on startup (Gateway WebSocket rejected)

Resolved 💬 2 comments Opened Apr 1, 2026 by jameshuang129-gif Closed May 8, 2026

Bug description

The Discord plugin MCP server (plugin:discord:discord) frequently fails to start or crashes shortly after startup when used with --channels plugin:discord@claude-plugins-official. Claude Code shows "Listening for channel messages" but the bot never comes online on Discord.

Steps to reproduce

  1. Run claude --channels plugin:discord@claude-plugins-official
  2. Check /mcpplugin:discord:discord shows ✘ failed
  3. No bun child process exists for the Discord MCP server
  4. Other MCP servers (gmail, zotero) start fine

Observed behavior

  • Claude Code displays "Listening for channel messages" even when the Discord plugin MCP server has failed — no visible error
  • The bun process either never spawns or crashes within seconds
  • /mcp shows plugin:discord:discord · ✘ failed
  • Manual /mcp → Reconnect sometimes works briefly but the bun process dies again
  • stderr from manual testing: discord channel: login failed: Error: WebSocket connection to 'wss://gateway.discord.gg/?v=10&encoding=json' failed: Connection ended
  • The bot token is valid (confirmed via curl to Discord REST API)
  • Running the MCP server manually with stdio works correctly (returns valid MCP initialize response)

Root cause hypothesis

When a healthcheck script or user restarts Claude Code multiple times, each restart attempts a new Discord Gateway WebSocket connection. After ~10+ restarts, Discord rate-limits the bot token's Gateway connections. The bun process then fails to connect and exits, but Claude Code doesn't surface this error clearly — it still shows "Listening for channel messages."

Key issues

  1. Silent failure: Claude Code shows "Listening" even when the Discord plugin MCP is failed. There should be a visible warning on the main screen.
  2. No retry with backoff: The plugin MCP server doesn't implement reconnection backoff, so rapid restarts trigger Discord rate limits.
  3. Startup race condition: The plugin MCP server frequently fails on initial startup but succeeds on manual /mcp Reconnect, suggesting a timing issue during Claude Code's MCP initialization.

Environment

  • Claude Code v2.1.88 and v2.1.89 (both affected)
  • macOS Darwin 25.4.0 (Apple Silicon)
  • bun 1.3.11
  • Discord plugin v0.0.4 (from claude-plugins-official)
  • Plugin path: ~/.claude/plugins/marketplaces/claude-plugins-official/external_plugins/discord/

Related issues

  • #37026 (--channels ignored)
  • #36837 (Discord plugin connected but no gateway messages on Linux)
  • #38104 (notifications/claude/channel not waking up REPL)

Workaround

  • Stop all Claude Code instances and wait 15-20 minutes for Discord rate limit to cool down
  • Restart and use /mcp → Reconnect if initial startup fails
  • Add exponential backoff to external healthcheck scripts to prevent rapid restarts

View original on GitHub ↗

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