-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Remove batching requirement #416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
dsp-ant
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
|
Coming very late to this, after seeing batch support is being removed in the latest spec.
I don't think this is true. JSON-RPC allows mixed use of responses and notifications, by simply excluding the notifications from the response array.
|
To be honest, I don't understand how implementing a transport can tell you anything about compelling use cases. It's the users who can tell you.
What do you mean by the "stateless mode"? AFAIK the spec does not mention it anywhere.
This change is also not backward compatible which means that an MCP client that supports In general, I would expect a broader discussion before such a change is merged 🤷. |
|
Is there anyone opposing breaking backward compatibility in the JS world? This change means more work for people implementing compatible MCP libraries, rather than less. |
I'm sorry but I don't understand this comment ;-)
Exactly. |
|
@ihrpr @dsp-ant sorry I'm very late to the game on this, but I didn't notice it until reviewing the update notes for the new spec... I'm not fully confident that this change is compliant with JSON-RPC 2.0 spec... There are a few places I could point to but the most direct argument is probably:
Together, this entails that batches are valid rpc requests, and servers MUST reply with a response. And the MCP Spec now says:
and all mention of batches has been removed, and it's been removed from the Schema. Elsewhere in the JSON-RPC 2.0 spec, it states that servers SHOULD respond to batch requests with such-and-such. Part of the meaning of "SHOULD" is that
In particular, the implication is that a SHOULD must be followed unless there's a good reason not to, and the reason has to do with security and/or interoperability, and not preference. Based on this PR's message, it seems to me that the justification was mainly the lack of "compelling use cases for batching". I think this is a deviation from JSON-RPC 2.0 requirements, which is fine as far as it goes, and is not the main purpose of this comment, but in my opinion the Specification should be more explicit about this than merely changing the language to omit batches, and noting it in the changelog. For instance in the Base Protocol overview, the Spec explicitly states:
Similarly, I think an explicit statement like the following would be appropriate:
Also, I'm not sure what the current Spec instructs servers to do in response to a batch request if one happens to be sent in. I'm also not clear whether the Spec allows servers to support batch requests for backwards-compatibility purposes or not. Given that batches are no longer valid types within the Schema, it doesn't seem allowed. But the question is - is this change about removing support for batches, or about removing the requirement for support for batches. I've opened a PR to make this change more explicit, as I believe that given the foundational status of JSON-RPC with respect to MCP, deviations from JSON-RPC should be explicit in the Spec (and not merely in the Key Changes). Not doing so is liable to lead to confusion or breakage in tools that are built in strict adherence to JSON-RPC. PR here: #828 |
|
Reposting a sentiment I shared in another medium:
For the reasons stated in the PR description:
A feature having limited value shouldn't be a reason to ban it, especially when banning it is not a net deletion of a requirement, but an addition of an artificial requirement that creates more work and mental overhead for SDK implementors and users (of having to worry about this special exception over base JSON-RPC).
This is true! |
Batch feature was removed on MCP spec 2025-06-18 since it was overcomplex and didn't have proportial advantages/benefits. Check more on - modelcontextprotocol/modelcontextprotocol#416 - https://modelcontextprotocol.io/specification/2025-06-18/changelog
While implementing Streamable HTTP transport in the Typescript and now Python SDKs, I haven't seen any compelling use cases for batching.
The main use case we initially considered was allowing notifications (e.g., logging) when a tool responds with JSON instead of SSE. However, the current specification doesn't support mixing responses and notifications (because JSON-RPC doesn't), and even if it was, delayed notifications bundled with the final response offer limited value compared to real-time updates over SSE.
Another use case is parallel tool calling, which is quite strait forward with horizontal scaling especially in stateless mode.
This PR proposes simplifycayion the spec by removing batching support in the next version.