Skip to content
AdminKit

Cancellation (MCP)

What is Cancellation (MCP)?

Cancellation is how either side of a Model Context Protocol connection asks the other to stop an in-progress request, sending a notifications/cancelled message that names the request's ID and an optional reason. AdminKit's security gateway for MCP servers logs these notifications, alongside progress updates, as they pass through a long-running call.

By AdminKit team, Netbase JSC · Updated

Cancellation, part of the Model Context Protocol specification, is how either side of an MCP connection asks the other to stop processing a request that is still running, using a notifications/cancelled message that names the original request’s ID and an optional human-readable reason. Because it is an ordinary JSON-RPC notification, it carries no ID of its own and expects no reply. A receiver that gets a cancellation notification should stop working on the named request, free whatever it was holding for it, and not send a response for that request afterward — but the spec also makes cancellation advisory rather than guaranteed: a receiver may simply ignore a cancellation naming a request it has never heard of, one it already finished, or one it cannot actually interrupt. Because a cancellation notification and the original request’s own response can cross in transit, the sender of a cancellation is expected to ignore any response that still arrives for the request it just tried to cancel. That differs from the Language Server Protocol, which MCP’s specification cites as an inspiration: there, a request cancelled with $/cancelRequest still has to send a response back, because JSON-RPC expects every request to get one, and LSP advises the RequestCancelled error code if that response is an error. The initialize request specifically must never be cancelled by a client, the same way progress notifications are optional status updates rather than guarantees about a request’s completion.

AdminKit groups cancellation (MCP) under its AI agents & MCP cluster — browse the AdminKit glossary index for other related terms.

Frequently asked questions

What message does MCP use to cancel an in-progress request?

A notifications/cancelled message naming the original request's ID and an optional human-readable reason.

Is a cancellation notification guaranteed to stop the request?

No -- cancellation is advisory, not guaranteed; a receiver may ignore a cancellation naming a request it never heard of, already finished, or cannot actually interrupt.

Can a client cancel the initialize request?

No -- the specification says the initialize request must never be cancelled by a client, regardless of how long it takes.