Skip to content

mcp: Implement retry on advised supportedVersions in UnsupportedProtocolVersion error#989

Merged
guglielmo-san merged 4 commits into
mainfrom
guglielmoc/fix_client_retry_on_unsupported_version
Jun 8, 2026
Merged

mcp: Implement retry on advised supportedVersions in UnsupportedProtocolVersion error#989
guglielmo-san merged 4 commits into
mainfrom
guglielmoc/fix_client_retry_on_unsupported_version

Conversation

@guglielmo-san
Copy link
Copy Markdown
Contributor

Description

This PR introduces a retry mechanism for the discover method according to SEP-2575 (Issue #966)

@guglielmo-san guglielmo-san marked this pull request as ready for review June 5, 2026 15:10
@guglielmo-san guglielmo-san merged commit d9714c6 into main Jun 8, 2026
9 checks passed
@guglielmo-san guglielmo-san deleted the guglielmoc/fix_client_retry_on_unsupported_version branch June 8, 2026 13:09
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants