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
- 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.
- Heartbeat/keepalive: Periodically check SSE server health and reconnect proactively.
- Hook event: Expose an
McpServerDisconnected hook event so users can build custom recovery logic.
Related issues
Environment
- Platform: darwin
- Claude Code version: latest
- MCP transport: SSE
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
/mcpand 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:
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
McpServerDisconnectedhook event so users can build custom recovery logic.Related issues
Environment