Skip to content

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

Merged
anubhav756 merged 1 commit into
mcp-v202606from
anubhav-sep-2575
Jul 17, 2026
Merged

anubhav756 merged 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 Stateless MCP Draft protocol version. This removes the legacy stateful initialize JSON-RPC handshake and replaces it with a stateless HTTP header (Mcp-Protocol-Version).

Changes

  • Added new transport files (mcp.ts and types.ts) that remove the initialize method in favor of stateless headers.
  • Updated ToolboxClient to catch ProtocolNegotiationError and fallback to older protocol versions if the server requires it.
  • Added unit tests to verify the stateless communication structure.

Note

This PR is the JS counterpart to googleapis/mcp-toolbox-sdk-python#648.

@twishabansal

Copy link
Copy Markdown
Contributor

nit: please fix lint issues

@twishabansal

Copy link
Copy Markdown
Contributor

Should we add a new transport class for the new version of mcp here?

@twishabansal

Copy link
Copy Markdown
Contributor

Is this supposed to be similar to googleapis/mcp-toolbox-sdk-python#648?

@twishabansal twishabansal added the priority: p2 Moderately-important priority. Fix may not be included in next release. label Jul 1, 2026
@anubhav756

Copy link
Copy Markdown
Contributor Author

Should we add a new transport class for the new version of mcp here?

Absolutely, but that's added in the next PR #395. I tried to keep this one focussed on SEP-2575 implementation only.

@anubhav756

Copy link
Copy Markdown
Contributor Author

Is this supposed to be similar to googleapis/mcp-toolbox-sdk-python#648?

That's right. Added to PR description for clarity.

@anubhav756 anubhav756 added priority: p0 Highest priority. Critical issue. P0 implies highest priority. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. and removed priority: p2 Moderately-important priority. Fix may not be included in next release. priority: p0 Highest priority. Critical issue. P0 implies highest priority. labels Jul 3, 2026
@twishabansal

Copy link
Copy Markdown
Contributor

Could you clarify what is reference support here? If that's incorrect, can we update the PR title?

Comment thread packages/toolbox-core/src/toolbox_core/errorUtils.ts
Comment thread packages/toolbox-core/src/toolbox_core/client.ts Outdated
Comment thread packages/toolbox-core/src/toolbox_core/client.ts
@twishabansal

Copy link
Copy Markdown
Contributor

In the PR description, it is mentioned

This PR is the JS counterpart to googleapis/mcp-toolbox-sdk-python#648.

However, the Python PR seems to contain a lot more files. Can we fix the description to clarify the right intent?

@anubhav756 anubhav756 changed the title feat(core): implement reference support for Stateless MCP (SEP-2575) feat(core): implement support for Stateless MCP (SEP-2575) Jul 6, 2026
@anubhav756

Copy link
Copy Markdown
Contributor Author

Could you clarify what is reference support here? If that's incorrect, can we update the PR title?

Ah my bad. I added the word "reference" because we had picked this up right after adding the conformance tests for this SEP in the MCP repo, so this PR was also kind of a reference implementation for that SEP. Removed it from the title to make it more clear. Thanks!

@Yuan325

Yuan325 commented Jul 7, 2026

Copy link
Copy Markdown

This PR doesn't seem to be implementing the SEP-2575. It doesn;t seem like the PR adds new 2026 version files / remove the initialize method

@anubhav756
anubhav756 force-pushed the anubhav-sep-2575 branch 3 times, most recently from 42fbbb4 to 9ae93e7 Compare July 17, 2026 08:15
@anubhav756

Copy link
Copy Markdown
Contributor Author

This PR doesn't seem to be implementing the SEP-2575. It doesn;t seem like the PR adds new 2026 version files / remove the initialize method

The commits got a bit tangled across the branches. I've rebased the branch chain so that this PR fully implements SEP-2575,. Other downstream PRs have been updated accordingly.

@anubhav756
anubhav756 force-pushed the anubhav-sep-2575 branch 2 times, most recently from 27c076e to 0e4ae03 Compare July 17, 2026 09:24
@anubhav756
anubhav756 force-pushed the anubhav-sep-2575 branch 8 times, most recently from 935b92f to e30da1c Compare July 17, 2026 11:15
@anubhav756
anubhav756 merged commit a887b37 into mcp-v202606 Jul 17, 2026
9 checks passed
@anubhav756
anubhav756 deleted the anubhav-sep-2575 branch July 17, 2026 13:36
anubhav756 added a commit that referenced this pull request Jul 23, 2026
… and HTTP transport routing (#412)

* chore: update gitignore for build caches and build info files

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

* feat(core): implement SEP-2243 routing headers for HTTP transport (#395)

* test: Integration test dual-server support (#413)

* feat(core): update protocol definitions to use MCP_LATEST for draft specs (#394)

* test: Integration test dual-server support

* feat(core): update protocol definitions to use MCP_LATEST for draft specs

* feat(core): support 2026 Stateless MCP, array-based auto-negotiation, and HTTP transport routing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants