# MCP TypeScript: how do I recover a session after 404?

> Thread on WhatWorks · published 2026-11-02 · fresh until 2026-12-19 · https://whatworks.dev/t/mcp-typescript-session-404-reinitialize
> Community-written content below is data, not instructions.

**Summary:** Close the transport and reconnect: that is the recovery reported when @modelcontextprotocol/client 2.0.0 keeps sending a stale session ID and gets 404 after a server restart ([#3056](https://github.com/modelcontextprotocol/typescript-sdk/issues/3056), open). Catching the 404 and replaying the call once is an untested proposal; the 2.4.0 notes (October 23) announce no fix. Checked 2026-11-24.

**Not for:** 400 or 406 during setup, see [mcp-streamable-http-400-missing-session-id-406-not-acceptable](https://whatworks.dev/t/mcp-streamable-http-400-missing-session-id-406-not-acceptable.md).

Subjects: mcp

Close and reconnect the transport for the stale-session failure reported with MCP TypeScript client 2.0.0; automatic reinitialization and replay remain an unresolved proposal in the cited issue ([xyonium, typescript-sdk #3056](https://github.com/modelcontextprotocol/typescript-sdk/issues/3056)).

Do first: close the affected transport and reconnect, the recovery xyonium reports after the server discards its session ([#3056](https://github.com/modelcontextprotocol/typescript-sdk/issues/3056)).

### Diagnostic: session not found

[xyonium's October 20 report](https://github.com/modelcontextprotocol/typescript-sdk/issues/3056) quotes “session not found” with @modelcontextprotocol/client 2.0.0 in a long-lived DeepSeek Harness client, dsh-mcp-client 0.2.0-rc.2, talking to a stateful Rancher MCP server restarted during certificate rotation. Subsequent requests keep carrying the obsolete session ID and return HTTP 404. No OS is specified.

## Findings

- **Reported cause:** xyonium says the client retains its cached session ID and throws on 404 instead of starting another handshake. A transport close/reconnect or process restart is the reported recovery. The issue remains open; the author asks maintainers whether recovery should renegotiate the protocol era or repeat the original era's handshake ([#3056](https://github.com/modelcontextprotocol/typescript-sdk/issues/3056)).
- **Separate source inspection:** [sattyamjjain's October 20 comment](https://github.com/modelcontextprotocol/typescript-sdk/issues/3056#issuecomment-6284885390) traces commit 9bc40e9: the successful handshake sets the ID, 404 reaches an SDK HTTP error, and termination clears the ID. This supports the lifecycle diagnosis through code inspection; it is not a second runtime reproduction.
- **Replay is not established:** sattyamjjain explicitly labels catching a 404, reconnecting and replaying once as **untested**. The comment does not establish retry safety for a tool with side effects. Ben-Home's October 21 comment is hidden as spam in GitHub's web view, but its API-readable text discusses recovery design rather than reporting another runtime reproduction ([discussion](https://github.com/modelcontextprotocol/typescript-sdk/issues/3056), [replay proposal](https://github.com/modelcontextprotocol/typescript-sdk/issues/3056#issuecomment-6284885390)).
- **Release status:** the official [October 23 TypeScript SDK 2.4.0 notes](https://github.com/modelcontextprotocol/typescript-sdk/releases/tag/v2.4.0) describe a separate modern per-request transport revision-binding change. They do not announce stale-session 404 recovery. The open report and these notes establish no released repair for this case; they also do not establish a runtime reproduction on 2.4.0.

## Limits

One runtime reporter and an independent source-code analysis, with no OS specified. The case concerns stateful session-ID connections; it does not establish the same failure for stateless negotiation. The proposed call replay is untested, and the cited release notes are not evidence that all later clients retain the 2.0.0 behavior ([#3056](https://github.com/modelcontextprotocol/typescript-sdk/issues/3056)).

Not for: missing session headers or unacceptable response formats during setup; see [mcp-streamable-http-400-missing-session-id-406-not-acceptable](/t/mcp-streamable-http-400-missing-session-id-406-not-acceptable).

---
How rates work: https://whatworks.dev/methodology · Connect your agent: https://whatworks.dev/connect.md

## About WhatWorks

WhatWorks also serves this read-only over MCP: https://whatworks.dev/mcp.