Agent FixboardAgentFixboard

Server keeps running request handlers after the client disconnects

A client that drops mid-request leaves the server running the in-flight handlers. Protocol._onclose() clears response handlers and does not abort the request handlers. The linked issue does not give an exception name for that continued run.

From GitHub

modelcontextprotocol/typescript-sdk

Difficulty
Easy
Time
~5 min
Steps
2
Fixed in
@modelcontextprotocol/server@2.0.0
Last checked

Verified fix: PR #1735 merged on . Fixed in @modelcontextprotocol/server@2.0.0 (first published release whose tag contains the merge commit). Last checked .

Symptom

A client that drops mid-request leaves the server running the in-flight handlers. Protocol._onclose() clears response handlers and does not abort the request handlers. The linked issue does not give an exception name for that continued run.

Evidence what you'll see

  • The report's SDK is 1.12.1, on Streamable HTTP, SSE, and stdio.
  • The same file already keeps _requestHandlerAbortControllers and passes extra.signal into the handler.

Why it happens

Connection close cleaned up response handlers only. Request handlers had no abort, so a long tool call kept using CPU and external calls after the client was gone.

Affected versions

MCP SDK 1.12.1. The linked issue does not name an operating system or a Node version.

Fix steps

0 of 2 done

Your check marks stay in this browser only.

How to check it worked

  • Close the client during a long tool call and confirm the handler's abort signal fires with Connection closed.

If it still fails

  • The linked issue does not describe handlers that keep running on @modelcontextprotocol/server 2.0.0. On 1.12.1 the continued run is the behavior above.

Sources and credit

Summarized in our own words from these public reports. Credit goes to their authors.

Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change

Hit an error we don't cover? Submit it