diff --git a/src/Common/McpHttpHeaders.cs b/src/Common/McpHttpHeaders.cs index 5c631a0e7..0768cb442 100644 --- a/src/Common/McpHttpHeaders.cs +++ b/src/Common/McpHttpHeaders.cs @@ -10,14 +10,27 @@ namespace ModelContextProtocol.Protocol; internal static class McpHttpHeaders { /// - /// The minimum protocol version that requires standard MCP request headers. + /// The draft MCP protocol version string used to gate behaviors that are only enabled + /// for clients negotiating the in-progress draft specification. /// /// - /// Servers enforce missing Mcp-Method and Mcp-Name headers as errors only when - /// the client's MCP-Protocol-Version header indicates this version or later. - /// Clients using older versions are not required to send these headers. + /// Behaviors currently gated on this version include: + /// + /// + /// Requiring the standard MCP request headers (Mcp-Method and Mcp-Name) + /// on Streamable HTTP POST requests; servers treat missing headers as errors only when + /// the client's MCP-Protocol-Version header matches this value. + /// + /// + /// Reporting unresolvable resource URIs from resources/read with the standard + /// JSON-RPC (-32602) code rather than the + /// legacy (-32002) code. + /// + /// + /// The associated helpers perform exact ordinal matches against this single value rather + /// than any ordered comparison. /// - public static readonly string MinVersionForStandardHeaders = "DRAFT-2026-v1"; + public const string DraftProtocolVersion = "DRAFT-2026-v1"; /// The session identifier header. public const string SessionId = "Mcp-Session-Id"; @@ -67,7 +80,7 @@ internal static class McpHttpHeaders /// private static readonly HashSet s_versionsWithStandardHeaders = new(StringComparer.Ordinal) { - MinVersionForStandardHeaders, + DraftProtocolVersion, }; /// @@ -82,5 +95,5 @@ public static bool SupportsStandardHeaders(string? protocolVersion) /// rather than the legacy (-32002). /// internal static bool UseInvalidParamsForMissingResource(string? protocolVersion) - => string.Equals(protocolVersion, MinVersionForStandardHeaders, StringComparison.Ordinal); + => string.Equals(protocolVersion, DraftProtocolVersion, StringComparison.Ordinal); }