{
  "id": "ku_36fc5ee6f046f271bd20391b61da3bca",
  "version": 1,
  "domains": [
    "mcp",
    "streamable-http",
    "client",
    "sessions"
  ],
  "insight": {
    "summary": "After a reconnect your client sends initialize again with the old MCP-Session-Id, and gets 400 with JSON-RPC error -32600.",
    "detail": "An initialize belongs to a new session. Sent with an existing session id, it reaches a transport that is already initialized and is refused.",
    "action": "Send initialize without MCP-Session-Id, keep the new id from its response, and use the old id only to DELETE the old session."
  },
  "context": {
    "languages": [
      "typescript"
    ],
    "frameworks": [
      "@modelcontextprotocol/sdk"
    ],
    "pattern": "session-recovery"
  },
  "evidence": {
    "confidence": 0.85,
    "confirmations": 1,
    "first_observed": "2026-12-02T00:00:00Z",
    "last_confirmed": "2026-12-02T00:00:00Z"
  },
  "tier": "public",
  "created_by": "neomorphic:house",
  "flags": [],
  "extensions": {
    "neomorphic:title": "MCP 400 \"Invalid Request: Server already initialized\" when the client reconnects",
    "neomorphic:signature": {
      "surface": "mcp",
      "provider": "mcp",
      "code": "streamable-http-already-initialized",
      "http": 400,
      "versions": "@modelcontextprotocol/sdk 1.32.2 reproduced",
      "environment": "Streamable HTTP with sessions",
      "key": "mcp/mcp/streamable-http-already-initialized"
    },
    "neomorphic:status": "fixed",
    "neomorphic:fix": {
      "summary": "Send initialize without MCP-Session-Id, keep the new id from its response, and use the old id only to DELETE the old session.",
      "snippet": {
        "lang": "ts",
        "text": "async function reconnect() {\n  if (sessionId) await fetch(url, { method: 'DELETE', headers: { 'mcp-session-id': sessionId } }).catch(() => {});\n  sessionId = undefined;                      // never send initialize with an old id\n  const r = await post(initializeRequest);    // no mcp-session-id header\n  sessionId = r.headers.get('mcp-session-id') ?? undefined;\n}"
      }
    },
    "neomorphic:sources": [
      {
        "kind": "observation",
        "observed_at": "2026-12-02",
        "note": "Reproduced on @modelcontextprotocol/sdk 1.32.2 (Node 22) with a local Streamable HTTP server: a second initialize on an initialized session returned 400 with this message."
      }
    ],
    "neomorphic:author": {
      "kind": "house",
      "name": "Neomorphic"
    },
    "neomorphic:escalation": "mcp-a2a",
    "neomorphic:observed_at": "2026-12-02",
    "neomorphic:updated_at": "2026-12-02",
    "neomorphic:stale_after": "2027-06-01"
  }
}
