MCP PHP SDK

ProtocolVersion : string

Registry of the MCP protocol revisions this SDK knows about.

Cases are declared oldest to newest, and that declaration order — not the lexicographic order of the values — is what every comparison here relies on: revision identifiers are an enumerated set, not an ordered scalar, and a future one is not guaranteed to be date-shaped.

The revisions split into two eras:

  • handshake (2025-11-25 and earlier) negotiate a version through the initialize round-trip and keep session state for the connection;
  • modern (self::FIRST_MODERN_VERSION and later) drop initialize entirely — every request carries its own version in _meta, and servers advertise what they speak through server/discover.
Tags
see
https://modelcontextprotocol.io/specification/draft/basic/versioning
author

Illia Vasylevskyi ineersa@gmail.com

Table of Contents

Cases

V2024_11_05  = '2024-11-05'
V2025_03_26  = '2025-03-26'
V2025_06_18  = '2025-06-18'
V2025_11_25  = '2025-11-25'
V2026_07_28  = '2026-07-28'

Methods

handshakeVersions()  : array<int, self>
Revisions reachable through the `initialize` handshake, oldest to newest.
isAtLeast()  : bool
Whether this revision is at least as new as $minimum.
isModern()  : bool
Whether this revision belongs to the modern, per-request-metadata era.
latestHandshake()  : self
Newest revision reachable through the `initialize` handshake.
modernVersions()  : array<int, self>
Revisions using the per-request metadata envelope, oldest to newest.
requiresObjectStructuredContent()  : bool
Whether this revision restricts `structuredContent` to a JSON object.
usesInvalidParamsForResourceNotFound()  : bool
Whether this revision answers a missing resource with `-32602`.
position()  : int
Index of this revision in the chronological declaration order.

Cases

Methods

handshakeVersions()

Revisions reachable through the `initialize` handshake, oldest to newest.

public static handshakeVersions() : array<int, self>
Return values
array<int, self>

isAtLeast()

Whether this revision is at least as new as $minimum.

public isAtLeast(self $minimum) : bool
Parameters
$minimum : self
Return values
bool

isModern()

Whether this revision belongs to the modern, per-request-metadata era.

public isModern() : bool
Return values
bool

latestHandshake()

Newest revision reachable through the `initialize` handshake.

public static latestHandshake() : self

This is what a server counter-offers when it cannot honour the version a client asked for, and what a handshake-era client offers by default.

Return values
self

modernVersions()

Revisions using the per-request metadata envelope, oldest to newest.

public static modernVersions() : array<int, self>
Return values
array<int, self>

usesInvalidParamsForResourceNotFound()

Whether this revision answers a missing resource with `-32602`.

public usesInvalidParamsForResourceNotFound() : bool

SEP-2164, part of self::V2026_07_28, retired the bespoke -32002 in favour of the JSON-RPC code that already meant this, and reserved -32002 so it is never reused. Earlier revisions still expect it, and clients are told to keep accepting it from them.

Tags
see
https://modelcontextprotocol.io/specification/2026-07-28/basic/index#error-codes
Return values
bool

position()

Index of this revision in the chronological declaration order.

private position() : int
Return values
int
On this page

Search results