Skip to content

fix(mcp): bound stdio probe handshake by the probe timeout - #1988

Closed
Aaronontheweb wants to merge 1 commit into
devfrom
fix/mcp-probe-timeout
Closed

fix(mcp): bound stdio probe handshake by the probe timeout#1988
Aaronontheweb wants to merge 1 commit into
devfrom
fix/mcp-probe-timeout

Conversation

@Aaronontheweb

Copy link
Copy Markdown
Collaborator

The MCP doctor's offline probe launched a real stdio subprocess but only bounded ListToolsAsync with the 15s probe token. The connect handshake was left to the SDK's 60s default InitializationTimeout, so on slow/cold runners (e.g. npx cold start) the handshake blew past it and threw an uncaught TimeoutException that crashed the probe and flaked CI (Test-macos-26).

Changes

  • Thread the probe budget into McpClientOptions.InitializationTimeout so the connect handshake fails fast within the 15s probe window instead of hanging on the SDK default.
  • Map a timed-out handshake to Unreachable so an unreachable stdio server is reported deterministically (unreachable — connection timed out) instead of escaping as a crash.

Verified locally: previously-failing test now passes in ~1s (was failing at ~70s); full McpServersDoctorCheckTests suite 10/10 green; Release build 0 warnings / 0 errors.

  • Tests added/updated
  • Release build clean

The MCP doctor's offline probe launched a real stdio subprocess but only
bounded ListToolsAsync with the 15s probe token. The connect handshake was
left to the SDK's 60s default InitializationTimeout, so on slow/cold runners
(e.g. npx cold start) the handshake blew past it and threw an uncaught
TimeoutException, crashing the probe and flaking CI (Test-macos-26).

Thread the probe budget into McpClientOptions.InitializationTimeout and map a
timed-out handshake to Unreachable so an unreachable stdio server is reported
deterministically instead of escaping as a crash.
@Aaronontheweb Aaronontheweb added bug Something isn't working mcp Model context protocol server / client issues. labels Aug 18, 2026
@Aaronontheweb
Aaronontheweb deleted the fix/mcp-probe-timeout branch August 19, 2026 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working mcp Model context protocol server / client issues.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant