Installation
The SDK ships as a single Composer package:
composer require mcp/sdk
It requires PHP 8.1+ and the fileinfo extension. Most of what it pulls in is PSR
interface packages (psr/container, psr/log, psr/http-message, …); the rest is
opis/json-schema for schema validation, symfony/uid for session identifiers,
phpdocumentor/reflection-docblock for reading descriptions out of your docblocks,
php-http/discovery for finding PSR-17/PSR-18 implementations, and
symfony/deprecation-contracts for deprecation notices.
That is enough for a complete STDIO server and for the STDIO client.
Optional packages
Which extras you need depends on what you build:
PSR-17 and PSR-18 implementations are found through
php-http/discovery, so
installing the package is all that is needed — no wiring:
composer require nyholm/psr7
If discovery picks the wrong one, or you want to be explicit, pass the factories to the transport yourself; see HTTP transport.
Next
Write your first server.
