NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist · #2981 most downloaded on Packagist
PHP Data Transfer Objects (DTOs) and Enums for the Model Context Protocol (MCP) schema.
Last release 1 years ago
25 Jul 2025
Too new to tell
only 2 release windows
Nearly every release is documented
notes for 3 of 3 stable releases
Nothing withdrawn
no release was ever pulled
1 years old
3 releases · first in 2025
One column per month.
Normalize stdClass to array in Request::fromArray() for param type sa… by @judus in #4
Full Changelog: 1.0.1...1.0.2
Fix Tool deserialization to preserve empty properties as stdClass by @CodeWithKyrian in #1
Full Changelog: 1.0.0...1.0.1
I'm excited to announce the first stable release of php-mcp/schema , a comprehensive PHP implementation of Data Transfer Objects (DTOs) and Enums for
I'm excited to announce the first stable release of php-mcp/schema, a comprehensive PHP implementation of Data Transfer Objects (DTOs) and Enums for the Model Context Protocol (MCP).
This package provides type-safe PHP representations of the complete MCP specification, enabling robust server and client implementations with full schema compliance.
MCP Schema Version Support: 2025-03-26 (Latest)
JsonSerializable support for seamless API communicationTool - Tool definitions with JSON Schema validationResource - Static resource representationsResourceTemplate - Dynamic resource templates with URI patternsToolAnnotations - Rich metadata for tool descriptionsTextContent - Plain text content handlingImageContent - Image content with MIME type supportAudioContent - Audio content representationBlobResourceContents - Binary resource handlingEmbeddedResource - Embedded resource contentRequest, Response, Error, Notification)InitializeRequest to CreateSamplingMessageRequestPrompt - Interactive prompt definitionsPromptArgument - Structured prompt parametersClientCapabilities & ServerCapabilities - Capability negotiationModelPreferences - LLM model preference specificationsEvery DTO includes convenient static factory methods:
$tool = Tool::make('calculator', $schema, 'A calculator tool');
$resource = Resource::make('/api/data', 'Dataset', 'Sample dataset');Seamless conversion between PHP objects and arrays:
// To array (for JSON encoding)
$toolArray = $tool->toArray();
// From array (from JSON decoding)
$tool = Tool::fromArray($decodedData);Comprehensive validation with descriptive error messages:
composer require php-mcp/schemaRequirements:
src/
├── Content/ # Content type DTOs (Text, Image, Audio, etc.)
├── Enum/ # Protocol enums (LoggingLevel, Role)
├── JsonRpc/ # JSON-RPC protocol implementation
├── Notification/ # Notification message types
├── Request/ # Request message types
├── Result/ # Response result types
├── Tool.php # Core tool definitions
├── Resource.php # Resource representations
├── Prompt.php # Prompt definitions
└── ... # Additional core types
This stable release provides the foundation for the broader PHP MCP ecosystem:
Contributions are welcome! This package aims to maintain 100% compatibility with the official MCP specification.
MIT License - see LICENSE file for details.
Your coding agent can read these notes before it upgrades. Set up the MCP server →