{"version":"2.1.41","anchor":"mcp-session-recovery-with-automatic-retry","canonical_anchor":"mcp-session-recovery-with-automatic-retry","heading":"MCP Session Recovery with Automatic Retry","tier":null,"area":null,"scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.41\/e\/mcp-session-recovery-with-automatic-retry","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.41","markdown":"### MCP Session Recovery with Automatic Retry\n\n**What**\n\nWhen an MCP server session expires, Claude Code now automatically reconnects and retries the failed tool call.\n\n**Details**\n\n- Detects session expiration via 404 status with error code -32001 or connection close\n- Clears connection cache and triggers re-initialization\n- Automatically retries the tool call that failed due to session expiration\n- New `McpSessionExpiredError` error type for proper error handling\n\n**Evidence**\n\nMCP session recovery (search for `\"MCP session expired during tool call\"` and `\"Retrying tool\"`)"}