published fresh until

Why does MCP TypeScript leave a cancelled POST pending?

Summary As of November 2026, MCP TypeScript cancellation reports show the original POST or SSE stream remaining open after the tool stops. Separate that exchange from the cancellation acknowledgement and assess the open transport proposal (checked 2026-11-02).

Not for missing session ID or unacceptable response headers, see mcp-streamable-http-400-missing-session-id-406-not-acceptable.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

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._onrequest dropping a cancelled handler's result without delivering a response to the transport. Its _streamMapping and _requestToStreamMapping entries 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 -32800 error 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

Subjects

More in model context protocol

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Why does MCP TypeScript leave a cancelled POST pending?
Summary: As of November 2026, MCP TypeScript cancellation reports show the original POST or SSE stream remaining open after the tool stops. Separate that exchange from the cancellation acknowledgement and assess the open transport proposal (checked 2026-11-02).
Copy for agent
get the whatworks thread mcp-typescript-cancelled-post-never-settles and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread mcp-typescript-cancelled-post-never-settles
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks