You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**`php-mcp/client` is a PHP library for interacting with servers that implement the Model Context Protocol (MCP).**
8
+
** PHP MCP Client is a PHP library for interacting with servers that implement the Model Context Protocol (MCP).**
9
9
10
10
It provides a developer-friendly interface to connect to individual MCP servers using different transports (`stdio`, `http+sse`), manage the connection lifecycle, discover server capabilities (Tools, Resources, Prompts), and execute requests like calling tools or reading resources.
11
11
12
12
While utilizing asynchronous I/O internally via ReactPHP for robustness and handling features like server-sent events, the library offers **both** a straightforward **synchronous (blocking) API** for common use cases and an **asynchronous (Promise-based) API** for advanced control and concurrency.
13
13
14
-
This library aligns with the MCP specification's model where one client instance manages a stateful connection to one server, and acts as the counterpart to the [`php-mcp/server`](https://github.com/php-mcp/server) package.
14
+
This library aligns with the MCP specification's model where one client instance manages a stateful connection to one server.
15
15
16
16
## Introduction to MCP
17
17
@@ -30,7 +30,6 @@ This client library allows your PHP application (acting as the "Host" in MCP ter
30
30
*`stdio`: Communicating with server processes via Standard Input/Output.
31
31
*`http`: Communicating with servers via HTTP POST and Server-Sent Events (SSE).
32
32
***Explicit Connection Lifecycle:** Requires `->initialize()` or `->initializeAsync()` to connect and perform the handshake before making requests. Provides `disconnect()` / `disconnectAsync()`.
33
-
***Capability Discovery:** Automatically performs the MCP handshake via `initialize()` to determine server capabilities.
34
33
***Tool/Resource/Prompt Interaction:** Provides comprehensive methods (sync & async) to list available elements and execute requests like `tools/call`, `resources/read`, `prompts/get`.
35
34
***PSR Compliance:** Integrates with standard PHP interfaces:
36
35
*`PSR-3` (LoggerInterface): Integrate your application's logger.
@@ -43,7 +42,6 @@ This client library allows your PHP application (acting as the "Host" in MCP ter
43
42
44
43
* PHP >= 8.1
45
44
* Composer
46
-
*`react/event-loop` (and other ReactPHP components installed as dependencies)
47
45
**(For Stdio Transport)*: Ability to execute the server command.
48
46
**(For Http Transport)*: Network access to the MCP server URL.
0 commit comments