Skip to content

feat(core): implement reference support for Stateless MCP (SEP-2575)#279

Open
anubhav756 wants to merge 1 commit into
mcp-v202606from
anubhav-sep-2575
Open

feat(core): implement reference support for Stateless MCP (SEP-2575)#279
anubhav756 wants to merge 1 commit into
mcp-v202606from
anubhav-sep-2575

Conversation

@anubhav756

@anubhav756 anubhav756 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Description

Implements SEP-2575, introducing support for the 2026 Draft protocol version. This removes the legacy stateful initialize JSON-RPC handshake and replaces it with a stateless HTTP header (Mcp-Protocol-Version).

This PR lays the groundwork for the new stateless MCP communication.

Comment thread core/protocol.go
// MCP is the default alias pointing to the newest supported version.
MCP = MCPv20250618

MCPLatest = MCPv20251125

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we are downgrading this?

Comment thread core/client.go
tc.transport = newTransport
tc.protocol = Protocol(negErr.FallbackVersion)
manifest, err = tc.transport.GetTool(ctx, name, resolvedHeaders)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add tests to:

  1. verify the fallback is successful
  2. Edge cases (maybe in the case a goroutine is being used, to ensure thread safety)

} else if (resp.StatusCode == http.StatusAccepted || resp.StatusCode == http.StatusNoContent) && dest == nil {
return nil // Valid notification success
} else if resp.StatusCode == http.StatusBadRequest {
body, _ := io.ReadAll(resp.Body)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we de-duplicate this code and add it as a helper in the base mcp class?

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.

3 participants