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 2026-07-28 spec introduces an explicit vocabulary for coexistence with earlier revisions. This lesson is probably the most important one in the guide for your gateway.
2026-07-28 and later).initialize (2025-11-25 and earlier).The era is a property of the server, not of a request. The client detects it with transport-specific mechanics and SHOULD cache the result for the lifetime of the process (stdio) or of the origin (HTTP); it MAY persist it across restarts, re-probing if the assumption fails.
Send server/discover with the preferred modern version in _meta. Three outcomes:
DiscoverResult arrives: modern server; pick a version from supportedVersions.UnsupportedProtocolVersionError): modern server that does not support that version; use supported. Do not fall back to initialize.initialize.The fallback MUST NOT depend on a specific error code: legacy servers respond to unknown methods before initialize with implementation-defined errors (-32601, -32602…) or do not respond at all.
Probing is RECOMMENDED even for modern-only clients: some legacy servers do not validate that the request arrives after initialize and would process a tools/call with legacy semantics; the probe produces a deterministic failure.
Send a modern request. On 400, inspect the body before falling back:
-32020, -32021, -32022, or -32601 with 404): the server is modern; correct or retry with a supported version.initialize (and, if that fails too, to the deprecated HTTP+SSE transport: GET waiting for the endpoint event).It chooses the era according to how the client opens:
_meta is served stateless according to 2026-07-28.initialize selects legacy semantics, bounded to the stdio process or the HTTP session, according to the negotiated revision.It may serve both eras concurrently on the same endpoint or process. A modern-only server SHOULD name the versions it supports in the error it returns to initialize, because that is the only diagnostic a legacy client will see.
With residual legacy traffic, a modern-only server SHOULD: respond 405 to GET/DELETE, ignore Mcp-Session-Id (neither minting nor returning ids) and ignore Last-Event-ID.
| Client | Server | Outcome |
|---|---|---|
| Modern | Modern | Works. discover optional; -32022 is resolved by retrying. |
| Modern | Legacy | Fails. The server may reject with an arbitrary error, stay silent or even process ambiguous methods with legacy semantics. In stdio, probe first to fail deterministically. |
| Dual-era | Modern | Works. The probe returns DiscoverResult or a modern error; the client stays modern. |
| Dual-era | Legacy | Works. stdio: non-modern error or timeout → initialize. HTTP: 4xx without a modern body → initialize (and perhaps HTTP+SSE). |
| Legacy | Modern | Fails. stdio: error on initialize (undefined code). HTTP: 400 because of missing headers. No fall-forward. |
| Legacy | Dual-era | Works with legacy semantics. |
| Legacy | Legacy | Works according to the legacy revision. |
flowchart TD
A[Dual-era client] --> B{Transport}
B -->|stdio| C[server/discover]
C -->|DiscoverResult| M[Modern]
C -->|-32022| M
C -->|other error / timeout| L[initialize → legacy]
B -->|HTTP| D[Modern POST]
D -->|200 or modern error| M
D -->|400 without modern body| L
L -->|fails| E[GET → HTTP+SSE 2024-11-05]
initialize, keep the session and negotiated version for that host; if it sends modern _meta, serve stateless.1. In stdio, when must a dual-era client fall back to initialize?
The fallback cannot be tied to a specific code because legacy servers respond in varied ways or do not respond at all.
2. In HTTP, a 400 with an UnsupportedProtocolVersionError body indicates…
A recognised modern error identifies a modern server; there is no need to fall back.
3. Which combination fails without an intermediary?
A legacy client has no fall-forward; the modern server rejects initialize or the requests without headers.
4. At what level is the detected era cached?
The era is a property of the server; it is cached per process or origin and may be persisted.