Skip to content

mcp: Implement stateless server (SEP-2275)#965

Merged
guglielmo-san merged 20 commits into
mainfrom
guglielmoc/SEP-2567_2575_Stateless_MCP
May 26, 2026
Merged

mcp: Implement stateless server (SEP-2275)#965
guglielmo-san merged 20 commits into
mainfrom
guglielmoc/SEP-2567_2575_Stateless_MCP

Conversation

@guglielmo-san
Copy link
Copy Markdown
Contributor

@guglielmo-san guglielmo-san commented May 19, 2026

Description

This PR lays the foundational server-side groundwork for the >= 2026-06-30 sessionless 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 _meta from the raw JSON-RPC params determines whether each request follows the new protocol.

  • Per-request typed accessors on ServerRequest[P]

    func (r *ServerRequest[P]) ProtocolVersion() string
    func (r *ServerRequest[P]) ClientInfo() *Implementation
    func (r *ServerRequest[P]) ClientCapabilities() *ClientCapabilities
  • Reject client->server initialize, initialized and ping for new-protocol requests

  • Per-request _meta field name constants
    Three constants for the wire-protocol field names (MetaKeyProtocolVersion, MetaKeyClientInfo, MetaKeyClientCapabilities)

  • Stop synthesizing fake InitializeParams for new-protocol requests

Fixes: #966

@guglielmo-san guglielmo-san marked this pull request as ready for review May 19, 2026 15:25
@guglielmo-san guglielmo-san changed the title mcp: Implement stateless and sessionless server mcp: Implement stateless server May 20, 2026
Comment thread mcp/server.go Outdated
Comment thread mcp/server_test.go Outdated
Comment thread mcp/shared.go Outdated
Comment thread mcp/streamable.go Outdated
Comment thread mcp/shared.go Outdated
Comment thread mcp/streamable.go
Comment thread mcp/shared.go Outdated
@guglielmo-san guglielmo-san changed the title mcp: Implement stateless server mcp: Implement stateless server (SEP-2275) May 26, 2026
@guglielmo-san guglielmo-san enabled auto-merge (squash) May 26, 2026 14:21
@guglielmo-san guglielmo-san merged commit 4cbdd6a into main May 26, 2026
9 checks passed
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.

Implement SEP-2575: Make MCP Stateless

2 participants