Repository navigation
Fix MCP client timeout issue: progress notifications now reset timeout by default - #2
Merged
Merged
Conversation
Co-authored-by: andrea-tomassi <[email protected]>
Co-authored-by: andrea-tomassi <[email protected]>
Copilot
AI
changed the title
[WIP] mcp client times out after 60 seconds (ignoring timeout option)
Fix MCP client timeout issue: progress notifications now reset timeout by default
Aug 6, 2025
andrea-tomassi
marked this pull request as ready for review
August 6, 2025 15:54
andrea-tomassi
approved these changes
Aug 6, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes the timeout issue where MCP clients would timeout after 60 seconds even when receiving progress notifications from servers performing long-running operations.
Problem
The TypeScript/JavaScript SDK was timing out after 60 seconds regardless of progress updates from the server, while the Python SDK correctly handled progress notifications by resetting the timeout. This inconsistency caused issues for users with long-running MCP tools that send periodic progress updates.
Error encountered:
Root Cause
The
resetTimeoutOnProgressoption inRequestOptionsdefaulted tofalse, meaning that progress notifications would not reset the request timeout. This required users to explicitly opt-in to the intuitive behavior of keeping connections alive when progress is being reported.Solution
Changed the default value of
resetTimeoutOnProgressfromfalsetotrue, making the TypeScript/JavaScript SDK behave consistently with the Python SDK. This ensures that:resetTimeoutOnProgress: falseexplicitly)Changes
resetTimeoutOnProgressnow defaults totrueinstead offalseVerification
The fix has been verified with:
Example of the fix in action:
Fixes #1.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.