Desktop app clobbers CLI plugin MCP servers when viewing shared session
Bug Description
When a Claude Code CLI session with active plugin-managed MCP servers (e.g., the Telegram plugin) is opened/viewed in the Claude Desktop Mac app, the Desktop app calls replaceRemoteMcpServers and overwrites the session's MCP server list with its own set — dropping any CLI-managed plugin servers that aren't in the Desktop app's configuration.
This kills the plugin MCP server connection and requires the user to run /mcp in the CLI to reconnect.
Steps to Reproduce
- Start a Claude Code CLI session with the Telegram plugin enabled (
enabledPlugins: { "telegram@claude-plugins-official": true }) - Confirm the Telegram MCP server is connected and working (send/receive messages)
- Open the same session in the Claude Desktop Mac app
- Return to the CLI — the Telegram MCP tools are gone (
No such tool available: mcp__plugin_telegram_telegram__reply) - Run
/mcpto reconnect
Evidence from Logs
Desktop app log (~/Library/Logs/Claude/main.log) shows the moment the session was opened in the Desktop app:
17:56:42 [info] [CCD] LocalSessions.replaceEnabledMcpTools: sessionId=local_f1a8f1be-..., toolCount=46
17:56:43 [info] [CCD] LocalSessions.replaceRemoteMcpServers: sessionId=local_f1a8f1be-..., serverCount=3
17:56:43 [info] [CCD] [replaceRemoteMcpServers] Calling SDK with 9 total servers {
serverNames: ['Gmail', 'Google Calendar', 'gdrive', 'Claude in Chrome', 'mcp-registry', 'Claude Preview', 'Control Chrome', 'docker', 'scheduled-tasks']
}
Note: Telegram is absent from the server list. The Desktop app replaced the session's MCP config with its own, which doesn't include CLI plugin-managed servers.
Plugin source (server.ts lines 564-578) confirms the mechanism — the Telegram MCP server listens for stdin EOF/close and calls shutdown():
process.stdin.on('end', shutdown)
process.stdin.on('close', shutdown)
When the Desktop app replaces the MCP servers, the CLI's stdio pipe to the Telegram process is severed, triggering a clean shutdown.
Expected Behavior
The Desktop app should merge its MCP servers with any existing CLI plugin-managed servers rather than replacing them, or at minimum preserve CLI plugin servers when viewing a shared session.
Environment
- macOS (Darwin 24.6.0)
- Claude Code CLI with Telegram plugin (
telegram@claude-plugins-official) - Claude Desktop Mac app
- Reproducible 100% of the time
Workaround
Run /mcp in the CLI after the Desktop app disconnects the plugin server. Avoid opening active CLI sessions in the Desktop app when plugin MCP servers need to stay connected.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