Summary
The transparent proxy's unknown-session guard returns a JSON-RPC -32001 (session not found) 404 whose body does not echo the incoming request's JSON-RPC id. session.NotFoundResponse builds the body via NotFoundBody(nil) (id hardcoded to null), whereas the classification-error path (mcp.ClassificationErrorResponse) does echo the request id. This is a minor consistency/asymmetry nit: a client correlating responses by id gets null for this one error class.
Where
pkg/transport/session — NotFoundResponse / NotFoundBody(nil)
- Emitted from the transparent proxy's unknown-session guard in
pkg/transport/proxy/transparent/transparent_proxy.go (RoundTrip).
Suggested fix
Thread the parsed request id through to NotFoundBody (as the classification path already does) so the 404 echoes the id.
Context
Found while writing dual-era stateless proxy e2e tests (#5837). The 404 behavior itself is correct-by-design (deliberate fail-safe: the session guard keys on Mcp-Session-Id presence, not the client-forgeable revision) — this issue is only about echoing the id for symmetry. Low priority.
Summary
The transparent proxy's unknown-session guard returns a JSON-RPC
-32001(session not found) 404 whose body does not echo the incoming request's JSON-RPCid.session.NotFoundResponsebuilds the body viaNotFoundBody(nil)(id hardcoded tonull), whereas the classification-error path (mcp.ClassificationErrorResponse) does echo the request id. This is a minor consistency/asymmetry nit: a client correlating responses by id getsnullfor this one error class.Where
pkg/transport/session—NotFoundResponse/NotFoundBody(nil)pkg/transport/proxy/transparent/transparent_proxy.go(RoundTrip).Suggested fix
Thread the parsed request id through to
NotFoundBody(as the classification path already does) so the 404 echoes the id.Context
Found while writing dual-era stateless proxy e2e tests (#5837). The 404 behavior itself is correct-by-design (deliberate fail-safe: the session guard keys on
Mcp-Session-Idpresence, not the client-forgeable revision) — this issue is only about echoing the id for symmetry. Low priority.