PHP MCP Client
@swisnl
Basic information
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.
More Agent Frameworks MCP clients
GenAIScript
microsoftAutomatable GenAI Scripting
MCP Client Chatbot
cgoinglove🚀 Open source MCP Client: A Multi-provider AI Chatbot Solution
Novu - Connect your AI agents & products to customers
NovuNovu is the open-source communication layer for AI agents. An agent built on Novu connects to MCP servers like Linear, GitHub, and Notion for its tools, then talks with your users on Slack, Microsoft Teams, WhatsApp, Tel
MCPHost 🤖
mark3labsA CLI host application that enables Large Language Models (LLMs) to interact with external tools through the Model Context Protocol (MCP).
Unified MCP Client Library
pietrozullomcp-use is the easiest way to interact with mcp servers with custom agents
Comments