From 0e6184a4aa42a9fb756a45d61089a7a739b24ca7 Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Fri, 20 Jun 2025 12:03:28 -0400 Subject: [PATCH] Add 2025-06-18 as supported version (#529) --- .../HttpServerTransportOptions.cs | 2 +- .../McpEndpointRouteBuilderExtensions.cs | 2 +- .../Client/SseClientTransportOptions.cs | 2 +- src/ModelContextProtocol.Core/McpSession.cs | 3 ++- .../MapMcpStreamableHttpTests.cs | 5 ++++- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/ModelContextProtocol.AspNetCore/HttpServerTransportOptions.cs b/src/ModelContextProtocol.AspNetCore/HttpServerTransportOptions.cs index b88cfb7..677606e 100644 --- a/src/ModelContextProtocol.AspNetCore/HttpServerTransportOptions.cs +++ b/src/ModelContextProtocol.AspNetCore/HttpServerTransportOptions.cs @@ -6,7 +6,7 @@ namespace ModelContextProtocol.AspNetCore; /// /// Configuration options for . /// which implements the Streaming HTTP transport for the Model Context Protocol. -/// See the protocol specification for details on the Streamable HTTP transport. +/// See the protocol specification for details on the Streamable HTTP transport. /// public class HttpServerTransportOptions { diff --git a/src/ModelContextProtocol.AspNetCore/McpEndpointRouteBuilderExtensions.cs b/src/ModelContextProtocol.AspNetCore/McpEndpointRouteBuilderExtensions.cs index a65994c..e7c5f97 100644 --- a/src/ModelContextProtocol.AspNetCore/McpEndpointRouteBuilderExtensions.cs +++ b/src/ModelContextProtocol.AspNetCore/McpEndpointRouteBuilderExtensions.cs @@ -15,7 +15,7 @@ public static class McpEndpointRouteBuilderExtensions { /// /// Sets up endpoints for handling MCP Streamable HTTP transport. - /// See the 2025-03-26 protocol specification for details about the Streamable HTTP transport. + /// See the 2025-06-18 protocol specification for details about the Streamable HTTP transport. /// Also maps legacy SSE endpoints for backward compatibility at the path "/sse" and "/message". the 2024-11-05 protocol specification for details about the HTTP with SSE transport. /// /// The web application to attach MCP HTTP endpoints. diff --git a/src/ModelContextProtocol.Core/Client/SseClientTransportOptions.cs b/src/ModelContextProtocol.Core/Client/SseClientTransportOptions.cs index cd522c4..9b4af6d 100644 --- a/src/ModelContextProtocol.Core/Client/SseClientTransportOptions.cs +++ b/src/ModelContextProtocol.Core/Client/SseClientTransportOptions.cs @@ -39,7 +39,7 @@ public sealed class SseClientTransportOptions /// Streamable HTTP transport and automatically fall back to SSE transport if the server doesn't support it. /// /// - /// Streamable HTTP transport specification. + /// Streamable HTTP transport specification. /// HTTP with SSE transport specification. /// /// diff --git a/src/ModelContextProtocol.Core/McpSession.cs b/src/ModelContextProtocol.Core/McpSession.cs index 225971f..47c4d21 100644 --- a/src/ModelContextProtocol.Core/McpSession.cs +++ b/src/ModelContextProtocol.Core/McpSession.cs @@ -29,12 +29,13 @@ internal sealed partial class McpSession : IDisposable "mcp.server.operation.duration", "Measures the duration of inbound message processing.", longBuckets: false); /// The latest version of the protocol supported by this implementation. - internal const string LatestProtocolVersion = "2025-03-26"; + internal const string LatestProtocolVersion = "2025-06-18"; /// All protocol versions supported by this implementation. internal static readonly string[] SupportedProtocolVersions = [ "2024-11-05", + "2025-03-26", LatestProtocolVersion, ]; diff --git a/tests/ModelContextProtocol.AspNetCore.Tests/MapMcpStreamableHttpTests.cs b/tests/ModelContextProtocol.AspNetCore.Tests/MapMcpStreamableHttpTests.cs index b1c1a89..f14cc10 100644 --- a/tests/ModelContextProtocol.AspNetCore.Tests/MapMcpStreamableHttpTests.cs +++ b/tests/ModelContextProtocol.AspNetCore.Tests/MapMcpStreamableHttpTests.cs @@ -171,7 +171,10 @@ public class MapMcpStreamableHttpTests(ITestOutputHelper outputHelper) : MapMcpT await app.StartAsync(TestContext.Current.CancellationToken); - await using var mcpClient = await ConnectAsync(); + await using var mcpClient = await ConnectAsync(clientOptions: new() + { + ProtocolVersion = "2025-03-26", + }); await mcpClient.ListToolsAsync(cancellationToken: TestContext.Current.CancellationToken); // The header should be included in the GET request, the initialized notification, and the tools/list call.