Context
The remote MCP server now rewrites rmcp's plaintext 404 (Not Found: Session not found) into a structured JSON-RPC error envelope when a request carries an mcp-session-id header that the server has dropped (keep-alive timeout, replica restart, OOM, drain rehash). Source: OutSystems/mcp-server-remote#65.
Today the TypeScript MCP SDK that this plugin / Power uses does not inspect 404 bodies, so users still see Streamable HTTP error: ... Not Found: Session not found and must /mcp reconnect manually. The server change is a producer-side preposition — this issue tracks the consumer side that makes it actually recoverable.
Wire shape
HTTP/1.1 404 Not Found
Content-Type: application/json
{
"jsonrpc": "2.0",
"error": {
"code": -32003,
"message": "Session expired; reinitialize",
"data": {
"reason": "session_expired",
"resume": {
"method": "mentor_start",
"via": "mentor_session_token"
}
}
},
"id": null
}
Detection rule on the client: status == 404 && body.error.code == -32003. Equivalent: body.error.data.reason == "session_expired".
Asks
- Intercept the 404 response, parse the envelope.
- On match, run a transparent reinitialize (new
mcp-session-id) instead of bubbling the transport error.
- If a
mentor_session_token from the most recent terminal mentor_get_run.result is in scope, follow the resume.via hint and re-issue the current mentor turn via mentor_start with the resume token. The server now keeps that token valid through the entire MCP_SESSION_INACTIVITY_SECS window (+10 min buffer), so it won't 401 on the resume.
- Surface a single subtle UX cue ("reconnected"); don't tear down the conversation.
Out of scope
- Changing the wire shape (server-side decision).
- Re-architecting the SDK transport layer for general 404 handling — this is a targeted carve-out for the
-32003 envelope only.
Links
- Server PR: OutSystems/mcp-server-remote#65
Context
The remote MCP server now rewrites rmcp's plaintext 404 (
Not Found: Session not found) into a structured JSON-RPC error envelope when a request carries anmcp-session-idheader that the server has dropped (keep-alive timeout, replica restart, OOM, drain rehash). Source: OutSystems/mcp-server-remote#65.Today the TypeScript MCP SDK that this plugin / Power uses does not inspect 404 bodies, so users still see
Streamable HTTP error: ... Not Found: Session not foundand must/mcp reconnectmanually. The server change is a producer-side preposition — this issue tracks the consumer side that makes it actually recoverable.Wire shape
Detection rule on the client:
status == 404 && body.error.code == -32003. Equivalent:body.error.data.reason == "session_expired".Asks
mcp-session-id) instead of bubbling the transport error.mentor_session_tokenfrom the most recent terminalmentor_get_run.resultis in scope, follow theresume.viahint and re-issue the current mentor turn viamentor_startwith the resume token. The server now keeps that token valid through the entireMCP_SESSION_INACTIVITY_SECSwindow (+10 min buffer), so it won't 401 on the resume.Out of scope
-32003envelope only.Links