nexusphp / mcp-core
PHP SDK for the MCP specification - core component.
Package info
pkg:composer/nexusphp/mcp-core
Fund package maintenance!
v1.0.0
2026-09-04 08:47 UTC
Requires
- php: ^8.3
- amphp/amp: ^3.1.1
- amphp/byte-stream: ^2.1
- nexusphp/assert: ^1.5
- psr/http-message: ^2.0
- psr/log: ^3.0
- revolt/event-loop: ^1.0.8
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
The protocol foundation shared by the server and client halves of the Nexus MCP SDK: the MCP schema types, the JSON-RPC envelope, the transport contract, and the dispatch kernel both sides build on.
Important
This repository is a read-only subtree split of NexusPHP/mcp. Open issues and pull requests there. Anything opened here is closed automatically with the same pointer.
Installation
composer require nexusphp/mcp-core
Most projects want a whole side rather than the foundation alone: nexusphp/mcp-server and
nexusphp/mcp-client both pull this package in, and the umbrella nexusphp/mcp ships everything.
What is inside
| Namespace | Contents |
|---|---|
Nexus\Mcp\Core\Schema |
Every spec-defined object, request, notification, and result as a readonly value object or enum |
Nexus\Mcp\Core\JsonRpc |
Envelope parsing, the method registry, and the JSON-RPC error codes |
Nexus\Mcp\Core\Transport |
The TransportInterface contract, line-delimited duplex helpers, and InMemoryTransport |
Nexus\Mcp\Core\Dispatch |
Request correlation and the coroutine bookkeeping shared by both sides |
Nexus\Mcp\Core\Handler |
The request and notification handler contracts |
Nexus\Mcp\Core\Extension |
The SEP-2133 extensions primitive |
Nexus\Mcp\Core\Auth and Nexus\Mcp\Core\Http |
OAuth metadata documents and the HTTP vocabulary shared with the transports |
Nexus\Mcp\Core\UriTemplate and Nexus\Mcp\Core\Validation |
RFC 6570 templates and the runtime guards |
Nexus\Mcp\Core\Exception |
The McpExceptionInterface family |
Documentation
- Guides, starting with Architecture and Spec compliance.
- API reference.
- Changelog and versioning policy, shared by every component.
License
Released under the MIT License.