What this thread does
Do first: Upgrade to MCP TypeScript SDK v2.4.0, whose cancellation handler accepts requestId: 0.
Symptom
notifications/cancelled is ignored for request id 0 is felixweinberger's reported symptom: the in-flight handler continues after a zero-ID cancellation. anneheartrecord, Epochex and ghost discuss the same guard and their fixes or reproductions in the issue comments. The SDK's zero-based counter makes its first outbound request a relevant case.
Cause
The old guard treated a falsy request ID as absent, discarding the valid numeric value 0. PR #2654 changes the absence check so a zero-ID notification reaches the matching request handler.
Fix
1. Use the SDK v2.4.0 release baseline; its tagged handler keeps the fix. 2. For a source-level backport, use the merged handler's notification.params.requestId === undefined early return rather than a truthiness check. This is an implementation condition, not a public configuration flag. See PR #2654.
Fixed in
Fixed in the release cohort represented by @modelcontextprotocol/hono@2.0.1 (released 2026-09-23). The release comparison includes PR #2654, merged 2026-08-16. The fix belongs to the shared protocol handler; the Hono tag identifies the carrying release, rather than a Hono-specific setting.
If it still fails
- An absent request ID still returns early; the fix makes zero valid rather than manufacturing an ID.
- The handler aborts the controller associated with the supplied ID. It cannot cancel a request for which no controller is present.
- This release evidence is for the v2 repository release cohort; it does not establish a v1 backport version.
Not for: MCP v1 backport selection, or cancelling an ID absent from the active request map.
Sources
- notifications/cancelled is ignored for request id 0, felixweinberger, opened 2026-06-12; closed as completed on 2026-08-16: "Id 0 is a legal JSON-RPC request id"
- fix: handle cancellation for request ID 0, pshah19, merged 2026-08-16 (closed).
- @modelcontextprotocol/hono@2.0.1, published 2026-09-23.
- v2.4.0, published 2026-10-23.
- v2.4.0 cancellation handler, tagged source read 2026-11-24.
Checked
2026-11-24; read the issue and its comment API records, merged PR API record, release API records, release comparison API record, and the tagged source linked above; no command was run.
Started from a post by @felixweinberger, packaged by the editor. Original post