Repository navigation
Test MCP version gates and continuation receive policies - #3037
Open
HarshPopat23 wants to merge 3 commits into
Open
HarshPopat23 wants to merge 3 commits into
HarshPopat23 wants to merge 3 commits into
Conversation
Add a version-specific conformance matrix and deterministic header and state-echo properties. Characterize existing root-prefix receive behavior without tightening URI policy. Signed-off-by: HarshPopat23 <musichk61@gmail.com>
🤖 Augment PR SummarySummary: Adds focused MCP conformance and receive-policy coverage.
🤖 Was this summary useful? React with 👍 or 👎 |
jviotti
reviewed
Oct 28, 2026
Member
There was a problem hiding this comment.
Please use the existing test files to add tests where relevant. If you think about it, all tests we have are by definition "conformance" as that's the point!
jviotti
reviewed
Oct 28, 2026
| } | ||
|
|
||
| TEST(conformance_continuation_rejects_unsolicited_state_property) { | ||
| for (const auto *const token : {"", "state", "STATE"}) { |
Member
There was a problem hiding this comment.
Also try to avoid using loops in tests. This should really be 3 different tests. In general, a good unit test should be sequential and direct.
Move header and continuation coverage into the relevant suites. Replace loop-driven cases with self-contained sequential tests and remove the conformance fixture and CMake entry. Signed-off-by: HarshPopat23 <musichk61@gmail.com>
jviotti
reviewed
Oct 28, 2026
|
|
||
| TEST(validate_continuation_root_uppercase_scheme) { | ||
| const auto input{sourcemeta::core::parse_json( | ||
| R"JSON({"_meta": {"io.modelcontextprotocol/protocolVersion": "2026-07-28", "io.modelcontextprotocol/clientCapabilities": {}}, "requestState": "state", "inputResponses": {"r": {"roots": [{"uri": "FILE:///tmp"}]}}})JSON")}; |
Member
There was a problem hiding this comment.
Much better! But can we prettify all JSON documents on all the new tests? Otherwise these big lines are very hard to read. There is no reason why they have to be a single stringified line?
Keep fixture values and assertions unchanged while making nested metadata and continuation documents readable. Signed-off-by: HarshPopat23 <musichk61@gmail.com>
This branch has not been deployed
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.
Summary
Add focused conformance tests for MCP metadata, parameter headers and continuations across the four supported protocol revisions.
This PR changes only test coverage and its CMake registration. Production validation behavior, public APIs and benchmarks remain unchanged.
Changes
Version-specific conformance matrix
Exercise explicit expectations across:
2025-03-262025-06-182025-11-252026-07-28Verify request-metadata requirements, continuation availability and rejection of parameter-header validation under unsupported revisions.
Deterministic property tests
These tests use explicit expected outcomes rather than deriving expectations from the feature helpers under test.
Root-identifier receive policy
Separate rejection of non-file identifiers from characterization of the current prefix-based receive behavior.
The tests explicitly identify acceptance of
file://bad spaceandfile://as current behavior—not evidence that these are valid URIs.Maintainer guidance requested
The [2026-07-28 schema](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/schema/2026-07-28/schema.ts) requires root identifiers to start with
file://and annotates the field with@format uri.Should continuation validation additionally enforce complete URI syntax, or retain the existing prefix-based receive policy?
No stricter URI checks are introduced pending agreement.
Verification
Scope and limitations
These are bounded, deterministic property tests—not exhaustive protocol certification or fuzz testing.
This PR does not implement resource authorization, filesystem containment, SSRF protection or continuation replay protection. It preserves the existing application boundaries.
No internal Markdown notes, additional dependencies or performance claims are included.