wordpress/php-mcp-schema
PHP implementation of the Model Context Protocol (MCP) schema, offering lightweight, strictly typed classes, enums, and helpers for building MCP servers and clients. Use it to connect WordPress and PHP applications with MCP-compatible AI tools, agents, and services.
2025-11-25 and 2026-07-28. This supports a deliberate decision about which protocol revision(s) your Laravel/PHP product supports, rather than implicitly following a generated DTO surface.Client, Common, Server namespaces, DTO constructors/factories, class enums, validation flags, or toArray() variants must be scheduled for migration before upgrading.UnsupportedRevisionException and validation is always on, the package enforces explicit revision support. Product should treat MCP revision support as a versioned capability, with release notes and migration guides as customer-facing upgrade artifacts.@since annotations increase upgrade overhead. Product should avoid exposing the package’s internal object model as a public contract and should version its own MCP-facing APIs independently.Consider adoption when:
2025-11-25 or 2026-07-28.allOf refinements of Error, and strict rejection of malformed input.Look elsewhere or defer when:
For executives: This package gives our PHP/Laravel MCP work revision-exact schema validation without us building and maintaining a protocol validator. The trade-off is that v0.2.0 is a breaking release: the old generated DTO API is gone, so upgrading requires planned migration work. We should treat MCP revision support as a product capability, pin versions, and avoid exposing the package’s internal objects as our own API.
For engineering: v0.2.0 replaces the generated DTO API with a dependency-free runtime for exact MCP revisions 2025-11-25 and 2026-07-28. Construction moves to Schemas::create()->forVersion($revision) with immutable Record objects via fromArray(), fromValue(), or fromJson(). Validation is always on, unsupported revisions throw, and there are no compatibility aliases. The release also improves numeric handling, union hydration, input rejection, and memory use for large payloads. Read and schedule the migration guide before upgrading.
How can I help you explore Laravel packages today?