PHP MCP Client
@swisnl
About PHP MCP Client
Model Context Protocol client implementation for PHP
Overview
What is PHP MCP Client?
A PHP client library for interacting with Model Context Protocol (MCP) servers. It runs on any PHP 8.2+ environment and is built on ReactPHP for asynchronous operations.
How to use PHP MCP Client?
Install via Composer (composer require swisnl/mcp-client), then create a client with a transport (SSE, Stdio, Process, or StreamableHttp), connect to the server, and call tools. For example, Client::withSse($endpoint) initiates an SSE connection, and $client->callTool('name', ['param' => 'value']) executes a tool.
Key features of PHP MCP Client
- Multiple transport mechanisms: SSE, Stdio, Process, and StreamableHttp
- Promise-based API with ReactPHP for async operations
- PSR-3 Logger interface support
- Tool annotation support (read‑only hint, title)
- Custom transporter support via
TransporterInterface - Integration with the SWIS Agents SDK
Use cases of PHP MCP Client
- Connect PHP applications to any MCP‑compatible server (e.g., math tools, data retrievers)
- Build AI agents by combining the client with the SWIS Agents SDK
- Call remote or local MCP tools with structured input and output
FAQ from PHP MCP Client
What is the PHP MCP Client?
It’s a PHP library that implements the client side of the Model Context Protocol, allowing PHP applications to interact with MCP servers over multiple transports using async I/O.
What PHP version is required?
PHP 8.2 or higher, along with ReactPHP packages.
Which transports are supported?
Four transports: Server‑Sent Events (SSE), standard I/O (Stdio), external process communication (Process), and HTTP with session management (StreamableHttp).
Is the PHP MCP Client free?
Yes, it’s open‑source under the MIT license. The project is Treeware – if used in production, you are asked to buy a tree.
Can I use a custom transport?
Yes. Implement the TransporterInterface and pass your transporter to the Client constructor.
Basic information
More Agent Frameworks MCP clients
🚀 MCPOmni Connect - Universal Gateway to MCP Servers
Abiorh001MCPOmni Connect is an agent execution runtime that connects to multiple MCP servers via stdio, SSE, or streamable HTTP. It supports chat, autonomous agents, and planner-based orchestration treating each MCP server as a tool agent to enable dynamic multi-agent workflows across LLM
MCP REST API and CLI Client
rakesh-eltropychatmcp
daodao97ChatMCP is an AI chat client implementing the Model Context Protocol (MCP).
Unified MCP Client Library
pietrozullomcp-use is the easiest way to interact with mcp servers with custom agents
Where On-Device and Cloud LLMs Meet
hazyresearchBig & Small LLMs working together
Comments