php-sdk/tests/Unit/Schema
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Christopher Hertel 5e73683079
[Server] Close the conformance gaps in the modern lifecycle (#447)
* [Server] Let the client gateway see modern-era capabilities

The six supports*() probes read session state only InitializeHandler wrote,
so every request served statelessly reported no client capabilities at all —
a tool guarding on them took the unsupported branch without a signal.
StatelessProtocol now writes the request's declaration under the same keys.

* [Server] Reject the RPCs 2026-07-28 removed

resources/subscribe and resources/unsubscribe were still dispatched and
answered 200 OK, recording subscriptions the modern era never reads. They
join initialize, ping and logging/setLevel in the era guard; the handlers
stay registered because the handshake era still serves them.

* [Server] Decode a wrapped Mcp-Name before comparing it

The Base64 sentinel was only unwrapped for Mcp-Param-*, so any resource URI
or tool name outside the header-safe ASCII set — which the spec explicitly
tells clients to wrap — was compared encoded and refused with -32020.

* [Server] Require the MCP-Protocol-Version header

It was only checked for contradicting the body, so omitting it entirely
passed — leaving the value intermediaries route on unenforced. Tied to the
header validator's presence, since that is what a header-bearing transport
installs and stdio carries its metadata inline.

* [Server] Read the modern-era request body whole

A single read() takes whatever the stream cares to give — 64 bytes from a
chunked transfer is legal — so an oversized-but-valid POST came back as a
parse error. Shares the legacy transport's incremental read as a trait.

* [Schema][Server] Answer a notification with a status, not a response

A body with no id was dispatched as a request and came back as a JSON-RPC
error carrying "id": "" — an id nobody issued, and on a path a client uses
to tell a modern server from a legacy one. Notifications now get 202 and no
body, and Error omits an id it could not read instead of emptying it.

* [Server] Stop emitting the error codes 2026-07-28 reserved

resources/read answered -32002, which this revision forbids; prompts/get
and completion/complete answered it for an unknown *name*, which it never
meant; tools/call answered -32601, which belongs to an unknown method.
Only the resources/read code is revision-gated — older peers expect -32002
there, and nowhere else. Also routes the -32021 capability exception out of
the prompt and resource handlers, which were swallowing it into -32603.
2026-08-18 23:09:34 +02:00
..
Content [Schema][Server] Close the 2025-11-25 schema gaps and add the 2026-07-28 surface (#421) 2026-08-17 23:09:39 +02:00
Elicitation [Schema] Stop rejecting elicitation schemas the specification allows (#437) 2026-08-18 19:49:15 +02:00
Enum [Server] Close the conformance gaps in the modern lifecycle (#447) 2026-08-18 23:09:34 +02:00
Extension [Schema][Server] Add the extensions framework SEP-2133 defines (#443) 2026-08-18 20:47:27 +02:00
JsonRpc [Schema][Server] Close the 2025-11-25 schema gaps and add the 2026-07-28 surface (#421) 2026-08-17 23:09:39 +02:00
Request [Schema][Server] Harden sampling tools against the spec (#420) 2026-08-15 04:13:53 +02:00
Result [Schema][Server] Close the 2025-11-25 schema gaps and add the 2026-07-28 surface (#421) 2026-08-17 23:09:39 +02:00
ClientCapabilitiesTest.php [Schema][Server] Close the 2025-11-25 schema gaps and add the 2026-07-28 surface (#421) 2026-08-17 23:09:39 +02:00
ElicitationModeTest.php [Schema][Server] Close the 2025-11-25 schema gaps and add the 2026-07-28 surface (#421) 2026-08-17 23:09:39 +02:00
IconTest.php [Schema][Server] Close the 2025-11-25 schema gaps and add the 2026-07-28 surface (#421) 2026-08-17 23:09:39 +02:00
ImplementationTest.php [Schema][Server] Close the 2025-11-25 schema gaps and add the 2026-07-28 surface (#421) 2026-08-17 23:09:39 +02:00
NonObjectOutputSchemaTest.php [Schema][Server] Close the 2025-11-25 schema gaps and add the 2026-07-28 surface (#421) 2026-08-17 23:09:39 +02:00
ResourceDefinitionTest.php [Schema] Drop SDK-only name pattern on resources and resource templates (#430) 2026-08-18 02:09:07 +02:00
ResourceTemplateTest.php [Schema] Drop SDK-only name pattern on resources and resource templates (#430) 2026-08-18 02:09:07 +02:00
ServerCapabilitiesTest.php Split testsuite for unit and inspector based tests (#82) 2025-09-25 22:27:41 +01:00
ToolChoiceTest.php [Schema][Server] Close the 2025-11-25 schema gaps and add the 2026-07-28 surface (#421) 2026-08-17 23:09:39 +02:00
ToolHeaderAnnotationTest.php [Schema] Refuse an invalid x-mcp-header annotation at definition time (#441) 2026-08-18 20:16:35 +02:00
ToolTest.php [Schema] Always emit {} for empty tool schema properties (#407) 2026-08-14 21:50:08 +02:00