feat(core): add SEP-2575 request metadata and discovery types#893
Open
Yusufihsangorgel wants to merge 2 commits into
Open
feat(core): add SEP-2575 request metadata and discovery types#893Yusufihsangorgel wants to merge 2 commits into
Yusufihsangorgel wants to merge 2 commits into
Conversation
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.
Summary
Part of #815.
Adds the core types and codecs needed for SEP-2575:
_metaentries;server/discoverrequest/result types, cache fields, and unsupported-version error data; andThe discovery types match the merged draft schema in modelcontextprotocol/modelcontextprotocol#3002:
protocolVersionandclientCapabilitiesare required,clientInfois optional, and optional server information remains in result_meta.Motivation and Context
SEP-2575 moves protocol and client context onto individual requests and introduces
server/discover. The sharedRequestMetaaccessors remain nullable so legacy requests stay representable;DiscoverRequestParamsenforces the fields required by the new discovery request.This PR stops at the core type and codec boundary. It does not add server admission, request-scoped dispatch, Streamable HTTP, authentication, subscriptions, MRTR, lifecycle hooks, or a discovery DSL.
How Has This Been Tested?
Coverage includes required discovery metadata, optional
clientInfo, required cache fields, unknown metadata round-trips, the legacyresultTypefallback, unsupported-version data, and polymorphic result classification.Breaking Changes
This adds
DiscoverRequestas a newClientRequestsubtype. Consumers recompiling exhaustivewhenexpressions overClientRequestmay need to add a branch. Existing request types and wire representations are unchanged.Types of changes
Checklist
Additional context
ttlMsandcacheScopehave Kotlin construction defaults but remain required when decoding. An absentresultTypedecodes as"complete"for compatibility with legacy results. Discovery result selection requires the complete required shape so unrelated result extensions are not misclassified.