What's Changed
Important
This is the last version supporting the 2025-11-25 spec version. All subsequent versions are now geared towards the upcoming new version: 2026-07-28.
Added
- An online API reference for the public
Nexus\Mcp\API, generated from the source with ApiGen and published to GitHub Pages on every push to1.x.
Fixed
- The
#[InputSchema]attribute'sdefinitionparameter no longer claims to be a full schema override in its PHPDoc. Only thetype,$schema,properties, andrequiredkeys of a supplieddefinitionreach the advertised toolinputSchema, which the annotation now documents. - A discovered tool that returns an array the adapter cannot map (a non-empty list whose items are not all content blocks, or an integer-keyed array that is not valid structured content) now throws
UnsupportedReturnValueExceptionnaming the handler method, instead of a bareExpectationFailedException, matching every other unsupported-return path. - A JSON-RPC error response whose
error.datais a non-object JSON value (string, number, list, or boolean) no longer fails to decode. The spec typesError.dataasunknown, soError::$dataand the response parser now accept any JSON value instead of rejecting a non-object. Previously the client discarded such a response without rejecting the correlated request, leaving the caller'sawait()unresolved. - A peer-supplied
jsonrpcversion value carrying control characters is now escaped (non-printable bytes rendered as\xNN) in the version-mismatch error message instead of being emitted raw, consistent with how the method-name fields are already rendered. This stops a peer from forging newlines in plain-text sinks that record the rejection. - A failed transport send during
Client::sendRequest()orClient::initialize()no longer leaves the correlated request registered. Previously, ifsend()threw after the request was registered (for example, writing to an already-closed transport), the pending-request entry was never freed, slowly growing the correlation map. The client now releases the registration before propagating the send failure.
Full Changelog: https://github.com/NexusPHP/mcp-sdk/compare/v0.4.0...v0.5.0