nexusphp / mcp-client
PHP SDK for the MCP specification - client 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
- amphp/http-client: ^5.0
- amphp/process: ^2.0
- amphp/sync: ^2.3
- nexusphp/assert: ^1.5
- nexusphp/clock: ^1.0
- nexusphp/mcp-core: v1.0.0
- psr/log: ^3.0
- revolt/event-loop: ^1.0.8
Requires (Dev)
None
Suggests
- ext-sodium: Required with EncryptedFileTokenStore.
Provides
None
Conflicts
None
Replaces
None
README
The client half of the Nexus MCP SDK: a ClientBuilder, a
Client with one typed method per MCP capability, transports for spawned stdio servers and
Streamable HTTP endpoints, and the OAuth authorization flow with pluggable token stores.
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-client
This pulls in nexusphp/mcp-core. The umbrella nexusphp/mcp ships the server and the official
extensions alongside it.
What is inside
| Namespace | Contents |
|---|---|
Nexus\Mcp\Client |
ClientBuilder, Client, and ClientContext |
Nexus\Mcp\Client\Transport |
StdioClientTransport, StreamableHttpClientTransport, and SupervisedTransport |
Nexus\Mcp\Client\Auth |
The authorization coordinator, grant strategies, PKCE, and the token and registration stores |
Nexus\Mcp\Client\Dispatch and Nexus\Mcp\Client\Handler |
Request deadlines, progress, and the notification handler registry |
Nexus\Mcp\Client\Subscription |
The subscriptions/listen consumer |
Nexus\Mcp\Client\Extension and Nexus\Mcp\Client\Time |
The outbound extension gate and the cancellable delay |
Documentation
- Getting started and the Client API overview.
- Transports and the client authorization guide.
- API reference.
- Changelog and versioning policy, shared by every component.
License
Released under the MIT License.