Breaking release. The generated DTO API is replaced by a dependency-free runtime for the exact MCP schema revisions 2025-11-25 and 2026-07-28. Read the migration guide before upgrading.
Breaking changes
- Construction starts with
Schemas::create()->forVersion($revision)and usesSchema::fromArray(),fromValue(), orfromJson()to return immutable records. Validation is always on and exact for the selected revision; unknown revision identifiers throwUnsupportedRevisionException. - Public protocol objects live under
Record, object unions underContract, and enum-like string constants underValue. The formerClient,Common, andServernamespaces, DTO constructors and factories, class-based enums, validation flags, andtoArray()variants are removed with no compatibility aliases. - Overlapping object unions hydrate the valid record that declares the most input keys, with canonical order as the tie-breaker. Scalar unions keep canonical first-match behavior.
SchemaExceptionand every runtime exception extend\InvalidArgumentException.
Changed
- Fractional
ElicitResult.contentvalues are accepted in both revisions;2026-07-28JSONValueaccepts fractional numbers andnull;2025-11-25NumberSchema.default,minimum, andmaximumaccept fractional numbers. - Safe inline
allOfrefinements of the canonicalErrordefinition hydrateRecord\Errorrather than an anonymousstdClass.
Fixed
- Raw JSON numeric scanning is linear for dense numeric documents and rejects non-finite or native-overflowing numeric tokens.
- Programmatic input rejects NUL-prefixed object keys, aligns its nesting limit with raw JSON, and rejects out-of-native-range integral floats only where an integer schema requires them.
- Numeric-literal getters preserve validated integral floats such as
-32700.0. - Large validated inputs use less peak memory; an 8 MiB payload completes within a 128 MiB PHP memory limit.
- A
typelist containingarrayandnullacceptsnull.
Removed
- Generated
skill/type reference and lookup scripts. - Per-class
@sinceprotocol-history annotations.
Full Changelog: v0.1.3...v0.2.0