part…
Building governance for MCP?
The gateway applies what the guide teaches: policies on discovery, invocation and authorisation.
The gateway applies what the guide teaches: policies on discovery, invocation and authorisation.
The sentence that sums it up is in the spec itself: "MCP is a stateless protocol: all the information needed to process a request is contained in the request itself. A server processes each request independently; no state must be inferred from previous requests, not even from those sent over the same connection or stream."
This changed radically with respect to the legacy era, where the session (initialize + Mcp-Session-Id) was the container for version, capabilities and identity.
_meta.An open connection (for example a stdio process) is not a conversation or a session: clients may interleave unrelated requests over the same transport, and the server must not treat the identity of the connection as a sign of continuity.
initialize. What used to be negotiated once now always travels: io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities and (SHOULD) io.modelcontextprotocol/clientInfo.tools/list, prompts/list and resources/list MUST NOT vary per connection or as a side effect of other requests on the connection. They MAY vary according to the authorisation presented in the request (credentials = per-request input, not connection state). This is what makes shared caching possible (cacheScope: "public").InputRequiredResult with an opaque requestState and the client retries (MRTR).taskId or a basket_id is an explicit identifier; its security is covered under state handle hijacking: a handle is not authentication.subscriptions/listen is a request whose response is an open stream of notifications; its state is bounded to that request, not to the connection. If the transport drops, the client opens it again.// → tools/call
{ "name": "create_basket", "arguments": {} }
// ← result
{ "resultType": "complete", "content": [{ "type": "text", "text": "Created basket bsk_a1b2c3" }],
"structuredContent": { "basket_id": "bsk_a1b2c3" } }
// → tools/call (same or different connection, same or different process)
{ "name": "add_item", "arguments": { "basket_id": "bsk_a1b2c3", "sku": "..." } }
The server SHOULD generate handles with cryptographic randomness, SHOULD bind them server-side to the authenticated user (e.g. key <user_id>:<handle>) and MUST NOT treat possession of the handle as authentication.
_meta, its token and its arguments as the only truth.1. Can a modern server remember the client's capabilities between requests on the same connection?
Servers MUST NOT infer context from previous requests; each request is self-contained.
2. Can tools/list vary according to the authorisation token presented?
What is prohibited is varying per connection or through the effects of other requests; varying by authorisation is allowed.
3. How is state that spans several requests (e.g. a shopping basket) maintained?
The spec requires explicit handles; protocol sessions were eliminated.