Content
# 🐉 The fast, PHP way to build MCP servers
The Model Context Protocol (MCP) is a new, standardized way to provide context and tools to your LLMs, and `pronskiy/mcp` makes building MCP servers simple and intuitive.
Create tools, expose resources, define prompts, and connect components with clean PHP code.
## Installation
With composer:
```bash
composer require pronskiy/mcp
```
## Usage
```php
require 'vendor/autoload.php';
$server = new \Pronskiy\Mcp\Server('simple-mcp-server');
$server
->tool(
'add-numbers',
'Adds two numbers together',
fn(float $num1, float $num2) => "The sum of {$num1} and {$num2} is " . ($num1 + $num2)
)
->tool(
'multiply-numbers',
'Multiplies two numbers',
fn(float $num1, float $num2) => "The product of {$num1} and {$num2} is " . ($num1 * $num2)
)
;
$server->run();
```
## Credits
- https://github.com/logiscape/mcp-sdk-php
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
Connection Info
You Might Also Like
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
servers
Model Context Protocol Servers
time
A Model Context Protocol server for time and timezone conversions.
filesystem
Node.js MCP Server for filesystem operations with dynamic access control.
sequentialthinking
A structured MCP server for dynamic problem-solving and reflective thinking.
git
A Model Context Protocol server for Git automation and interaction.