This repository provides a PHP SDK for the Model Context Protocol, facilitating communication between client and server applications. It offers Symfony integration for console commands and server-sent events, enabling easy
Model Context Protocol SDK for building Client and Server applications in PHP.
See Demo App for a working example.
composer require php-llm/mcp-sdk
Server integration points are tailored for Symfony Console and HttpFoundation (Laravel compatible).
Provides a Symfony Console command to start an MCP server using standard input/output. It utilizes SymfonyConsoleTransport
to handle communication.
Offers a Symfony Controller to establish an MCP server using Server-Sent Events (SSE). It uses StreamTransport
and CachePoolStore
for managing SSE connections and message storage. The controller defines routes for SSE stream initiation and message handling.
Leverages LLM Chain's ToolBox
for tool registration and execution. With the Symfony Bundle, tools can be exposed using the #[AsTool]
attribute, enabling integration with Language Model (LLM) chains.
php-llm/mcp-sdk
March 7, 2025
March 28, 2025
PHP