nexusphp / mcp-server
PHP SDK for the MCP specification - server component.
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
- nexusphp/clock: ^1.0
- nexusphp/mcp-core: v1.0.0
- opis/json-schema: ^2.6
- phpstan/phpdoc-parser: ^2.3
- psr/http-factory: ^1.1
- psr/http-message: ^2.0
- psr/http-server-handler: ^1.0
- psr/http-server-middleware: ^1.0
- psr/log: ^3.0
- revolt/event-loop: ^1.0.8
Requires (Dev)
None
Suggests
- firebase/php-jwt: Required with JwksAccessTokenValidator (^7.0).
Provides
None
Conflicts
None
Replaces
None
README
The server half of the Nexus MCP SDK: a fluent ServerBuilder
for registering tools, prompts, resources, and completions, a Server that runs them over stdio or
Streamable HTTP, and the resource-server side of OAuth.
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-server
This pulls in nexusphp/mcp-core. The umbrella nexusphp/mcp ships the client and the official
extensions alongside it.
What is inside
| Namespace | Contents |
|---|---|
Nexus\Mcp\Server |
ServerBuilder, Server, ServerContext, and the cursor paginator |
Nexus\Mcp\Server\Tool, Prompt, Resource, Completion |
The per-feature stores and the consumer-facing executor and reader interfaces |
Nexus\Mcp\Server\Attribute and Nexus\Mcp\Server\Discovery |
#[AsTool] and friends, and the scanner that turns them into definitions |
Nexus\Mcp\Server\Handler and Nexus\Mcp\Server\Dispatch |
The built-in request and notification handlers and the dispatch kernel |
Nexus\Mcp\Server\Transport |
StdioServerTransport and the PSR-15 StreamableHttpServerTransport |
Nexus\Mcp\Server\Auth |
Bearer authentication middleware, token validators, and the protected-resource metadata endpoint |
Nexus\Mcp\Server\Subscription |
The subscriptions/listen stream store |
Nexus\Mcp\Server\Extension and Nexus\Mcp\Server\Validation |
The server-side extension gate and the JSON Schema validator |
Documentation
- Getting started and the Server API overview.
- Transports and the resource server guide.
- API reference.
- Changelog and versioning policy, shared by every component.
License
Released under the MIT License.