Add conformance tests for SEP-2243 HTTP Standardization#259
Open
mikekistler wants to merge 4 commits intomodelcontextprotocol:mainfrom
Open
Add conformance tests for SEP-2243 HTTP Standardization#259mikekistler wants to merge 4 commits intomodelcontextprotocol:mainfrom
mikekistler wants to merge 4 commits intomodelcontextprotocol:mainfrom
Conversation
commit: |
Contributor
Author
|
Notes on how this was tested: I ran the tests in this branch the support for SEP-2243 added in this branch of the MCP C# SDK and all tests pass. Here's how I ran the tests: # In the MCP C# SDK repo, checkout the branch
git checkout mdk/sep-2243-implementation
# Remove any existing node_modules to get to a known state
rm -rf node_modules
# Install node modules with the exact versions in package lock
npm ci
# Now replace the conformance node module with the tests in this branch
npm install --no-save "@modelcontextprotocol/conformance@github:mikekistler/conformance#mdk/sep-2243-conformance-tests"
# Run the server conformance tests (.NET 10 only)
MCP_CONFORMANCE_PROTOCOL_VERSION=DRAFT-2026-v1 dotnet test tests/ModelContextProtocol.AspNetCore.Tests/ModelContextProtocol.AspNetCore.Tests.csproj -f net10.0 --filter "FullyQualifiedName~ServerConformanceTests"
# Run the client conformanct tests (.NET 10 only)
MCP_CONFORMANCE_PROTOCOL_VERSION=DRAFT-2026-v1 dotnet test tests/ModelContextProtocol.AspNetCore.Tests/ModelContextProtocol.AspNetCore.Tests.csproj -f net10.0 --filter "FullyQualifiedName~ClientConformanceTests"Here's the server conformance test output I got: And here's the output from the client conformance tests: |
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.
Summary
Adds conformance test scenarios for SEP-2243 (HTTP Standardization), covering the new standard and custom MCP request headers.
The PR also adds a "prepare" script to the package.json to allow "npm install" from a branch for pre-merge testing.
Scenarios added
Server scenarios (test server — inspects client requests)
http-standard-headers— Verifies clients sendMcp-MethodandMcp-Nameheaders on HTTP POST requestshttp-custom-headers— Verifies clients handlex-mcp-headerannotations: mirror param values intoMcp-Param-*headers, apply Base64 encoding for non-ASCII values, and convert number/boolean values correctlyhttp-invalid-tool-headers— Verifies clients reject invalidx-mcp-headertool definitions (empty values, duplicates, non-primitive types, illegal characters, etc.)Client scenarios (connect to server under test)
http-header-validation— Verifies servers reject mismatched/missingMcp-Method/Mcp-Nameheaders, accept case-insensitive header names, reject case-mismatched values, trim whitespace, validate Base64-encoded custom headers, and return-32001(HeaderMismatch)http-custom-header-server-validation— Verifies servers validate customMcp-Param-*headers against the request bodyTraceability
src/scenarios/sep-2243.yamlmaps 30+ spec requirements to check IDsNotes
preparescript inpackage.jsonfor git-based dependency installsChecklist
npm run buildpassesnpm testpassessrc/scenarios/index.ts