PHP Model Context Protocol Server SDK
@james2037
About PHP Model Context Protocol Server SDK
A PHP Server Framework for Model Context Protocol (MCP)
Config
No standard config provided
This server doesn't expose a parseable MCP config block in its README. See the repository for install instructions.
RepositoryTools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is PHP Model Context Protocol Server SDK?
This project provides a PHP implementation of the Model Context Protocol (MCP), enabling you to build servers that can provide context (data and tools) to Large Language Models (LLMs). It is designed for PHP developers who want to expose custom functionalities and data to LLMs using the standardized MCP protocol.
How to use PHP Model Context Protocol Server SDK?
Install the SDK via Composer with composer require james2037/mcp-php-server. Requires PHP 8.1 or higher. Define tools and resources using PHP attributes, then instantiate a Server, add capabilities (ToolsCapability, ResourcesCapability), connect a transport (StdioTransport or HttpTransport), and call $server->run(). Example scripts are provided in the examples/ directory.
Key features of PHP Model Context Protocol Server SDK
- Create MCP-compliant servers with ease
- Expose Tools and Resources to LLMs
- Supports Stdio and HTTP transports
- JSON-RPC message handling built in
- Attribute-based configuration for tools and resources
Use cases of PHP Model Context Protocol Server SDK
- Provide LLMs with custom executable tools (e.g., an echo tool)
- Serve data and content to LLMs via resources (e.g., a static greeting)
- Build local MCP servers running via STDIO
- Deploy web‑accessible MCP servers behind Apache/Nginx with PHP-FPM/mod_php
FAQ from PHP Model Context Protocol Server SDK
What are the prerequisites for using this SDK?
PHP 8.1 or higher and Composer for dependency management are required.
What transports are supported?
The SDK provides StdioTransport for command-line based servers and HttpTransport for HTTP-based servers (compatible with standard PHP web server environments like Apache/Nginx with PHP-FPM/mod_php).
How do I run an HTTP server?
For development, start PHP’s built-in server: php -S localhost:8000 examples/http_server.php. For production, configure your web server (e.g., Nginx or Apache) to route requests to the http_server.php script.
How do I test an HTTP server?
Send JSON-RPC requests via curl, for example: curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"echo","arguments":{"message":"Hello"}},"id":1}' http://localhost:8000/.
How are tools and resources configured?
Use PHP attributes such as #[Tool], #[Parameter], and #[ResourceUri] on classes that extend the base Tool or Resource classes.
Frequently asked questions
What are the prerequisites for using this SDK?
PHP 8.1 or higher and Composer for dependency management are required.
What transports are supported?
The SDK provides StdioTransport for command-line based servers and HttpTransport for HTTP-based servers (compatible with standard PHP web server environments like Apache/Nginx with PHP-FPM/mod_php).
How do I run an HTTP server?
For development, start PHP’s built-in server: `php -S localhost:8000 examples/http_server.php`. For production, configure your web server (e.g., Nginx or Apache) to route requests to the `http_server.php` script.
How do I test an HTTP server?
Send JSON-RPC requests via curl, for example: `curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"echo","arguments":{"message":"Hello"}},"id":1}' http://localhost:8000/`.
How are tools and resources configured?
Use PHP attributes such as `#[Tool]`, `#[Parameter]`, and `#[ResourceUri]` on classes that extend the base Tool or Resource classes.
Basic information
More Developer Tools MCP servers

Foremerge
naw103Catch intent conflicts before code conflicts. The open-source coordination protocol for coding agents, built above Git.

SSH MCP Server
hypnosisSSH MCP server for AI agents: remote commands, file transfer, log search and server audits through OpenSSH.
AptiBuild AI — Career Intelligence
ParklandBuildsAptiBuild AI — Career Intelligence MCP Server Structured career decision scaffolding for AI agents. Provides personality-conditioned business idea generation, official BLS OEWS wage data, FRED labor market signals, and

Kaiva Bridge
Kaiva Bridge turns any Postgres database or OpenAPI spec into a secure, hosted MCP server — per-tool access control, every call audited. Dependency Trust gives coding agents the senior-engineer check before adding a dep

Routebase
RoutebaseRoutebase keeps your API's design, docs, contract tests, mocks and monitoring in one living OpenAPI spec so they can't drift apart. Agents work on that same source of truth, under your team's permissions.
Comments