mcp: Implement retry on advised supportedVersions in UnsupportedProtocolVersion error (#989)
## Description This PR introduces a retry mechanism for the discover method according to SEP-2575 (Issue #966)
This commit is contained in:
parent
5045d86fb4
commit
d9714c61f1
1 changed files with 172 additions and 34 deletions
|
|
@ -2103,3 +2103,14 @@ const (
|
|||
// MetaKeyClientCapabilities carries the client's [ClientCapabilities].
|
||||
MetaKeyClientCapabilities = "io.modelcontextprotocol/clientCapabilities"
|
||||
)
|
||||
|
||||
// UnsupportedProtocolVersionData is the SEP-2575 payload carried in the
|
||||
// `data` field of a JSON-RPC error response with code
|
||||
// [CodeUnsupportedProtocolVersion]. The server uses it to advertise which
|
||||
// versions it supports so the client can pick a mutually supported one.
|
||||
type UnsupportedProtocolVersionData struct {
|
||||
// Supported is the list of protocol versions the server supports.
|
||||
Supported []string `json:"supported"`
|
||||
// Requested is the protocol version the client asked for.
|
||||
Requested string `json:"requested"`
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue