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
Copy file name to clipboardExpand all lines: CHANGELOG.md
+83-53Lines changed: 83 additions & 53 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,24 @@
2
2
3
3
All notable changes to `php-mcp/client` will be documented in this file.
4
4
5
+
## v1.0.1 - 2025-05-06
6
+
7
+
This patch release introduces an API improvement to the `ClientBuilder` for a more streamlined configuration experience.
8
+
9
+
### ✨ Enhancements
10
+
11
+
***Simplified Client Identity Configuration:** The `ClientBuilder` now features a new method `withClientInfo(string $name, string $version)`. This single method replaces the previous separate `withName(string $name)` and `withVersion(string $version)` methods for setting your client application's identity. This makes the builder API slightly more concise.
12
+
13
+
### ⚠️ Deprecations
14
+
15
+
* The methods `ClientBuilder::withName(string $name)` and `ClientBuilder::withVersion(string $version)` are now **deprecated**.
16
+
* Please update your code to use the new `ClientBuilder::withClientInfo(string $name, string $version)` method.
17
+
* The deprecated methods will be removed in a future `v2.0.0` release. They will continue to function as before in the `v1.x.x` series to maintain backward compatibility.
18
+
19
+
### 📝 Documentation
20
+
21
+
* The `README.md` and examples have been updated to reflect the new `withClientInfo()` method and the removal of the `ClientInfo` object from direct user configuration.
22
+
5
23
## v1.0.0 - 2025-05-06
6
24
7
25
### v1.0.0 - Initial Release
@@ -15,81 +33,93 @@ It offers a robust, flexible, and developer-friendly solution designed specifica
15
33
#### ✨ Key Features
16
34
17
35
***Client-per-Server Architecture:** Aligns with the MCP specification's core model where each `Client` instance manages a dedicated, stateful connection to a single configured MCP server.
36
+
18
37
***Fluent Configuration Builder:** Set up client instances easily using the `Client::make()->with...()->build()` pattern, configuring client identity, capabilities, and the specific server connection details (`ServerConfig`).
38
+
19
39
***Dual API for Flexibility:**
20
-
***Synchronous Facade:** Interact with MCP servers using straightforward, blocking methods (e.g., `$client->initialize()`, `$client->listTools()`, `$client->callTool(...)`) for simple integration into traditional PHP scripts and frameworks. The underlying asynchronous complexity is handled internally.
21
-
***Asynchronous API:** Access Promise-based methods (e.g., `$client->initializeAsync()`, `$client->listToolsAsync()`, `$client->callToolAsync(...)`) for advanced use cases, concurrent operations using `React\Promise\all`, or integration into asynchronous PHP applications (ReactPHP, Amp, Swoole).
22
-
40
+
41
+
***Synchronous Facade:** Interact with MCP servers using straightforward, blocking methods (e.g., `$client->initialize()`, `$client->listTools()`, `$client->callTool(...)`) for simple integration into traditional PHP scripts and frameworks. The underlying asynchronous complexity is handled internally.
42
+
***Asynchronous API:** Access Promise-based methods (e.g., `$client->initializeAsync()`, `$client->listToolsAsync()`, `$client->callToolAsync(...)`) for advanced use cases, concurrent operations using `React\Promise\all`, or integration into asynchronous PHP applications (ReactPHP, Amp, Swoole).
43
+
23
44
***Multiple Transport Support:**
24
-
***`stdio`:** Seamlessly connect to and manage local MCP server processes via standard input/output, ideal for command-line tools or embedded servers. Uses `react/child-process` internally.
25
-
***`http`:** Connect to remote or local MCP servers over HTTP, handling POST requests for client messages and Server-Sent Events (SSE) for server messages and notifications. Uses `react/http` internally.
26
-
45
+
46
+
***`stdio`:** Seamlessly connect to and manage local MCP server processes via standard input/output, ideal for command-line tools or embedded servers. Uses `react/child-process` internally.
47
+
***`http`:** Connect to remote or local MCP servers over HTTP, handling POST requests for client messages and Server-Sent Events (SSE) for server messages and notifications. Uses `react/http` internally.
48
+
27
49
***Explicit Connection Lifecycle:** Clear methods (`initialize`/`initializeAsync`, `disconnect`/`disconnectAsync`) to manage the stateful connection and MCP handshake process.
***Robust Error Handling:** Provides a hierarchy of specific exceptions (`ConfigurationException`, `ConnectionException`, `HandshakeException`, `RequestException`, `TimeoutException`, `TransportException`, `UnsupportedCapabilityException`, etc.) for predictable error management.
69
+
44
70
***Asynchronous Core:** Built on ReactPHP's event loop and promises for efficient, non-blocking I/O handling crucial for `stdio` and `http+sse` transports.
71
+
45
72
46
73
#### 🚀 Getting Started
47
74
48
75
1.**Install:**
49
-
76
+
50
77
```bash
51
78
composer require php-mcp/client
52
-
79
+
80
+
53
81
```
54
82
2. **Configure:** Define your server connection using `ServerConfig` and build a client instance.
0 commit comments