Download the PHP package php-mcp/schema without Composer
On this page you can find all versions of the php package php-mcp/schema. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download php-mcp/schema
More information about php-mcp/schema
Files in php-mcp/schema
Package schema
Short Description PHP Data Transfer Objects (DTOs) and Enums for the Model Context Protocol (MCP) schema.
License MIT
Informations about the package schema
PHP MCP Schema
Type-safe PHP DTOs for the Model Context Protocol (MCP) specification.
This package provides comprehensive Data Transfer Objects and Enums that ensure full compliance with the official MCP schema, enabling robust server and client implementations with complete type safety.
🎯 MCP Schema Version: 2025-03-26 (Latest)
Installation
Requirements: PHP 8.1+ • No dependencies
Quick Start
Core Features
🏗️ Complete Schema Coverage
Every MCP protocol type is represented with full validation and type safety.
🔒 Immutable Design
All DTOs use readonly properties to prevent accidental mutations.
🚀 Developer Experience
- Factory Methods: Convenient
make()
methods for fluent object creation - Array Conversion: Seamless
toArray()
andfromArray()
methods - JSON Ready: Built-in
JsonSerializable
interface support - Validation: Comprehensive input validation with clear error messages
📦 Schema Components
Component | Description |
---|---|
Tools | Tool definitions with JSON Schema validation |
Resources | Static and template-based resource representations |
Prompts | Interactive prompt definitions with arguments |
Content | Text, image, audio, and blob content types |
JSON-RPC | Complete JSON-RPC 2.0 protocol implementation |
Requests/Results | All 15 request types and corresponding responses |
Notifications | Real-time event notification messages |
Capabilities | Client and server capability declarations |
Usage Patterns
Creating Protocol Messages
Working with Resources
Content Handling
Package Structure
Why Use This Package?
- ✅ 100% MCP Compliance - Matches official specification exactly
- ✅ Type Safety - Catch errors at development time, not runtime
- ✅ Zero Dependencies - Lightweight and self-contained
- ✅ Production Ready - Immutable, validated, and thoroughly tested
- ✅ Future Proof - Updated with latest MCP specification versions
License
MIT License. See LICENSE for details.
Part of the PHP MCP ecosystem • Build type-safe MCP applications with confidence