AgentFixboard

Server keeps running request handlers after the client disconnects

When a client disconnects mid-request, the TypeScript MCP server keeps running the in-flight handlers to completion.

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 stable release containing the merge commit). Last checked .

Symptom

When a client disconnects mid-request, the TypeScript MCP server keeps running the in-flight handlers to completion.

Evidence what you'll see

  • Long tool calls keep using CPU and external APIs after the client is gone
  • Response handlers are cleaned up, request handlers aren't

Cause

When the connection closed, the protocol layer cleaned up response handlers but didn't abort active request handlers.

Fix steps

0 of 2 done

Your check marks stay in this browser only.

Verify the fix worked

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

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