MCP servers with singleton resources conflict across concurrent sessions

Resolved 💬 4 comments Opened Mar 28, 2026 by fatcatMaoFei Closed May 16, 2026

Summary

When running two Claude Code sessions on the same machine, both sessions independently spawn their own MCP server processes. For MCP servers that rely on singleton resources (e.g., Telegram bot long-polling, which only allows one active getUpdates connection per bot token), the second session's MCP process kills the first session's connection, causing a 409 Conflict from the Telegram API.

The key issue: even if the user only intends to use Telegram in one session, all sessions auto-load globally configured MCP plugins, so the second session starts polling the same bot token without the user's intent.

Steps to Reproduce

  1. Configure a Telegram MCP plugin globally in ~/.claude.json
  2. Start Claude Code session A — Telegram polling works fine
  3. Start Claude Code session B (for any other purpose, e.g., Remote Control) — Session B auto-loads the Telegram MCP plugin and starts polling the same bot token
  4. Session A's Telegram connection breaks (409 Conflict), stops receiving messages

Expected Behavior

  • Globally configured MCP servers should either support a "singleton" / "shared" mode, where only one session owns the process and others share or skip it
  • Or there should be a way to mark certain MCP servers as "on-demand only" so they don't auto-load in every session
  • At minimum, if an MCP server detects a 409 Conflict or similar exclusive-resource error, it should back off rather than silently stealing the connection

Current Workaround

  • Only run one Claude Code session at a time (defeats the purpose of multi-session workflows)
  • Use both channels (e.g., Telegram + Remote Control) in the same session (wastes context window)

Related Issues

  • #18762 — Plugin-MCP Configuration Mismatch (documents race conditions with 30+ concurrent sessions)
  • #29058 — Docker-based MCP server containers not stopped when session ends (confirms per-session isolation)
  • #15320 — Port conflict when multiple mcp-remote instances start simultaneously

Environment

  • Claude Code CLI (latest)
  • macOS
  • Telegram MCP plugin using long-polling (getUpdates)

View original on GitHub ↗

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