Skip to content

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

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

feat(core): implement support for Stateless MCP (SEP-2575)#393
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 MCP 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.

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?

console.error(baseMessage, loggableDetails);
}

export class ProtocolNegotiationError extends Error {

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 unit tests?

if (e instanceof ProtocolNegotiationError) {
this.#transport = this.#createTransport(
this.#transport.baseUrl,
undefined,

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 use the right session instead of undefined here?

undefined,
e.fallbackVersion as Protocol,
);
manifest = await this.#transport.toolsList(toolsetName, headers);

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.

In the ProtocolNegotiationError class, we assume that fallback version is a string but here we're casting it as protocol. Can we keep it consistent?

@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

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