Follow-ups to #1610: de-draft 2026-07-28 terminology, renumber error codes, ProtocolVersion floor (#1671)
This commit is contained in:
parent
90c853103d
commit
d6b1615988
10 changed files with 785 additions and 898 deletions
|
|
@ -8,7 +8,7 @@ namespace ModelContextProtocol.Protocol;
|
|||
/// The discover RPC takes no payload of its own. Per-request metadata
|
||||
/// (protocol version, client info, client capabilities) flows through the
|
||||
/// inherited <see cref="RequestParams.Meta"/> property under the
|
||||
/// <c>io.modelcontextprotocol/*</c> keys defined by the draft protocol revision (SEP-2575).
|
||||
/// <c>io.modelcontextprotocol/*</c> keys defined by the 2026-07-28 protocol revision (SEP-2575).
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public sealed class DiscoverRequestParams : RequestParams
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ namespace ModelContextProtocol.Protocol;
|
|||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// Introduced by the draft protocol revision (SEP-2575) as the canonical way for a client
|
||||
/// Introduced by the 2026-07-28 protocol revision (SEP-2575) as the canonical way for a client
|
||||
/// to learn what a server supports without performing the legacy <c>initialize</c> handshake.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
|
|
@ -47,8 +47,9 @@ public sealed class DiscoverResult : Result, ICacheableResult
|
|||
/// <inheritdoc />
|
||||
/// <remarks>
|
||||
/// Spec PR #2855 makes <c>ttlMs</c> a required field on <see cref="DiscoverResult"/>. The
|
||||
/// server emits a safe default (<see cref="TimeSpan.Zero"/>, i.e. immediately stale) on
|
||||
/// draft sessions when the application has not set an explicit value, preserving today's
|
||||
/// server emits a safe default (<see cref="TimeSpan.Zero"/>, i.e. immediately stale) for the
|
||||
/// 2026-07-28 and later protocol revisions when the application has not set an explicit value,
|
||||
/// preserving today's
|
||||
/// "do not cache" behavior while satisfying the wire requirement.
|
||||
/// </remarks>
|
||||
[JsonPropertyName("ttlMs")]
|
||||
|
|
@ -58,7 +59,8 @@ public sealed class DiscoverResult : Result, ICacheableResult
|
|||
/// <inheritdoc />
|
||||
/// <remarks>
|
||||
/// Spec PR #2855 makes <c>cacheScope</c> a required field on <see cref="DiscoverResult"/>. The
|
||||
/// server emits a safe default (<see cref="Protocol.CacheScope.Private"/>) on draft sessions
|
||||
/// server emits a safe default (<see cref="Protocol.CacheScope.Private"/>) for the 2026-07-28 and
|
||||
/// later protocol revisions
|
||||
/// when the application has not set an explicit value.
|
||||
/// </remarks>
|
||||
[JsonPropertyName("cacheScope")]
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ public sealed class JsonRpcMessageContext
|
|||
/// <c>_meta/io.modelcontextprotocol/clientInfo</c> field.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Introduced by the draft protocol revision (SEP-2575). When the request was made under the draft revision,
|
||||
/// Introduced by the 2026-07-28 protocol revision (SEP-2575). When the request was made under the 2026-07-28 or later revision,
|
||||
/// the server uses this in lieu of the value previously captured during the <c>initialize</c> handshake.
|
||||
/// </remarks>
|
||||
public Implementation? ClientInfo { get; set; }
|
||||
|
|
@ -101,7 +101,7 @@ public sealed class JsonRpcMessageContext
|
|||
/// <c>_meta/io.modelcontextprotocol/clientCapabilities</c> field.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Introduced by the draft protocol revision (SEP-2575). Per the spec, the server MUST NOT infer client
|
||||
/// Introduced by the 2026-07-28 protocol revision (SEP-2575). Per the spec, the server MUST NOT infer client
|
||||
/// capabilities from previous requests; the authoritative value is the one declared on each request.
|
||||
/// </remarks>
|
||||
public ClientCapabilities? ClientCapabilities { get; set; }
|
||||
|
|
@ -111,7 +111,7 @@ public sealed class JsonRpcMessageContext
|
|||
/// <c>_meta/io.modelcontextprotocol/logLevel</c> field.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Introduced by the draft protocol revision (SEP-2575). Replaces the legacy
|
||||
/// Introduced by the 2026-07-28 protocol revision (SEP-2575). Replaces the legacy
|
||||
/// <see cref="RequestMethods.LoggingSetLevel"/> RPC. When absent, the server MUST NOT emit log notifications
|
||||
/// for the request.
|
||||
/// </remarks>
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ public static class MetaKeys
|
|||
/// The metadata key used to carry the MCP protocol version in a request's <c>_meta</c> field.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Introduced by the draft protocol revision (SEP-2575). For HTTP transports, the value MUST
|
||||
/// match the <c>MCP-Protocol-Version</c> header. Servers reject mismatched versions with
|
||||
/// <see cref="McpErrorCode.UnsupportedProtocolVersion"/>.
|
||||
/// Introduced by the 2026-07-28 protocol revision (SEP-2575). For HTTP transports, the value MUST
|
||||
/// match the <c>MCP-Protocol-Version</c> header. Servers reject a header/body mismatch with
|
||||
/// <see cref="McpErrorCode.HeaderMismatch"/>.
|
||||
/// </remarks>
|
||||
public const string ProtocolVersion = "io.modelcontextprotocol/protocolVersion";
|
||||
|
||||
|
|
@ -19,7 +19,7 @@ public static class MetaKeys
|
|||
/// The metadata key used to identify the client software in a request's <c>_meta</c> field.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Introduced by the draft protocol revision (SEP-2575). Carries an <see cref="Protocol.Implementation"/>
|
||||
/// Introduced by the 2026-07-28 protocol revision (SEP-2575). Carries an <see cref="Protocol.Implementation"/>
|
||||
/// describing the client; replaces the <c>clientInfo</c> previously sent only with <c>initialize</c>.
|
||||
/// </remarks>
|
||||
public const string ClientInfo = "io.modelcontextprotocol/clientInfo";
|
||||
|
|
@ -28,7 +28,7 @@ public static class MetaKeys
|
|||
/// The metadata key used to declare client capabilities in a request's <c>_meta</c> field.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Introduced by the draft protocol revision (SEP-2575). Carries a <see cref="Protocol.ClientCapabilities"/>
|
||||
/// Introduced by the 2026-07-28 protocol revision (SEP-2575). Carries a <see cref="Protocol.ClientCapabilities"/>
|
||||
/// describing what optional features the client supports for this specific request. Servers MUST NOT
|
||||
/// infer capabilities from previous requests.
|
||||
/// </remarks>
|
||||
|
|
@ -38,7 +38,7 @@ public static class MetaKeys
|
|||
/// The metadata key used to specify the desired log level for a request's resulting log notifications.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Introduced by the draft protocol revision (SEP-2575). Carries a <see cref="Protocol.LoggingLevel"/>.
|
||||
/// Introduced by the 2026-07-28 protocol revision (SEP-2575). Carries a <see cref="Protocol.LoggingLevel"/>.
|
||||
/// Replaces the legacy <see cref="RequestMethods.LoggingSetLevel"/> RPC. When absent, the server
|
||||
/// MUST NOT send log notifications for the request.
|
||||
/// </remarks>
|
||||
|
|
@ -49,7 +49,7 @@ public static class MetaKeys
|
|||
/// <see cref="RequestMethods.SubscriptionsListen"/> subscription.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Introduced by the draft protocol revision (SEP-2575). Allows clients to demultiplex notifications
|
||||
/// Introduced by the 2026-07-28 protocol revision (SEP-2575). Allows clients to demultiplex notifications
|
||||
/// belonging to different subscriptions on a shared channel (especially STDIO).
|
||||
/// </remarks>
|
||||
public const string SubscriptionId = "io.modelcontextprotocol/subscriptionId";
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ namespace ModelContextProtocol.Protocol;
|
|||
/// Represents the payload for the <see cref="McpErrorCode.MissingRequiredClientCapability"/> JSON-RPC error.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Introduced by the draft protocol revision (SEP-2575). When a server cannot fulfill a request because
|
||||
/// Introduced by the 2026-07-28 protocol revision (SEP-2575). When a server cannot fulfill a request because
|
||||
/// the client did not declare a required capability in its per-request
|
||||
/// <c>_meta/io.modelcontextprotocol/clientCapabilities</c> field, it MUST return this error so clients
|
||||
/// know which capabilities to advertise on a retry.
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ public static class NotificationMethods
|
|||
/// response stream to indicate which notification types the server agreed to deliver.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Introduced by the draft protocol revision (SEP-2575). The notification's params mirror the shape
|
||||
/// Introduced by the 2026-07-28 protocol revision (SEP-2575). The notification's params mirror the shape
|
||||
/// of the requested notifications and include only the entries the server actually supports.
|
||||
/// </remarks>
|
||||
public const string SubscriptionsAcknowledgedNotification = "notifications/subscriptions/acknowledged";
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ public static class RequestMethods
|
|||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// This RPC is introduced in the draft protocol revision (SEP-2575) as the canonical way for a client
|
||||
/// This RPC is introduced in the 2026-07-28 protocol revision (SEP-2575) as the canonical way for a client
|
||||
/// to learn what a server supports without performing the legacy <c>initialize</c> handshake.
|
||||
/// </para>
|
||||
/// <para>
|
||||
|
|
@ -166,7 +166,7 @@ public static class RequestMethods
|
|||
/// information, and optional usage instructions.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// Servers SHOULD implement this method. Legacy clients MAY ignore it. Draft-revision clients
|
||||
/// Servers SHOULD implement this method. Legacy clients MAY ignore it. Clients on the 2026-07-28 revision
|
||||
/// typically call this once during connection establishment.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
|
|
@ -178,7 +178,7 @@ public static class RequestMethods
|
|||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// This RPC is introduced in the draft protocol revision (SEP-2575) and replaces the unsolicited
|
||||
/// This RPC is introduced in the 2026-07-28 protocol revision (SEP-2575) and replaces the unsolicited
|
||||
/// HTTP GET endpoint and the legacy <see cref="ResourcesSubscribe"/> / <see cref="ResourcesUnsubscribe"/>
|
||||
/// request methods.
|
||||
/// </para>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ namespace ModelContextProtocol.Protocol;
|
|||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// Introduced by the draft protocol revision (SEP-2575). This notification is the first message on a
|
||||
/// Introduced by the 2026-07-28 protocol revision (SEP-2575). This notification is the first message on a
|
||||
/// <see cref="RequestMethods.SubscriptionsListen"/> response stream and informs the client which
|
||||
/// subset of requested notification types the server has agreed to deliver.
|
||||
/// </para>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ namespace ModelContextProtocol.Protocol;
|
|||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// Introduced by the draft protocol revision (SEP-2575). The client uses this request to open a
|
||||
/// Introduced by the 2026-07-28 protocol revision (SEP-2575). The client uses this request to open a
|
||||
/// long-lived channel for receiving notifications outside the context of a specific request.
|
||||
/// </para>
|
||||
/// <para>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ namespace ModelContextProtocol.Protocol;
|
|||
/// Represents the payload for the <see cref="McpErrorCode.UnsupportedProtocolVersion"/> JSON-RPC error.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Introduced by the draft protocol revision (SEP-2575). When a server receives a request whose
|
||||
/// Introduced by the 2026-07-28 protocol revision (SEP-2575). When a server receives a request whose
|
||||
/// declared protocol version it does not implement, it MUST return this error so clients can
|
||||
/// fall back to a mutually supported version.
|
||||
/// </remarks>
|
||||
|
|
|
|||
Loading…
Reference in a new issue