[Feature Request] Auto-reconnect SSE MCP servers after server-side restart

Resolved 💬 4 comments Opened Mar 2, 2026 by DanielPBak Closed Apr 3, 2026

Problem

When an SSE-based MCP server restarts (e.g., due to a deployment or process restart), all active Claude Code sessions that were connected to it become stale. The tools remain listed but every call fails silently or errors out.

The only workaround is to manually go into /mcp and reconnect in each active Claude Code session. With multiple terminals open, this is disruptive and error-prone.

Expected behavior

Claude Code should detect when an SSE MCP server connection has been invalidated (connection drop, server restart, session expiry) and automatically attempt to re-initialize the connection. This aligns with the MCP spec's session management requirements:

When a client receives HTTP 404 in response to a request containing an Mcp-Session-Id, it MUST start a new session by sending a new InitializeRequest without a session ID attached.

Source: https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#session-management

Use case

We run an internal SSE MCP server (jarvis) that provides read-only gRPC access to production data. When the server restarts, every active Claude Code instance loses its connection. Engineers typically have 2-4 Claude Code sessions open, so each restart requires manually reconnecting in each one.

Possible approaches

  1. Auto-reconnect on tool call failure: When an MCP tool call fails with a connection/session error, automatically attempt to re-initialize the server connection before surfacing the error to the user.
  2. Heartbeat/keepalive: Periodically check SSE server health and reconnect proactively.
  3. Hook event: Expose an McpServerDisconnected hook event so users can build custom recovery logic.

Related issues

  • #27528 (HTTP transport auto-reconnect)
  • #15232 (programmatic reconnect)
  • #10129 (auto-reconnect)
  • #15904 (auto-reconnect when disconnected)

Environment

  • Platform: darwin
  • Claude Code version: latest
  • MCP transport: SSE

View original on GitHub ↗

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