Repository navigation
Conversation
|
On first glance, this looks good. We will take a closer look before merging, but thanks for getting this prep'd, @Oxygen56! |
|
The production fix looks good and addresses a real compatibility issue for delegated tools with older clients. One issue to fix before merging: the new tests use Could you replace those calls in using var document = JsonDocument.Parse("""{"type":"integer","minimum":0}""");
var schema = document.RootElement.Clone();Please keep the reflection-disabled setting unchanged. The focused tests pass on the other three target frameworks, and all 1,333 server/protocol tests pass on .NET 10. |
Fixes #1916
Summary
Tools wrapped in
DelegatingMcpServerToolnow advertise an output schema matching their structured content to clients on the 2025-06-18 and 2025-11-25 protocols.Unwrap the delegation chain only to identify SDK-created tools, then apply the existing legacy schema transform to the outer tool's
ProtocolTool. Wrapper descriptions and schema constraints are preserved. Custom tools and 2026-07-28 clients retain their existing behavior. No public API is added.Verification
Validated with the original .NET project/MSBuild and xUnit/VSTest entries, using the prepared local dependencies without restore or downloads. Builds retained warnings-as-errors and included the referenced analyzers, hosting/task/app libraries, and test-server prerequisites.
tests/ModelContextProtocol.Tests/ModelContextProtocol.Tests.csprojwith--no-restore --framework net10.0 --configuration Debug: passed with zero warnings/errors on both baseline and repaired sources.dotnet testagainst the selected baseline (3338e88) and repaired sources. The baseline produced 10 expected schema failures and 28 passes; the repair passed all 38 cases. The actual baseline production files were used with the added tests backported temporarily; repaired source bytes were restored before the after-fix build.git diff --check: passed; the contribution worktree is clean.Focused test filter:
FullyQualifiedName~DelegatingToolOutputSchemaTests|FullyQualifiedName~DelegatingMcpServerToolTests|FullyQualifiedName~Sep2106ListToolsBackCompatTestsTests used
--no-build --no-restore --framework net10.0 --configuration Debug, the existing blame/crash handling and 7-minute hang budget, TRX output, and XPlat coverage collection. Coverage includes nested wrappers, wrapper overrides, nullable object and absent schemas, custom tools, both legacy protocols, and modern-client controls.The complete platform/framework/configuration matrix, npm-backed integrations, packaging/API validation, AOT, documentation, and combined coverage workflows remain for CI. They were not run in this offline validation. A separate independent review is still required before publication.
AI assistance was used in preparing this contribution.