PHP SDK for Model Context Protocol, enabling context provision for LLMs
Top 81.3% on sourcepulse
This PHP SDK implements the Model Context Protocol (MCP) for integrating Large Language Models (LLMs) by standardizing context provision. It targets developers building AI integration solutions, enabling them to create MCP clients and servers using transports like stdio and HTTP, thereby separating context management from LLM interaction.
How It Works
The SDK provides a PHP implementation of the MCP specification, mirroring the design of the official Python SDK. It facilitates building MCP clients to connect to any MCP server and creating MCP servers to expose resources, prompts, and tools. The implementation handles MCP protocol messages and lifecycle events, supporting standard transports like stdio and HTTP for communication.
Quick Start & Requirements
composer require logiscape/mcp-sdk-php
ext-curl
, ext-json
, ext-pcntl
(optional, recommended for CLI). monolog/monolog
is optional for logging in examples.Highlighted Details
Maintenance & Community
Licensing & Compatibility
Limitations & Caveats
Some functionality may be incomplete, and implementations require thorough testing and security review before production use. The web client's connection strategy (re-establishing connections per request) is a workaround for typical PHP hosting limitations and may not be suitable for all use cases. An authorization framework based on OAuth 2.1 is planned but not yet implemented.
1 week ago
Inactive