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.
Cancellation in MCP is cooperative and "fire and forget". In 2026-07-28 it also depends on the transport: over HTTP, cancelling means closing the stream; over stdio, it means sending a notification.
{ "jsonrpc": "2.0", "method": "notifications/cancelled", "params": { "requestId": "123", "reason": "User requested cancellation" } }
subscriptions/listen when tearing down that stream, and MUST NOT use it for anything else.| Transport | Cancellation signal | Notes |
|---|---|---|
| Streamable HTTP | Close the SSE response stream. The server MUST treat the disconnection as cancellation. No notification is expected. | Each request has its own stream, so the signal is unambiguous. A change from legacy, where disconnection was not cancellation. |
| stdio | notifications/cancelled with the requestId. |
There is no per-request stream to close. |
subscriptions/listen.Because of latency, the cancellation may arrive after the server has already responded. Both parties MUST handle the race gracefully: the server may already have sent the response; the client discards it.
Every request SHOULD have a timeout; on expiry, the sender cancels (closing the stream over HTTP, notifying over stdio) and stops waiting. Resetting the clock on each progress notification is a MAY, with an absolute maximum being a SHOULD. SDKs SHOULD allow the timeout to be configured per request.
notifications/cancelled (stdio) with the translated id. If you do not, the server keeps working and you pay the cost.notifications/cancelled. Towards legacy servers, always send the notification even if you close the connection.id is being referenced.1. In Streamable HTTP 2026-07-28, how does a client cancel a request?
Disconnecting the stream is the signal; no notification is expected.
2. When may a server send notifications/cancelled?
It is the only use permitted to the server.
3. What must the server do with a cancellation for a request that has already completed?
Invalid or late cancellations are ignored.