🚧 Boundary rule: every failure should come from the layer that owns the
missing fact. Identity and config failures are HTTP responses before MCP
handling; routing and backend failures are JSON-RPC errors.
InitializeCallValidator and AuthorizedCallValidator re-check the request
context before method handling. These are defense-in-depth errors: in a
healthy stack the middleware has already established the context.
Failure
JSON-RPC error
Missing session id, user config, virtual host id, or claims extension
Internal error (Routing problem...).
Virtual host absent from the user config
RESOURCE_NOT_FOUND with message No configuration. Normally unreachable because virtual_host_config_layer already returned 404.
The backend is stored with no running service. initialize still succeeds with the remaining backends.
Backend unreachable during a routed call
The call returns an internal error; other backends are unaffected.
Gateway process restart
All backend session state is lost because it is local process state. Clients must re-run initialize.
Request lands on a gateway node that does not own the session
List calls return empty results and routed calls fail, because BackendTransports has no entries there. Stateful sessions need sticky routing; see Session Ownership.