Skip to content

Commit 1f11b8e

Browse files
CodeWithKyriangithub-actions[bot]
authored andcommitted
Update CHANGELOG
1 parent 2ff0f7d commit 1f11b8e

File tree

1 file changed

+47
-15
lines changed

1 file changed

+47
-15
lines changed

CHANGELOG.md

Lines changed: 47 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,36 @@
22

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

5+
## PHP MCP Server v1.1.0 - 2025-05-01
6+
7+
### Added
8+
9+
* **Manual Element Registration:** Added fluent methods `withTool()`, `withResource()`, `withPrompt()`, and `withResourceTemplate()` to the `Server` class. This allows programmatic registration of MCP elements as an alternative or supplement to attribute discovery. Both `[ClassName::class, 'methodName']` array handlers and invokable class string handlers are supported.
10+
* **Invokable Class Attribute Discovery:** The server's discovery mechanism now supports placing `#[Mcp*]` attributes directly on invokable PHP class definitions (classes with a public `__invoke` method). The `__invoke` method will be used as the handler.
11+
* **Discovery Path Configuration:** Added `withBasePath()`, `withScanDirectories()`, and `withExcludeDirectories()` methods to the `Server` class for finer control over which directories are scanned during attribute discovery.
12+
13+
### Changed
14+
15+
* **Dependency Injection:** Refactored internal dependency management. Core server components (`Processor`, `Registry`, `TransportState`, etc.) now resolve `LoggerInterface`, `CacheInterface`, and `ConfigurationRepositoryInterface` Just-In-Time from the provided PSR-11 container. See **Breaking Changes** for implications.
16+
* **Default Logging Behavior:** Logging is now **disabled by default**. To enable logging, provide a `LoggerInterface` implementation via `withLogger()` (when using the default container) or by registering it within your custom PSR-11 container.
17+
* **Transport Handler Constructors:** Transport Handlers (e.g., `StdioTransportHandler`, `HttpTransportHandler`) now primarily accept the `Server` instance in their constructor, simplifying their instantiation.
18+
19+
### Fixed
20+
21+
* Prevented potential "Constant STDERR not defined" errors in non-CLI environments by changing the default logger behavior (see Changed section).
22+
23+
### Updated
24+
25+
* Extensively updated `README.md` to document manual registration, invokable class discovery, the dependency injection overhaul, discovery path configuration, transport handler changes, and the new default logging behavior.
26+
27+
### Breaking Changes
28+
29+
* **Dependency Injection Responsibility:** Due to the DI refactoring, if you provide a custom PSR-11 container using `withContainer()`, you **MUST** ensure that your container is configured to provide implementations for `LoggerInterface`, `CacheInterface`, and `ConfigurationRepositoryInterface`. The server relies on being able to fetch these from the container.
30+
* **`withLogger/Cache/Config` Behavior with Custom Container:** When a custom container is provided via `withContainer()`, calls to `->withLogger()`, `->withCache()`, or `->withConfig()` on the `Server` instance will **not** override the services resolved from *your* container during runtime. Configuration for these core services must be done directly within your custom container setup.
31+
* **Transport Handler Constructor Signatures:** The constructor signatures for `StdioTransportHandler`, `HttpTransportHandler`, and `ReactPhpHttpTransportHandler` have changed. They now primarily require the `Server` instance. Update any direct instantiations of these handlers accordingly.
32+
33+
**Full Changelog**: https://github.com/php-mcp/server/compare/1.0.0...1.1.0
34+
535
## Release v1.0.0 - Initial Release
636

