Skip to content

feat(core): auto-negotiation fallback and custom protocol array support#282

Open
anubhav756 wants to merge 1 commit into
anubhav-mcp-latestfrom
anubhav-draft-negotiation
Open

feat(core): auto-negotiation fallback and custom protocol array support#282
anubhav756 wants to merge 1 commit into
anubhav-mcp-latestfrom
anubhav-draft-negotiation

Conversation

@anubhav756

@anubhav756 anubhav756 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Description

This PR implements full auto-negotiation fallback support for the SDK as per SEP-2575 (Stateless MCP).

  • Protocol Negotiation: If a draft protocol fails with a -32004 error during connection initialization, the SDK correctly strips the headers and falls back chronologically.
  • Custom Protocols Array: Users can now pass an array of preferred protocols (e.g., [core.MCP_v20251125, core.MCP_DRAFT]) in the ClientConfig. The SDK will intersect these with the server's capabilities and strictly negotiate them in a newest-to-oldest order.

This PR no longer contains the dual-server integration test infrastructure, which has been extracted to a separate PR to maintain clean history.

@anubhav756 anubhav756 requested a review from a team as a code owner June 26, 2026 19:05
@anubhav756 anubhav756 force-pushed the anubhav-draft-negotiation branch 3 times, most recently from f4b5c9e to af4be3e Compare July 1, 2026 04:42
@anubhav756 anubhav756 changed the title feat(core): add support for MCP 2026 stateless draft and auto-negotiation fallback feat(core): auto-negotiation fallback and custom protocol array support Jul 2, 2026
@anubhav756 anubhav756 force-pushed the anubhav-draft-negotiation branch from e369643 to d692d91 Compare July 2, 2026 04:49
@anubhav756 anubhav756 force-pushed the anubhav-mcp-latest branch from 838a1bc to 4276bd6 Compare July 3, 2026 08:41
@anubhav756 anubhav756 force-pushed the anubhav-draft-negotiation branch from d692d91 to c563d8d Compare July 3, 2026 08:41
@anubhav756 anubhav756 force-pushed the anubhav-draft-negotiation branch from c563d8d to ae742d2 Compare July 3, 2026 22:40
@anubhav756 anubhav756 force-pushed the anubhav-mcp-latest branch from 4276bd6 to 13da1cb Compare July 3, 2026 22:40
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.

2 participants