About
The PHP MCP Client library enables PHP applications to establish stateful connections with Model Context Protocol (MCP) servers over stdio or HTTP+SSE transports. It offers both synchronous and asynchronous APIs for discovering tools, resources, prompts, and executing requests.
Capabilities
PHP MCP Client
The PHP MCP Client bridges PHP applications with servers that implement the Model Context Protocol (MCP), enabling developers to harness external data sources, APIs, and tools directly within their PHP code. By abstracting the intricacies of MCP communication—handshakes, transport negotiation, and request orchestration—the library allows developers to focus on business logic rather than protocol plumbing.
At its core, the client follows MCP’s client‑per‑server model: a single instance maintains a stateful connection to one configured MCP server. This design aligns with the protocol’s specification, ensuring that each PHP host can reliably manage a dedicated session without interference. The connection lifecycle is explicit: (or its async counterpart) performs the handshake, while cleanly tears down the session. This clarity simplifies error handling and resource cleanup in production environments.
The library offers a dual API surface. For straightforward integrations, the synchronous façade exposes blocking methods such as and , making it trivial to query available capabilities or invoke a tool. For high‑performance or concurrent workloads, the Promise‑based asynchronous API (e.g., , ) leverages ReactPHP to provide non‑blocking I/O, enabling developers to orchestrate multiple MCP requests in parallel without blocking the event loop.
Transport flexibility is another standout feature. Whether the server runs as a local process (communicating via ) or is exposed over HTTP with Server‑Sent Events, the client handles both seamlessly. This versatility means the same PHP code can interact with a local CLI tool, a cloud‑hosted API wrapper, or any MCP‑compliant service regardless of deployment topology.
Beyond basic tool invocation, the client supports full resource and prompt interactions. Developers can list resources (), read data (), retrieve prompts (), and even manage dynamic sampling configurations. Coupled with PSR‑compliant integrations— for logging, for optional caching of server definitions, and for event‑driven handling of Server‑Sent Events—the library fits naturally into modern PHP ecosystems.
In practice, the PHP MCP Client shines in scenarios where PHP applications need to delegate complex or stateful operations to external systems. For example, a Laravel application can call an MCP server that interfaces with a codebase or database, enabling AI assistants to fetch code snippets or query data without exposing sensitive infrastructure. Similarly, a Symfony service can offload natural‑language‑driven web browsing to an MCP server that wraps a browser automation tool. By providing a robust, standards‑compliant bridge between PHP and MCP servers, the library empowers developers to integrate AI capabilities into their workflows with minimal friction.
Related Servers
MarkItDown MCP Server
Convert documents to Markdown for LLMs quickly and accurately
Context7 MCP
Real‑time, version‑specific code docs for LLMs
Playwright MCP
Browser automation via structured accessibility trees
BlenderMCP
Claude AI meets Blender for instant 3D creation
Pydantic AI
Build GenAI agents with Pydantic validation and observability
Chrome DevTools MCP
AI-powered Chrome automation and debugging
Weekly Views
Server Health
Information
Explore More Servers
Outlook Calendar MCP Server
Integrate Outlook calendar with Claude on Windows
Slack Search MCP Server
Local AI-powered Slack search without cloud upload
MCP Email Server
Send and search emails with attachments via LLMs
MCP Server Weather Test
Test weather data handling in MCP server environment
Protoc‑Gen Go MCP
Generate MCP servers from gRPC/ConnectRPC services in Go
Cleanuri URL Shortener MCP
Quickly shorten URLs via CleanURI API in FastMCP