11# MCP PHP SDK
22
3- The official PHP SDK for Model Context Protocol (MCP). It provides a framework-agnostic API for implementing MCP servers in PHP.
3+ The official PHP SDK for Model Context Protocol (MCP). It provides a framework-agnostic API for implementing MCP servers
4+ and clients in PHP.
45
56> [ !IMPORTANT]
6- > Currently, we are still in the process of merging [ Symfony's MCP SDK] ( https://github.com/symfony/mcp-sdk ) and
7- > [ PHP-MCP] ( https://github.com/php-mcp ) components. Not all code paths are fully tested or complete, and this package
8- > may still contain duplicate functionality or dead code.
7+ > Currently, the SDK is still in active development and not all components of the MCP specification are implemented.
98>
109> If you want to help us stabilize the SDK, please see the
1110> [ issue tracker] ( https://github.com/modelcontextprotocol/php-sdk/issues ) .
@@ -21,29 +20,17 @@ Until the first major release, this SDK is considered
2120## 🚧 Roadmap
2221
2322Features
24- - [x] Bring back PHP-MCP examples
25- - [x] Glue handler, registry and reference handlers
26- - [x] Revive ` ServerBuilder `
27- - [x] Revive transports
28- - [x] Streamable Transport https://github.com/modelcontextprotocol/php-sdk/issues/7
29- - [ ] ~~ Http/SSE-based Transport https://github.com/modelcontextprotocol/php-sdk/issues/8 ~~
30- - [ ] Support pagination
31- - [ ] Support Schema validation
32- - [ ] Support multiple versions of the MCP specification https://github.com/modelcontextprotocol/php-sdk/issues/14
33- - [ ] (Re-)Implement missing Notification & Request Handlers https://github.com/modelcontextprotocol/php-sdk/issues/9
23+ - [ ] Stabilize server component with all needed handlers and functional tests
24+ - [ ] Extend documentation, including integration pointer for popular frameworks
25+ - [ ] Implement Client component
26+ - [ ] Support multiple schema versions
3427
3528## Installation
3629
3730``` bash
3831composer require mcp/sdk
3932```
4033
41- Since this package has no tagged releases yet, it is required to extend your ` composer.json ` :
42- ``` json
43- "minimum-stability" : " dev" ,
44- "prefer-stable" : true
45- ```
46-
4734## ⚡ Quick Start: Stdio Server with Discovery
4835
4936This example demonstrates the most common usage pattern - a ` stdio ` server using attribute discovery.
@@ -111,16 +98,19 @@ Add to your client configuration (e.g., `mcp.json`):
11198Your AI assistant can now call:
11299- ` add_numbers ` - Add two integers
113100
101+ For more examples, see the [ examples directory] ( examples ) .
102+
114103## Documentation
115104
116- - [ SDK documentation] ( doc /index.rst )
105+ - [ SDK documentation] ( docs /index.md )
117106- [ Model Context Protocol documentation] ( https://modelcontextprotocol.io )
118107- [ Model Context Protocol specification] ( https://spec.modelcontextprotocol.io )
119108- [ Officially supported servers] ( https://github.com/modelcontextprotocol/servers )
120109
121- ## Examples of MCP Tools that use this SDK
110+ ## PHP libraries using the MCP SDK
122111
123- - https://github.com/pronskiy/mcp
112+ * https://github.com/pronskiy/mcp - additional DX layer
113+ * https://github.com/symfony/mcp-bundle - Symfony integration bundle
124114
125115## Contributing
126116
@@ -130,7 +120,9 @@ the project. See the [contributing guide](CONTRIBUTING.md) to get started before
130120[ send pull requests] ( https://github.com/modelcontextprotocol/php-sdk/pulls ) .
131121
132122## Credits
133- The starting point for this SDK was the [ PHP-MCP] ( https://github.com/php-mcp/server ) project, initiated by [ Kyrian Obikwelu] ( https://github.com/CodeWithKyrian ) . We are grateful for the work done by Kyrian and other contributors to that repository, which created a solid foundation for this SDK.
123+ Starting point for this SDK was the [ PHP-MCP] ( https://github.com/php-mcp/server ) project, initiated by
124+ [ Kyrian Obikwelu] ( https://github.com/CodeWithKyrian ) , and the [ Symfony AI initiative] ( https://github.com/symfony/ai ) .
125+ We are grateful for the work done by both projects and their contributors, which created a solid foundation for this SDK.
134126
135127## License
136128
0 commit comments