Skip to content

Bring up to 0.1.13 conformance#1254

Open
stephentoub wants to merge 1 commit intomodelcontextprotocol:mainfrom
stephentoub:conformancetests
Open

Bring up to 0.1.13 conformance#1254
stephentoub wants to merge 1 commit intomodelcontextprotocol:mainfrom
stephentoub:conformancetests

Conversation

@stephentoub
Copy link
Contributor

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the SDK and its conformance harness to align with the MCP conformance suite around v0.1.13, focusing on elicitation default handling, additional conformance scenarios, and OAuth/token-endpoint behavior.

Changes:

  • Apply elicitation schema defaults defensively on both client and server (and add targeted tests to verify behavior).
  • Extend conformance server/client to cover additional scenarios (JSON Schema 2020-12 tool, SSE polling/retry, OAuth scenarios).
  • Update OAuth token endpoint request construction to support different token endpoint auth methods.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/ModelContextProtocol.Tests/Protocol/ElicitationServerDefaultsTests.cs Adds server-side defense-in-depth tests for applying schema defaults to elicitation results.
tests/ModelContextProtocol.Tests/Protocol/ElicitationClientDefaultsTests.cs Adds client-side tests to ensure defaults are applied before sending elicitation responses.
tests/ModelContextProtocol.ConformanceServer/Tools/ConformanceTools.cs Adds a JSON Schema 2020-12 tool and an SSE reconnection test tool.
tests/ModelContextProtocol.ConformanceServer/Program.cs Enables SSE resumability via an in-memory distributed cache store and wires reconnection/polling behavior.
tests/ModelContextProtocol.ConformanceClient/Program.cs Adds elicitation handler defaults + new conformance scenarios + pre-registered OAuth credential support.
tests/ModelContextProtocol.AspNetCore.Tests/ServerConformanceTests.cs Runs additional pending server conformance scenarios via explicit scenario args.
tests/ModelContextProtocol.AspNetCore.Tests/ClientConformanceTests.cs Expands the set of client conformance scenarios executed.
src/ModelContextProtocol.Core/Server/McpServer.Methods.cs Applies defaults to elicitation results returned to server callers.
src/ModelContextProtocol.Core/Protocol/ElicitResult.cs Introduces default-application helper for elicitation results.
src/ModelContextProtocol.Core/Protocol/ElicitRequestParams.cs Adds schema helper to materialize default values as JsonElement.
src/ModelContextProtocol.Core/Client/McpClientImpl.cs Applies schema defaults to elicitation handler results before serialization/return.
src/ModelContextProtocol.Core/Authentication/ClientOAuthProvider.cs Adjusts token request creation to support basic/post/none token endpoint auth methods.

var runTask = server.RunAsync(TestContext.Current.CancellationToken);
await transport.InitializeAsync();

var result = await server.ElicitAsync(new ElicitRequestParams
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add tests for ElicitAsync<T>? I think it should work, but it might be worth covering.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

@halter73
Copy link
Contributor

halter73 commented Feb 6, 2026

I remember the earlier version of this PR made changes to the client to support multiple auth scope step ups given repeated 403s. I guess Copilot added that unnecessarily before? It did seem odd that the conformance tests required the client support repeated step ups. Testing it doesn't get stuck in an infinite loop makes more sense.

@stephentoub
Copy link
Contributor Author

I remember the earlier version of this PR made changes to the client to support multiple auth scope step ups given repeated 403s. I guess Copilot added that unnecessarily before? It did seem odd that the conformance tests required the client support repeated step ups. Testing it doesn't get stuck in an infinite loop makes more sense.

Wasn't that in support for some of the tests that are no longer required? (or am I misremembering)

@halter73
Copy link
Contributor

halter73 commented Feb 6, 2026

I don't think so. My suspicion is that Copilot thought that it was necessary for the "auth/scope-retry-limit" scenario incorrectly. I'm not sure though. It should have seen it already passing, but maybe there were unrelated errors in the initial iterations that threw it off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants