Skip to content

Commit e059541

Browse files
CodeWithKyriangithub-actions[bot]
authored andcommitted
Update CHANGELOG
1 parent 2047d23 commit e059541

File tree

1 file changed

+56
-28
lines changed

1 file changed

+56
-28
lines changed

CHANGELOG.md

Lines changed: 56 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
All notable changes to `php-mcp/server` will be documented in this file.
44

5+
## PHP MCP Server v2.0.1 (HotFix) - 2025-05-11
6+
7+
### What's Changed
8+
9+
* Fix: Ensure react/http is a runtime dependency for HttpServerTransport by @CodeWithKyrian in https://github.com/php-mcp/server/pull/7
10+
11+
**Full Changelog**: https://github.com/php-mcp/server/compare/2.0.0...2.0.1
12+
513
## PHP MCP Server v2.0.0 - 2025-05-11
614

715
This release marks a significant architectural refactoring of the package, aimed at improving modularity, testability, flexibility, and aligning its structure more closely with the `php-mcp/client` library. The core functionality remains, but the way servers are configured, run, and integrated has fundamentally changed.
@@ -11,27 +19,32 @@ This release marks a significant architectural refactoring of the package, aimed
1119
#### Core Architecture Overhaul
1220

1321
* **Decoupled Design:** The server core logic is now separated from the transport (network/IO) layer.
14-
* **`ServerBuilder`:** A new fluent builder (`Server::make()`) is the primary way to configure server identity, dependencies (Logger, Cache, Container, Loop), capabilities, and manually registered elements.
15-
* **`Server` Object:** The main `Server` class, created by the builder, now holds the configured core components (`Registry`, `Processor`, `ClientStateManager`, `Configuration`) but is transport-agnostic itself.
16-
* **`ServerTransportInterface`:** A new event-driven interface defines the contract for server-side transports (Stdio, Http). Transports are now responsible solely for listening and raw data transfer, emitting events for lifecycle and messages.
17-
* **`Protocol`:** A new internal class acts as a bridge, listening to events from a bound `ServerTransportInterface` and coordinating interactions with the `Processor` and `ClientStateManager`.
18-
22+
23+
* **`ServerBuilder`:** A new fluent builder (`Server::make()`) is the primary way to configure server identity, dependencies (Logger, Cache, Container, Loop), capabilities, and manually registered elements.
24+
* **`Server` Object:** The main `Server` class, created by the builder, now holds the configured core components (`Registry`, `Processor`, `ClientStateManager`, `Configuration`) but is transport-agnostic itself.
25+
* **`ServerTransportInterface`:** A new event-driven interface defines the contract for server-side transports (Stdio, Http). Transports are now responsible solely for listening and raw data transfer, emitting events for lifecycle and messages.
26+
* **`Protocol`:** A new internal class acts as a bridge, listening to events from a bound `ServerTransportInterface` and coordinating interactions with the `Processor` and `ClientStateManager`.
27+
1928
* **Explicit Server Execution:**
20-
* The old `$server->run(?string)` method is **removed**.
21-
* **`$server->listen(ServerTransportInterface $transport)`:** Introduced as the primary way to start a *standalone* server. It binds the `Protocol` to the provided transport, starts the listener, and runs the event loop (making it a blocking call).
22-
29+
30+
* The old `$server->run(?string)` method is **removed**.
31+
* **`$server->listen(ServerTransportInterface $transport)`:** Introduced as the primary way to start a *standalone* server. It binds the `Protocol` to the provided transport, starts the listener, and runs the event loop (making it a blocking call).
32+
2333

2434
#### Discovery and Caching Refinements
2535

2636
* **Explicit Discovery:** Attribute discovery is no longer triggered automatically during `build()`. You must now explicitly call `$server->discover(basePath: ..., scanDirs: ...)` *after* building the server instance if you want to find elements via attributes.
37+
2738
* **Caching Behavior:**
28-
* Only *discovered* elements are eligible for caching. Manually registered elements (via `ServerBuilder->with*` methods) are **never cached**.
29-
* The `Registry` attempts to load discovered elements from cache upon instantiation (during `ServerBuilder::build()`).
30-
* Calling `$server->discover()` will first clear any previously discovered/cached elements from the registry before scanning. It then saves the *newly discovered* results to the cache if enabled (`saveToCache: true`).
31-
* `Registry` cache methods renamed for clarity: `saveDiscoveredElementsToCache()` and `clearDiscoveredElements()`.
32-
* `Registry::isLoaded()` renamed to `discoveryRanOrCached()` for better clarity.
33-
39+
40+
* Only *discovered* elements are eligible for caching. Manually registered elements (via `ServerBuilder->with*` methods) are **never cached**.
41+
* The `Registry` attempts to load discovered elements from cache upon instantiation (during `ServerBuilder::build()`).
42+
* Calling `$server->discover()` will first clear any previously discovered/cached elements from the registry before scanning. It then saves the *newly discovered* results to the cache if enabled (`saveToCache: true`).
43+
* `Registry` cache methods renamed for clarity: `saveDiscoveredElementsToCache()` and `clearDiscoveredElements()`.
44+
* `Registry::isLoaded()` renamed to `discoveryRanOrCached()` for better clarity.
45+
3446
* **Manual vs. Discovered Precedence:** If an element is registered both manually and found via discovery/cache with the same identifier (name/URI), the **manually registered version always takes precedence**.
47+
3548

3649
#### Dependency Injection and Configuration
3750

@@ -50,12 +63,16 @@ This release marks a significant architectural refactoring of the package, aimed
5063
#### Transports
5164

5265
* **New Implementations:** Introduced `PhpMcp\Server\Transports\StdioServerTransport` and `PhpMcp\Server\Transports\HttpServerTransport`, both implementing `ServerTransportInterface`.
53-
* `StdioServerTransport` constructor now accepts custom input/output stream resources, improving testability and flexibility (defaults to `STDIN`/`STDOUT`).
54-
* `HttpServerTransport` constructor now accepts an array of request interceptor callables for custom request pre-processing (e.g., authentication), and also takes `host`, `port`, `mcpPathPrefix`, and `sslContext` for server configuration.
55-
66+
67+
* `StdioServerTransport` constructor now accepts custom input/output stream resources, improving testability and flexibility (defaults to `STDIN`/`STDOUT`).
68+
* `HttpServerTransport` constructor now accepts an array of request interceptor callables for custom request pre-processing (e.g., authentication), and also takes `host`, `port`, `mcpPathPrefix`, and `sslContext` for server configuration.
69+
5670
* **Windows `stdio` Limitation:** `StdioServerTransport` now throws a `TransportException` if instantiated with default `STDIN`/`STDOUT` on Windows, due to PHP's limitations with non-blocking pipes, guiding users to `WSL` or `HttpServerTransport`.
71+
5772
* **Aware Interfaces:** Transports can implement `LoggerAwareInterface` and `LoopAwareInterface` to receive the configured Logger and Loop instances when `$server->listen()` is called.
73+
5874
* **Removed:** The old `StdioTransportHandler`, `HttpTransportHandler`, and `ReactPhpHttpTransportHandler` classes.
75+
5976

6077
#### Capabilities Configuration
6178

@@ -90,28 +107,39 @@ This release marks a significant architectural refactoring of the package, aimed
90107
This is a major refactoring with significant breaking changes:
91108

92109
1. **`Server->run()` Method Removed:** Replace calls to `$server->run('stdio')` with:
110+
93111
```php
94112
$transport = new StdioServerTransport();
95-
// Optionally call $server->discover(...) first
96-
$server->listen($transport);
97-
113+
// Optionally call $server->discover(...) first
114+
$server->listen($transport);
115+
116+
98117
```
99-
The `http` and `reactphp` options for `run()` were already invalid and are fully removed.
118+
The `http` and `reactphp` options for `run()` were already invalid and are fully removed.
119+
100120
2. **Configuration (`ConfigurationRepositoryInterface` Removed):** Configuration is now handled via the `Configuration` VO assembled by `ServerBuilder`. Remove any usage of the old `ConfigurationRepositoryInterface`. Core settings like server name/version are set via `withServerInfo`, capabilities via `withCapabilities`.
121+
101122
3. **Dependency Injection:**
102-
* If using `ServerBuilder->withContainer()` with a custom PSR-11 container, that container is now only responsible for resolving *your application's handler classes* and their dependencies.
103-
* Core server dependencies (Logger, Cache, Loop) **must** be provided explicitly to the `ServerBuilder` using `withLogger()`, `withCache()`, `withLoop()` or rely on the builder's defaults.
104-
123+
124+
* If using `ServerBuilder->withContainer()` with a custom PSR-11 container, that container is now only responsible for resolving *your application's handler classes* and their dependencies.
125+
* Core server dependencies (Logger, Cache, Loop) **must** be provided explicitly to the `ServerBuilder` using `withLogger()`, `withCache()`, `withLoop()` or rely on the builder's defaults.
126+
105127
4. **Transport Handlers Replaced:**
106-
* `StdioTransportHandler`, `HttpTransportHandler`, `ReactPhpHttpTransportHandler` are **removed**.
107-
* Use `new StdioServerTransport()` or `new HttpServerTransport(...)` and pass them to `$server->listen()`.
108-
* Constructor signatures and interaction patterns have changed.
109-
128+
129+
* `StdioTransportHandler`, `HttpTransportHandler`, `ReactPhpHttpTransportHandler` are **removed**.
130+
* Use `new StdioServerTransport()` or `new HttpServerTransport(...)` and pass them to `$server->listen()`.
131+
* Constructor signatures and interaction patterns have changed.
132+
110133
5. **`Registry` Cache Methods Renamed:** `saveElementsToCache` is now `saveDiscoveredElementsToCache`, and `clearCache` is now `clearDiscoveredElements`. Their behavior is also changed to only affect discovered elements.
134+
111135
6. **Core Component Constructors:** The constructors for `Registry`, `Processor`, `ClientStateManager` (previously `TransportState`), `Discoverer`, `DocBlockParser` have changed. Update any direct instantiations (though typically these are managed internally).
136+
112137
7. **Exception Renaming:** `McpException` is now `McpServerException`. Update `catch` blocks accordingly.
138+
113139
8. **Default Null Logger:** Logging is effectively disabled by default. Provide a logger via `ServerBuilder->withLogger()` to enable it.
140+
114141
9. **Schema Generation:** Automatic string `format` inference (e.g., "date-time") removed from `SchemaGenerator`. String parameters are now plain strings in the schema unless a more advanced format definition mechanism is used in the future.
142+
115143

116144
### Deprecations
117145

0 commit comments

Comments
 (0)