737
🚀 **Initial release of PHP MCP SERVER!**
@@ -10,28 +40,30 @@ This release introduces the core implementation of the Model Context Protocol (M
1040

1141
### ✨ Key Features:
1242

13-
* **Attribute-Based Definitions:** Easily define MCP Tools (`#[McpTool]`), Resources (`#[McpResource]`, `#[McpResourceTemplate]`), and Prompts (`#[McpPrompt]`) using PHP 8 attributes directly on your methods.
14-
* **Automatic Metadata Inference:** Leverages method signatures (parameters, type hints) and DocBlocks (`@param`, `@return`, summaries) to automatically generate MCP schemas and descriptions, minimizing boilerplate.
15-
* **PSR Compliance:** Integrates seamlessly with standard PHP interfaces:
16-
* `PSR-3` (LoggerInterface) for flexible logging.
17-
* `PSR-11` (ContainerInterface) for dependency injection and class resolution.
18-
* `PSR-16` (SimpleCacheInterface) for caching discovered elements and transport state.
19-
* **Automatic Discovery:** Scans configured directories to find and register your annotated MCP elements.
20-
* **Flexible Configuration:** Uses a configuration repository (`ConfigurationRepositoryInterface`) for fine-grained control over server behaviour, capabilities, and caching.
21-
* **Multiple Transports:**
22-
* Built-in support for the `stdio` transport, ideal for command-line driven clients.
23-
* Includes `HttpTransportHandler` components for building standard `http` (HTTP+SSE) transports (requires integration into an HTTP server).
24-
* Provides `ReactPhpHttpTransportHandler` for seamless integration with asynchronous ReactPHP applications.
25-
* **Protocol Support:** Implements the `2024-11-05` version of the Model Context Protocol.
26-
* **Framework Agnostic:** Designed to work in vanilla PHP projects or integrated into any framework.
43+
* **Attribute-Based Definitions:** Easily define MCP Tools (`#[McpTool]`), Resources (`#[McpResource]`, `#[McpResourceTemplate]`), and Prompts (`#[McpPrompt]`) using PHP 8 attributes directly on your methods.
44+
* **Automatic Metadata Inference:** Leverages method signatures (parameters, type hints) and DocBlocks (`@param`, `@return`, summaries) to automatically generate MCP schemas and descriptions, minimizing boilerplate.
45+
* **PSR Compliance:** Integrates seamlessly with standard PHP interfaces:
46+
* `PSR-3` (LoggerInterface) for flexible logging.
47+
* `PSR-11` (ContainerInterface) for dependency injection and class resolution.
48+
* `PSR-16` (SimpleCacheInterface) for caching discovered elements and transport state.
49+
50+
* **Automatic Discovery:** Scans configured directories to find and register your annotated MCP elements.
51+
* **Flexible Configuration:** Uses a configuration repository (`ConfigurationRepositoryInterface`) for fine-grained control over server behaviour, capabilities, and caching.
52+
* **Multiple Transports:**
53+
* Built-in support for the `stdio` transport, ideal for command-line driven clients.
54+
* Includes `HttpTransportHandler` components for building standard `http` (HTTP+SSE) transports (requires integration into an HTTP server).
55+
* Provides `ReactPhpHttpTransportHandler` for seamless integration with asynchronous ReactPHP applications.
56+
57+
* **Protocol Support:** Implements the `2024-11-05` version of the Model Context Protocol.
58+
* **Framework Agnostic:** Designed to work in vanilla PHP projects or integrated into any framework.
2759

2860
### 🚀 Getting Started
2961

3062
Please refer to the [README.md](README.md) for detailed installation instructions, usage examples, and core concepts. Sample implementations for `stdio` and `reactphp` are available in the `samples/` directory.
3163

3264
### ⚠️ Important Notes
3365

34-
* When implementing the `http` transport using `HttpTransportHandler`, be aware of the critical server environment requirements detailed in the README regarding concurrent request handling for SSE. Standard synchronous PHP servers (like `php artisan serve` or basic Apache/Nginx setups) are generally **not suitable** without proper configuration for concurrency (e.g., PHP-FPM with multiple workers, Octane, Swoole, ReactPHP, RoadRunner, FrankenPHP).
66+
* When implementing the `http` transport using `HttpTransportHandler`, be aware of the critical server environment requirements detailed in the README regarding concurrent request handling for SSE. Standard synchronous PHP servers (like `php artisan serve` or basic Apache/Nginx setups) are generally **not suitable** without proper configuration for concurrency (e.g., PHP-FPM with multiple workers, Octane, Swoole, ReactPHP, RoadRunner, FrankenPHP).
3567

3668
### Future Plans
3769

0 commit comments

Comments
 (0)