docs: clarify documentation regarding dropping support for batching #828
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