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 most immediate value of a gateway in 2026 is letting hosts and servers from different eras talk to each other. This lesson describes the translation component on both sides.
The gateway is a dual-era server:
initialize: it enters legacy mode for that host; negotiates a version (the latest legacy version you translate), returns synthesised capabilities, creates a session (Mcp-Session-Id over HTTP), serves GET if you want to push notifications and requests, accepts responses via POST, supports DELETE._meta: stateless mode; server/discover, mandatory headers, subscriptions/listen, MRTR.The gateway is a dual-era client: it probes (stdio: server/discover; HTTP: modern request and inspection of the 400), caches the era per server, and maintains for each legacy server a session (initialize, initialized, Mcp-Session-Id, optional GET, resumption if it provides ids).
| Situation | What the gateway does |
|---|---|
| Modern host → legacy server | Maintains the server's session; fills initialize with the capabilities the host declares in _meta (or those from your policy); converts server requests (elicitation/create, sampling/createMessage, roots/list) into input_required towards the host, storing the pending request and its id; on receiving the retry with inputResponses, answers the server and waits for the result; translates resources/subscribe ↔ subscriptions/listen; adds resultType, ttlMs: 0, cacheScope: private; maps -32002 → -32602. |
| Legacy host → modern server | On receiving initialize, synthesises an InitializeResult from server/discover; attaches _meta (version, host capabilities) to every forwarded request; converts input_required into a server→client request over the host's stream/GET/stdout and, when the host answers, retries the original request with inputResponses and requestState; converts the host's GET stream into subscriptions/listen towards the server; emulates ping locally; logging/setLevel → per-request logLevel; closes streams to cancel on receiving notifications/cancelled. |
| Same era | Almost transparent pass-through: translate ids, headers and tokens; apply policy. |
tasks/list towards modern servers (does not exist): a clear -32601.tasks/result towards modern servers: emulable by polling; document it.-32021.includeContext: allServers: do not translate; force none.The MRTR ↔ server-request translation forces you to store pending requests with expiry: if the host does not retry, release and cancel downstream. The per-server legacy session is recoverable state: on 404, re-initialise and retry the in-flight request if it is idempotent.
Conformance suite in both versions against both sides (14.4); Inspector with protocolEra pinned (14.3); the Inspector's composable test servers as fixtures (*-legacy-* and *-modern-* configs).
1. Legacy host, modern server: the server returns input_required. The gateway…
It is the inverse MRTR translation and requires storing the pending request.
2. Which legacy method has no equivalent in the modern tasks extension?
The extension removed tasks/list; the client persists its handles.