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.
In 2025-11-25 and earlier, an MCP connection has three phases: initialisation, operation and shutdown. Initialisation fixes the version and capabilities for the whole session. This is what your gateway must speak with legacy hosts and servers.
The first interaction MUST be initialize, sent by the client with version, capabilities and client information:
{ "jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {
"protocolVersion": "2025-11-25",
"capabilities": { "roots": { "listChanged": true }, "sampling": {}, "elicitation": { "form": {}, "url": {} },
"tasks": { "requests": { "elicitation": { "create": {} }, "sampling": { "createMessage": {} } } } },
"clientInfo": { "name": "ExampleClient", "title": "Example Client Display Name", "version": "1.0.0", "description": "…",
"icons": [ { "src": "https://example.com/icon.png", "mimeType": "image/png", "sizes": ["48x48"] } ], "websiteUrl": "https://example.com" } } }
The server MUST respond with its own:
{ "jsonrpc": "2.0", "id": 1, "result": {
"protocolVersion": "2025-11-25",
"capabilities": { "logging": {}, "prompts": { "listChanged": true }, "resources": { "subscribe": true, "listChanged": true },
"tools": { "listChanged": true }, "tasks": { "list": {}, "cancel": {}, "requests": { "tools": { "call": {} } } } },
"serverInfo": { "name": "ExampleServer", "title": "…", "version": "1.0.0", "description": "…", "icons": [], "websiteUrl": "…" },
"instructions": "Optional instructions for the client" } }
Afterwards the client MUST send notifications/initialized. Before the response to initialize, the client SHOULD NOT send anything other than ping; before initialized, the server SHOULD NOT send anything other than ping and logging.
The client sends a version (SHOULD be the latest it supports). If the server supports it, it MUST respond with the same one; if not, it MUST respond with another that it supports (SHOULD be its own latest). If the client does not support that one, it SHOULD disconnect. Over HTTP, the client MUST subsequently include MCP-Protocol-Version in every request. Example error: -32602 with data.supported/data.requested.
| Client | Server |
|---|---|
roots (with listChanged), sampling, elicitation, tasks, experimental |
prompts, resources (subscribe, listChanged), tools (listChanged), logging, completions, tasks, experimental |
Both parties MUST respect the negotiated version and use only negotiated capabilities. During the session, the server may send requests to the client (sampling/createMessage, elicitation/create, roots/list, ping) and the client answers with JSON-RPC responses.
pingEither party may send ping (no parameters); the receiver MUST respond promptly with an empty result. It serves to check liveness. Removed in 2026-07-28.
There is no shutdown message; the transport is used. stdio: close stdin, wait, SIGTERM, SIGKILL. HTTP: close the connections (and, with a session, an optional DELETE).
Same as in modern: per-request timeout, cancellation on expiry, optional reset on progress and an absolute maximum.
initialize in full, store {version, capabilities, session} per host and serve the session with that version. Reject requests before initialized except ping.initialize with the latest legacy version you translate, accept the one the server returns or disconnect, and send initialized.roots.listChanged and tasks.* have no direct equivalent.1. What does the client send after receiving the response to initialize?
The initialized notification marks the start of the operation phase.
2. If the legacy server does not support the requested version…
The client then decides whether to accept it or disconnect.
3. What may the legacy server send before receiving initialized?
It SHOULD NOT send anything else.