mcp: Implement retry on advised supportedVersions in UnsupportedProtocolVersion error#989
Merged
guglielmo-san merged 4 commits intoJun 8, 2026
Conversation
…eiving UnsupportedProtocolVersionError
…ns in negotiation logic
…rtedProtocolVersionError
nahapetyan-serob
approved these changes
Jun 8, 2026
guglielmo-san
added a commit
that referenced
this pull request
Jun 8, 2026
Conflicts: - mcp/server.go: union of the removed-in-new-protocol method list, keeping both branch additions (methodSubscribe, methodUnsubscribe) and main's addition (methodSetLevel) from PR #997. - mcp/client_test.go: kept all five branch-side TestInMemory_E2E_Discover* tests and main's new TestClientConnectDiscover_UnsupportedVersionNegotiation from PR #989 (retry on advised supportedVersions). Conflict was textual (adjacent functions) not semantic. Additional fix to make PR #989's negotiation test pass on this branch: exempt server/discover from the dispatcher's unsupported-version gate so that a probing client with an unsupported MCP-Protocol-Version can still reach the discover handler and learn the server's supportedVersions via the UnsupportedProtocolVersionError Data payload. Without this exemption, the gate at server.go:1561 short-circuited before the handler ran, leaving the client with no Supported list to negotiate from.
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.
Description
This PR introduces a retry mechanism for the discover method according to SEP-2575 (Issue #966)