The official PHP SDK for Model Context Protocol servers and clients. Maintained in collaboration with The PHP Foundation.
# Add to your Claude Code skills
git clone https://github.com/modelcontextprotocol/php-sdkGuides for using mcp servers skills like php-sdk.
Last scanned: 8/4/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-08-04T06:27:22.326Z",
"npmAuditRan": true,
"pipAuditRan": true,
"promptInjectionRan": true
}See how php-sdk compares with popular alternatives.
php-sdk is an open-source mcp servers skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by modelcontextprotocol. The official PHP SDK for Model Context Protocol servers and clients. Maintained in collaboration with The PHP Foundation. It has 1,612 GitHub stars.
Yes. php-sdk passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/modelcontextprotocol/php-sdk" and add it to your Claude Code skills directory (see the Installation section above).
php-sdk is primarily written in PHP. It is open-source under modelcontextprotocol on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other MCP Servers skills you can browse and compare side by side. Open the MCP Servers category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh php-sdk against similar tools.
No comments yet. Be the first to share your thoughts!
Top skills in this category by stars
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
The official PHP SDK for the Model Context Protocol (MCP). It provides a framework-agnostic API for implementing MCP
servers and clients in PHP — tools, resources, prompts, STDIO and HTTP transports, sessions, authorization, and both
protocol eras (the initialize handshake and the stateless 2026-07-28 revision).
This project represents a collaboration between the PHP Foundation and the Symfony project. It adopts development practices and standards from the Symfony project, including Coding Standards and the Backward Compatibility Promise.
Until the first major release, this SDK is considered experimental, please see the roadmap for planned next steps and features.
Measured weekly against the MCP Conformance Test Framework,
as passing checks out of total. The 2026-07-28 scores run against the framework's alpha releases, so they move as
upstream publishes new scenarios.
| Revision | Server | Client |
|---|---|---|
2026-07-28 |
||
2025-11-25 |
composer require mcp/sdk
A server is a plain PHP class plus three lines of wiring:
use Mcp\Capability\Attribute\McpResource;
use Mcp\Capability\Attribute\McpTool;
use Mcp\Server;
use Mcp\Server\Transport\StdioTransport;
class Calculator
{
/**
* Adds two numbers.
*/
#[McpTool]
public function add(int $a, int $b): int
{
return $a + $b;
}
#[McpResource(uri: 'config://calculator/settings')]
public function settings(): array
{
return ['precision' => 2];
}
}
exit(Server::builder()
->setServerInfo('Calculator', '1.0.0')
->setDiscovery(__DIR__, ['.'], excludeDirs: ['vendor'])
->build()
->run(new StdioTransport()));
The walkthrough in First server explains each piece, and Try it with the Inspector shows it running.
use Mcp\Client;
use Mcp\Client\Transport\StdioTransport;
$client = Client::builder()
->setClientInfo('My Application', '1.0.0')
->build();
$client->connect(new StdioTransport(command: 'php', args: ['/path/to/server.php']));
$tools = $client->listTools();
$result = $client->callTool('add', ['a' => 5, 'b' => 3]);
$client->disconnect();
See Connecting to a server for transports, timeouts, and the handlers that answer server-initiated requests.
The full documentation is published at php.sdk.modelcontextprotocol.io.
2026-07-28 changedBuilding something on top of the SDK? Open a pull request to add it to this list.
We are passionate about supporting contributors of all levels of experience and would love to see you get involved in the project. Start by reporting issues or sending pull requests. See CONTRIBUTING.md for development setup, coding standards, and what to run before opening a PR.
The starting point for this SDK was the PHP-MCP project, initiated by Kyrian Obikwelu, and the Symfony AI initiative. We are grateful for the work done by both projects and their contributors, which created a solid foundation for this SDK.
This project is licensed under the Apache License, Version 2.0 for new contributions, with existing code under the MIT License — see the LICENSE file for details.