docs: clarify documentation regarding dropping support for batching#828
Closed
hesreallyhim wants to merge 5 commits intomodelcontextprotocol:mainfrom
Closed
docs: clarify documentation regarding dropping support for batching#828hesreallyhim wants to merge 5 commits intomodelcontextprotocol:mainfrom
hesreallyhim wants to merge 5 commits intomodelcontextprotocol:mainfrom
Conversation
atesgoral
reviewed
Jun 24, 2025
|
|
||
| MCP deviates slightly from the JSON-RPC 2.0 specification in two respects: | ||
|
|
||
| - Unlike base JSON-RPC, the `id` of a request/response (notifications excluded) **MUST NOT** be `null`. |
Contributor
There was a problem hiding this comment.
MCP supports notifications where id is set to null to signify that it's a fire-and-forget notification.
Contributor
Author
There was a problem hiding this comment.
@atesgoral is your comment saying that this line is incorrect? just trying to clarify. this line is already present in the docs and also it says "notifications excluded"
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I noticed in the latest Spec that batch requests are no longer supported. In my opinion, this is a deviation from JSON-RPC 2.0 spec. Regardless of whether that deviation is merited, I think it's important to be more explicit about this in the documentation. Currently, the Spec/documentation does not state anything about the lack of support for batch requests, except for in the "Key Changes" from the last version. Given that JSON-RPC (a) is part of the base messaging protocol, (b) is widely used and tooling exists for it, and (c) is clear that "the Client MAY send an Array filled with Request objects", I think it's important to be explicit about this deviation.
For instance, the spec does explicitly state:
So, there's precedent for some deviation from JSON-RPC, and this deviation is clearly documented in one of the first documents. I think a similar notice should be added regarding the lack of support for batching. In this PR, I've added such language where appropriate.
One point I am unclear is whether MCP currently disallows batch requests or whether it simply no longer requires support for them. I.e. which of the following is correct:
The "Key Changes" section says "Remove support for JSON-RPC batching" - but I'm not sure which of the above is intended. The stronger, first reading seems implied; on the other hand, PR #416 discusses removing the requirement - which is more suggestive of the weaker, second reading. After reading the relevant sections, I think the first reading is closer to what is intended, but I'm not sure.
Additionally I'm not sure if support for batching is allowed for backwards-compatibility purposes.
So, some of the content of the text proposed in this minor clarification may be incorrect - but I think the need for an explicit statement is still appropriate.
Motivation and Context
It improves the clarity of the schema by making any deviations from JSON-RPC 2.0 more explicit.
How Has This Been Tested?
N/A
Breaking Changes
No - this is only meant to make more explicit what the Spec is already supposed to have declared.
Types of changes
Checklist
Additional context
See the comment here