pronskiy / mcp
🐉 The fast, PHP way to build MCP servers
dev-main
2025-04-20 22:14 UTC
Requires
- php: ^8.4
- logiscape/mcp-sdk-php: ^v1.1.0
Requires (Dev)
- pestphp/pest: ^3.0
- pestphp/pest-plugin-arch: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
- phpstan/extension-installer: ^1.3||^2.0
- phpstan/phpstan: ^2.1.12
- phpstan/phpstan-deprecation-rules: ^1.1||^2.0
- phpstan/phpstan-phpunit: ^1.3||^2.0
This package is auto-updated.
Last update: 2025-04-20 22:19:39 UTC
README
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:
composer require pronskiy/mcp
Usage
require 'vendor/autoload.php'; $server = new \Pronskiy\Mcp\Server('simple-mcp-server'); $server ->tool('add-numbers', 'Adds two numbers together', function(float $num1, float $num2) { return "The sum of {$num1} and {$num2} is " . ($num1 + $num2); }) ->tool('multiply-numbers', 'Multiplies two numbers', function(float $num1, float $num2) { return "The product of {$num1} and {$num2} is " . ($num1 * $num2); }) ; $server->run();
Credits
License
The MIT License (MIT). Please see License File for more information.