{"full_name":"modelcontextprotocol/php-sdk","owner":"modelcontextprotocol","name":"php-sdk","shard":"1","url":"https://github.com/modelcontextprotocol/php-sdk","description":"The official PHP SDK for Model Context Protocol servers and clients. Maintained in collaboration with The PHP Foundation.","homepage":"https://php.sdk.modelcontextprotocol.io","topics":["php","mcp","mcp-server","mcp-client"],"tag_pages":["mcp","mcp-client","mcp-server","php"],"language":"PHP","license":"NOASSERTION","avatar":"https://avatars.githubusercontent.com/u/182288589?v=4","created_at":"2025-07-15T22:39:44Z","pushed_at":"2026-11-13T07:12:44Z","metrics":{"stars":1674,"forks":204,"watchers":24,"issues":202,"prs":536,"releases":14,"issues_open":22,"issues_closed":180,"prs_open":14,"prs_closed":57,"prs_merged":465,"discussions":0},"growth":{"day":{"stars":2,"forks":0,"base_day":"2026-11-15"}},"history":{"dates":["2026-11-10","2026-11-11","2026-11-12","2026-11-13","2026-11-14","2026-11-15","2026-11-16"],"stars":[1667,1670,1671,1671,1672,1672,1674],"forks":[201,203,203,202,203,204,204],"watchers":[null,24,24,24,24,24,24],"issues_open":[null,22,22,22,22,22,22],"prs_open":[null,11,13,13,14,15,14]},"boards":{},"same_owner":[{"full_name":"modelcontextprotocol/servers","name":"servers","shard":"1","boards":{"total":176}},{"full_name":"modelcontextprotocol/go-sdk","name":"go-sdk","shard":"1","boards":{}},{"full_name":"modelcontextprotocol/modelcontextprotocol","name":"modelcontextprotocol","shard":"1","boards":{}}],"issues":[{"number":489,"title":"Slicing the SDK into Multiple Packages","comments":4,"created_at":"2026-08-29T21:15:19Z"},{"number":468,"title":"[Server] Handler type uses bare Closure, hard to decorate RegistryInterface under strict PHPStan","comments":3,"created_at":"2026-08-20T14:25:42Z"},{"number":733,"title":"[Server] Decode an HTTP request body once instead of per pipeline stage","comments":2,"created_at":"2026-11-10T22:49:24Z"},{"number":631,"title":"[Capability] Describe nullable parameters with `anyOf` instead of a `type` array?","comments":2,"created_at":"2026-10-27T16:23:25Z"},{"number":309,"title":"Streamable HTTP server does not validate body/header protocol-version consistency on initialize","comments":2,"created_at":"2026-05-16T09:50:39Z"},{"number":286,"title":"Add server lifecycle events (ServerStarted / ServerStopped)","comments":2,"created_at":"2026-04-16T04:58:19Z"},{"number":13,"title":"[Schema] Generate Schema based on official JSON Schema","comments":2,"created_at":"2025-08-29T11:21:50Z"},{"number":495,"title":"[Server][Capability] Element sources should return values, and RegistryInterface should be sliced by role","comments":1,"created_at":"2026-09-03T07:20:12Z"}],"discussions":[],"latest_release":{"name":"v0.10.0","tag":"v0.10.0","published_at":"2026-11-10T17:17:19Z","body":"## What's Changed\r\n\r\n### TL;DR\r\n\r\n* The SDK is split into the `Mcp\\Schema`, `Mcp\\Client` and `Mcp\\Server` namespaces, ahead of separate packages: most imports change\r\n* PHP 8.2 or higher is required, and JSON-RPC batches are gone\r\n* The client authorizes with OAuth: authorization code, client credentials, `private_key_jwt` and experimental cross-app access\r\n* Handshake-era servers over HTTP run without sessions unless `Builder::setSession()` is called, and sessions belong to the principal that opened them\r\n* Request handlers can run under an event loop (Revolt, ReactPHP) with the opt-in `Builder::setFiberScheduler()`, and stream their responses\r\n* Tool arguments keep their JSON types, and arguments that don't fit are answered with `-32602`\r\n* stdio works on Windows, in the server and the client\r\n\r\n### Namespaces\r\n\r\n* [BC Break] Split the root namespace into `Mcp\\Schema`, `Mcp\\Client` and `Mcp\\Server` to prepare slicing them into separate packages; update your imports. `Mcp\\Schema` depends on nothing, `Mcp\\Client` and `Mcp\\Server` depend on `Mcp\\Schema` only — enforced by Deptrac (`make deptrac`).\r\n  * `Mcp\\Server` => `Mcp\\Server\\Server`\r\n  * `Mcp\\Client` => `Mcp\\Client\\Client`\r\n  * `Mcp\\Capability\\*` => `Mcp\\Server\\Capability\\*` (`Attribute`, `Completion`, `Discovery`, `Formatter`, `Logger`, `Registry`, `Tool`, plus `Registry` and `RegistryInterface`)\r\n  * `Mcp\\Event\\*` => `Mcp\\Server\\Event\\*`\r\n  * `Mcp\\JsonRpc\\MessageFactory` => `Mcp\\Schema\\MessageFactory`\r\n  * `Mcp\\Server\\Stateless\\RequestMeta` => `Mcp\\Schema\\RequestMeta`\r\n* [BC Break] Distribute `Mcp\\Exception\\*` across the three namespaces.\r\n  * `Mcp\\Exception\\{ExceptionInterface,InvalidArgumentException,LogicException,RuntimeException}` => the same names under `Mcp\\Schema\\Exception\\`, `Mcp\\Client\\Exception\\` and `Mcp\\Server\\Exception\\` — pick the one matching the package you catch around\r\n  * `Mcp\\Exception\\Exception` => `Mcp\\Client\\Exception\\Exception` and `Mcp\\Server\\Exception\\Exception`\r\n  * `Mcp\\Exception\\{InvalidInputMessageException,MissingRequestMetaException}` => `Mcp\\Schema\\Exception\\*`\r\n  * `Mcp\\Exception\\{ConnectionException,ElicitationException,RequestCancelledException,RequestException,RootsException,SamplingException,TimeoutException}` => `Mcp\\Client\\Exception\\*`\r\n  * `Mcp\\Exception\\{BadMethodCallException,ClientException,ConfigurationException,ContainerException,InvalidCursorException,MissingRequiredClientCapabilityException,NotFoundExceptionInterface,PromptGetException,PromptNotFoundException,RegistryException,RequestStateException,ResourceNotFoundException,ResourceReadException,ServiceNotFoundException,SessionLockException,SessionLockTimeoutException,SessionStoreException,ToolCallException,ToolNotFoundException}` => `Mcp\\Server\\Exception\\*`\r\n  * `Mcp\\Exception\\HandlerNotFoundException` is removed; it was unused.\r\n  * `Mcp\\Server\\Exception\\ExceptionInterface` and `Mcp\\Client\\Exception\\ExceptionInterface` extend `Mcp\\Schema\\Exception\\ExceptionInterface`, so catching the latter still catches any SDK exception.\r\n  * The named exceptions extend their package's `RuntimeException`/`InvalidArgumentException` instead of the global ones, so `catch (Mcp\\Server\\Exception\\RuntimeException)` reaches `ToolCallException`, `PromptGetException` and friends.\r\n* [BC Break] Move `ExtensionInterface::getRequestHandlers()` to the new `Mcp\\Server\\Extension\\ServerExtensionInterface`, so `Mcp\\Schema` does not reference `Mcp\\Server`. `AbstractExtension` no longer defines it. An extension that serves its methods must implement the new interface, or `Builder::enableExtension()` does not register its handlers.\r\n\r\n### General\r\n\r\n* [BC Break] Require PHP 8.2 or higher, as PHP 8.1 reached its end of life.\r\n* [BC Break] Remove JSON-RPC batch support, as MCP dropped batching in `2025-06-18`. The server refuses a JSON array with `-32600`, and HTTP status `400`, on every revision, including `2025-03-26`, which requires batches and which the server still negotiates. The client drops one with ","is_prerelease":false},"readme":true,"readme_zh":false,"news":[],"stale":false,"snapshot_at":"2026-11-16T09:23:14Z","history_start":"2026-09-06"}