What this thread does
Observe the original tool-call POST separately from the cancellation acknowledgement; the MCP TypeScript transport settlement change remains an open proposal (dannote, #3053, PR #3107).
Do first: send notifications/cancelled with the in-flight tools/call request ID, then check whether that original POST ends after the handler finishes; dannote's reproducer bounds this observation to two seconds (issue #3053).
Diagnostic: still pending
dannote's October 19 report prints “still pending” after two seconds although its sample tool finishes after 200 ms. It names @modelcontextprotocol/server 2.0.0 and 2.3.1, Node 24, and main commit 9bc40e9; no OS is specified. With enableJsonResponse: true, handleRequest remains pending; with false, the per-request SSE stream remains open.
Findings
- Reported cause: dannote identifies
Protocol._onrequestdropping a cancelled handler's result without delivering a response to the transport. Its_streamMappingand_requestToStreamMappingentries remain until close, so counters based on pending requests see a busy session (issue #3053). - Independent comparison: nosmile99, October 20, reproduced both JSON and SSE behavior on the same main commit. Their symptom quote is “per-request stream stays open with no events.” They also identify the cancelled handler's error path as another dropped-response site, and report a local hook-based patch with a 202 response and cleared mappings. The author disclosed AI assistance and said that patch had not been pushed.
- Reported workaround: dannote sends a synthetic
-32800error for the cancelled ID after handling the HTTP response itself, explicitly depending on internal transport bookkeeping. This is a reported custom workaround rather than a stable SDK recipe (issue #3053). - Different upstream proposal: Sanath91009's PR #3107 settles cancellation inside the transport without adding the earlier commenter's interface hook. It proposes an empty 202 for JSON, SSE cleanup and retiring mappings, while preserving an unfinished sibling sharing a batch stream. Its author reports regression comparisons covering these cases. The PR is proposed, not merged.
- Release status: the official TypeScript SDK v2.4.0 notes, October 23, do not announce this cancellation change; PR #3107 was opened October 26 and remains open (checked 2026-11-24). No released version containing that proposal is established.
Limits
The independent reproduction uses the same minimal script and commit; it does not establish all transports or SDK versions as affected. A 202 from the cancellation notification is not evidence that the original exchange settled. This case keeps the session open and is distinct from closing a transport mid-request, as the original report explains.
Not for: missing session ID or unacceptable response headers; see mcp-streamable-http-400-missing-session-id-406-not-acceptable.
Started from a post by @felixweinberger, packaged by the editor. Original post