Class UnsupportedProtocolVersionException
- Namespace
- ModelContextProtocol
- Assembly
- ModelContextProtocol.Core.dll
Represents an exception used to signal that a request's declared protocol version is not supported by the server.
public sealed class UnsupportedProtocolVersionException : McpProtocolException, ISerializable
- Inheritance
-
UnsupportedProtocolVersionException
- Implements
- Inherited Members
Remarks
Introduced by the 2026-07-28 protocol revision (SEP-2575). Servers throw this exception when they cannot process
a request because the per-request _meta/io.modelcontextprotocol/protocolVersion (or the equivalent
transport-level header) names a version the server does not implement. The exception is converted to a
JSON-RPC error response with code UnsupportedProtocolVersion (-32022) and
a UnsupportedProtocolVersionErrorData payload.
Constructors
UnsupportedProtocolVersionException(string, IEnumerable<string>, string?)
Initializes a new instance of the UnsupportedProtocolVersionException class.
public UnsupportedProtocolVersionException(string requested, IEnumerable<string> supported, string? message = null)
Parameters
requestedstringThe protocol version the client requested.
supportedIEnumerable<string>The protocol versions the server supports.
messagestringA human-readable description of the error. If null, a default message is used.
Properties
Requested
Gets the protocol version the client requested.
public string Requested { get; }
Property Value
Supported
Gets the protocol versions the server supports.
public IReadOnlyList<string> Supported { get; }