From aceaafe1a1e45f889b7470a9537ed16116817dde Mon Sep 17 00:00:00 2001 From: Eirik Tsarpalis Date: Mon, 26 Jan 2026 18:07:14 +0200 Subject: [PATCH 1/7] Commit conformance tester package version --- Directory.Packages.props | 2 ++ .../ModelContextProtocol.AspNetCore.Tests.csproj | 7 +++++++ .../ServerConformanceTests.cs | 13 ++++++++++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 42af0c0c4..7dc108ce8 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,6 +5,8 @@ 9.0.11 10.0.2 10.2.0 + + 0.1.9 diff --git a/tests/ModelContextProtocol.AspNetCore.Tests/ModelContextProtocol.AspNetCore.Tests.csproj b/tests/ModelContextProtocol.AspNetCore.Tests/ModelContextProtocol.AspNetCore.Tests.csproj index 095560a22..934a81cad 100644 --- a/tests/ModelContextProtocol.AspNetCore.Tests/ModelContextProtocol.AspNetCore.Tests.csproj +++ b/tests/ModelContextProtocol.AspNetCore.Tests/ModelContextProtocol.AspNetCore.Tests.csproj @@ -51,6 +51,13 @@ + + + <_Parameter1>McpConformanceVersion + <_Parameter2>$(McpConformanceVersion) + + + diff --git a/tests/ModelContextProtocol.AspNetCore.Tests/ServerConformanceTests.cs b/tests/ModelContextProtocol.AspNetCore.Tests/ServerConformanceTests.cs index 312f32457..7e8f831f3 100644 --- a/tests/ModelContextProtocol.AspNetCore.Tests/ServerConformanceTests.cs +++ b/tests/ModelContextProtocol.AspNetCore.Tests/ServerConformanceTests.cs @@ -115,9 +115,20 @@ private void StartConformanceServer() _serverTask = Task.Run(() => ConformanceServer.Program.MainAsync(["--urls", _serverUrl], new XunitLoggerProvider(_output), cancellationToken: _serverCts.Token)); } + private static string GetConformanceVersion() + { + var assembly = typeof(ServerConformanceTests).Assembly; + var attribute = assembly.GetCustomAttributes(typeof(System.Reflection.AssemblyMetadataAttribute), false) + .Cast() + .FirstOrDefault(a => a.Key == "McpConformanceVersion"); + return attribute?.Value ?? throw new InvalidOperationException("McpConformanceVersion not found in assembly metadata"); + } + private async Task<(bool Success, string Output, string Error)> RunNpxConformanceTests() { - var startInfo = NodeHelpers.NpxStartInfo($"-y @modelcontextprotocol/conformance server --url {_serverUrl}"); + // Version is configured in Directory.Packages.props for central management + var version = GetConformanceVersion(); + var startInfo = NodeHelpers.NpxStartInfo($"-y @modelcontextprotocol/conformance@{version} server --url {_serverUrl}"); var outputBuilder = new StringBuilder(); var errorBuilder = new StringBuilder(); From 6ff668e82080aa27110d46f02a32d39e2764adea Mon Sep 17 00:00:00 2001 From: Eirik Tsarpalis Date: Mon, 26 Jan 2026 18:46:45 +0200 Subject: [PATCH 2/7] Bump to version 0.1.10 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 7dc108ce8..562dc1da0 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -6,7 +6,7 @@ 10.0.2 10.2.0 - 0.1.9 + 0.1.10 From 8fd64d7979ff4e8aa42054e84ef72e34d5c8535a Mon Sep 17 00:00:00 2001 From: Eirik Tsarpalis Date: Mon, 26 Jan 2026 19:59:30 +0200 Subject: [PATCH 3/7] Add debug logging --- .../ServerConformanceTests.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/ModelContextProtocol.AspNetCore.Tests/ServerConformanceTests.cs b/tests/ModelContextProtocol.AspNetCore.Tests/ServerConformanceTests.cs index 7e8f831f3..3b56b56e5 100644 --- a/tests/ModelContextProtocol.AspNetCore.Tests/ServerConformanceTests.cs +++ b/tests/ModelContextProtocol.AspNetCore.Tests/ServerConformanceTests.cs @@ -128,6 +128,18 @@ private static string GetConformanceVersion() { // Version is configured in Directory.Packages.props for central management var version = GetConformanceVersion(); + _output.WriteLine($"=== Requested conformance package version: {version} ==="); + + // First, check the actual version that will be used + var versionCheckInfo = NodeHelpers.NpxStartInfo($"-y @modelcontextprotocol/conformance@{version} --version"); + var versionProcess = Process.Start(versionCheckInfo); + if (versionProcess != null) + { + var actualVersion = await versionProcess.StandardOutput.ReadToEndAsync(); + await versionProcess.WaitForExitAsync(); + _output.WriteLine($"=== Actual conformance package version: {actualVersion.Trim()} ==="); + } + var startInfo = NodeHelpers.NpxStartInfo($"-y @modelcontextprotocol/conformance@{version} server --url {_serverUrl}"); var outputBuilder = new StringBuilder(); From b7a3c078640dd1b49b479c960c8c28b2cab787b0 Mon Sep 17 00:00:00 2001 From: Eirik Tsarpalis Date: Mon, 26 Jan 2026 21:14:30 +0200 Subject: [PATCH 4/7] Fix sourcegen related failure occurring in net9.0 --- tests/ModelContextProtocol.ConformanceServer/Program.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/ModelContextProtocol.ConformanceServer/Program.cs b/tests/ModelContextProtocol.ConformanceServer/Program.cs index 10422678d..aece25822 100644 --- a/tests/ModelContextProtocol.ConformanceServer/Program.cs +++ b/tests/ModelContextProtocol.ConformanceServer/Program.cs @@ -94,7 +94,8 @@ public static async Task MainAsync(string[] args, ILoggerProvider? loggerProvide app.MapMcp(); - app.MapGet("/health", () => TypedResults.Ok("Healthy")); + // Return plain string to avoid JSON serialization issues when reflection is disabled + app.MapGet("/health", () => "Healthy"); await app.RunAsync(cancellationToken); } From 204036414482ee58f2889b7dcaba6d3997da1ef7 Mon Sep 17 00:00:00 2001 From: Eirik Tsarpalis Date: Mon, 26 Jan 2026 21:20:21 +0200 Subject: [PATCH 5/7] Update tests/ModelContextProtocol.ConformanceServer/Program.cs --- tests/ModelContextProtocol.ConformanceServer/Program.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/ModelContextProtocol.ConformanceServer/Program.cs b/tests/ModelContextProtocol.ConformanceServer/Program.cs index aece25822..00e557e7f 100644 --- a/tests/ModelContextProtocol.ConformanceServer/Program.cs +++ b/tests/ModelContextProtocol.ConformanceServer/Program.cs @@ -94,7 +94,6 @@ public static async Task MainAsync(string[] args, ILoggerProvider? loggerProvide app.MapMcp(); - // Return plain string to avoid JSON serialization issues when reflection is disabled app.MapGet("/health", () => "Healthy"); await app.RunAsync(cancellationToken); From 9c60c02e5acd35a289538820df3fb5e61e509283 Mon Sep 17 00:00:00 2001 From: Eirik Tsarpalis Date: Mon, 26 Jan 2026 21:45:31 +0200 Subject: [PATCH 6/7] Remove install step from yml file --- .github/workflows/ci-build-test.yml | 3 --- .../ServerConformanceTests.cs | 11 ----------- 2 files changed, 14 deletions(-) diff --git a/.github/workflows/ci-build-test.yml b/.github/workflows/ci-build-test.yml index ab203482f..c8f2d2e28 100644 --- a/.github/workflows/ci-build-test.yml +++ b/.github/workflows/ci-build-test.yml @@ -67,9 +67,6 @@ jobs: - name: 📦 Install dependencies for tests run: npm install @modelcontextprotocol/server-memory - - name: 📦 Install dependencies for tests - run: npm install @modelcontextprotocol/conformance - - name: 🏗️ Build run: make build CONFIGURATION=${{ matrix.configuration }} diff --git a/tests/ModelContextProtocol.AspNetCore.Tests/ServerConformanceTests.cs b/tests/ModelContextProtocol.AspNetCore.Tests/ServerConformanceTests.cs index 3b56b56e5..3948ad19a 100644 --- a/tests/ModelContextProtocol.AspNetCore.Tests/ServerConformanceTests.cs +++ b/tests/ModelContextProtocol.AspNetCore.Tests/ServerConformanceTests.cs @@ -128,17 +128,6 @@ private static string GetConformanceVersion() { // Version is configured in Directory.Packages.props for central management var version = GetConformanceVersion(); - _output.WriteLine($"=== Requested conformance package version: {version} ==="); - - // First, check the actual version that will be used - var versionCheckInfo = NodeHelpers.NpxStartInfo($"-y @modelcontextprotocol/conformance@{version} --version"); - var versionProcess = Process.Start(versionCheckInfo); - if (versionProcess != null) - { - var actualVersion = await versionProcess.StandardOutput.ReadToEndAsync(); - await versionProcess.WaitForExitAsync(); - _output.WriteLine($"=== Actual conformance package version: {actualVersion.Trim()} ==="); - } var startInfo = NodeHelpers.NpxStartInfo($"-y @modelcontextprotocol/conformance@{version} server --url {_serverUrl}"); From 33bcc6285a8d24492ce4c7dc911a0ab63eedf127 Mon Sep 17 00:00:00 2001 From: Eirik Tsarpalis Date: Mon, 26 Jan 2026 22:15:21 +0200 Subject: [PATCH 7/7] Attempt to duplicate the version string --- .github/workflows/ci-build-test.yml | 4 ++++ Directory.Packages.props | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-build-test.yml b/.github/workflows/ci-build-test.yml index c8f2d2e28..838dce4cf 100644 --- a/.github/workflows/ci-build-test.yml +++ b/.github/workflows/ci-build-test.yml @@ -67,6 +67,10 @@ jobs: - name: 📦 Install dependencies for tests run: npm install @modelcontextprotocol/server-memory + # Keep version in sync with McpConformanceVersion in Directory.Packages.props + - name: 📦 Install conformance test runner + run: npm install @modelcontextprotocol/conformance@0.1.10 + - name: 🏗️ Build run: make build CONFIGURATION=${{ matrix.configuration }} diff --git a/Directory.Packages.props b/Directory.Packages.props index 562dc1da0..b5f599099 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,7 +5,8 @@ 9.0.11 10.0.2 10.2.0 - + 0.1.10