mcp: Implement stateless server (SEP-2275)#965
Merged
Conversation
…lidation and accessors
…est rejections and update associated tests
…ed regression tests
…t stateless protocol to stateless HTTP servers
…n the new protocol session
…protocol version checking in server and tests
… protocol version validation logic
…ata into requests
…y in server request handling
…per for InitializeParams
…ready initialized
yarolegovich
approved these changes
May 26, 2026
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 lays the foundational server-side groundwork for the
>= 2026-06-30sessionless and stateless feature introduced by SEP-2575 and SEP-2567, tracked in design/stateless.md.SEP-2575: Stateless MCP
Per-request protocol detection in
ServerSession.handle()Unmarshal
_metafrom the raw JSON-RPC params determines whether each request follows the new protocol.Per-request typed accessors on
ServerRequest[P]Reject client->server
initialize,initializedandpingfor new-protocol requestsPer-request
_metafield name constantsThree constants for the wire-protocol field names (
MetaKeyProtocolVersion,MetaKeyClientInfo,MetaKeyClientCapabilities)Stop synthesizing fake
InitializeParamsfor new-protocol requestsFixes: #966