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
This release marks a **major overhaul**, bringing it into full alignment with `php-mcp/server` v2.1.0+ and introducing a significantly improved, more "Laravely" developer experience.
8
28
9
29
### Added
10
30
11
31
***Fluent Manual Registration API:**
12
-
* Introduced the `Mcp` Facade (`PhpMcp\Laravel\Facades\Mcp`).
* Definitions are typically placed in `routes/mcp.php` (configurable).
36
+
* Handlers are resolved via Laravel's service container, allowing dependency injection.
37
+
17
38
***Dedicated HTTP Server Transport via `mcp:serve`:**
18
-
* The `php artisan mcp:serve --transport=http` command now launches a standalone, high-performance ReactPHP-based HTTP server using `\PhpMcp\Server\Transports\HttpServerTransport`.
19
-
* Configuration for this dedicated server is in `config/mcp.php` under `transports.http_dedicated`.
20
-
* CLI options (`--host`, `--port`, `--path-prefix`) can override config defaults.
21
-
39
+
40
+
* The `php artisan mcp:serve --transport=http` command now launches a standalone, high-performance ReactPHP-based HTTP server using `\PhpMcp\Server\Transports\HttpServerTransport`.
41
+
* Configuration for this dedicated server is in `config/mcp.php` under `transports.http_dedicated`.
42
+
* CLI options (`--host`, `--port`, `--path-prefix`) can override config defaults.
43
+
22
44
***`LaravelHttpTransport` for Integrated HTTP:**
23
-
* New `PhpMcp\Laravel\Transports\LaravelHttpTransport` class implements `ServerTransportInterface` to bridge Laravel's HTTP request lifecycle with the core MCP `Protocol` handler.
24
-
45
+
46
+
* New `PhpMcp\Laravel\Transports\LaravelHttpTransport` class implements `ServerTransportInterface` to bridge Laravel's HTTP request lifecycle with the core MCP `Protocol` handler.
47
+
25
48
***Configurable Auto-Discovery:**
26
-
*`config('mcp.discovery.auto_discover')` (default: `true`) now controls whether discovery runs automatically or not. You can set it to false in production..
27
-
49
+
50
+
*`config('mcp.discovery.auto_discover')` (default: `true`) now controls whether discovery runs automatically or not. You can set it to false in production..
51
+
28
52
***Interactive Prompt for `mcp:serve`:** If `--transport` is not specified, the command now interactively prompts the user to choose between `stdio` and `http`.
53
+
29
54
30
55
### Changed
31
56
32
57
***Core Server Integration:** Now uses `\PhpMcp\Server\Server::make()` (ServerBuilder) for all server instantiation, fully leveraging `php-mcp/server` v2.x architecture.
58
+
33
59
***Namespace:** Base package namespace changed from `PhpMcp\Laravel\Server` to **`PhpMcp\Laravel`**.
60
+
34
61
***Configuration (`config/mcp.php`):**
35
-
* Significantly restructured and updated to align with `ServerBuilder` options.
36
-
* Clearer separation of settings for `http_dedicated` vs. `http_integrated` transports.
37
-
* Simplified cache TTL (`cache.ttl`) and discovery (`discovery.save_to_cache_on_discover`) keys.
38
-
* Added `server.instructions` for the `initialize` MCP response.
39
-
* Added `discovery.exclude_dirs` and `discovery.definitions_file`.
40
-
62
+
63
+
* Significantly restructured and updated to align with `ServerBuilder` options.
64
+
* Clearer separation of settings for `http_dedicated` vs. `http_integrated` transports.
65
+
* Simplified cache TTL (`cache.ttl`) and discovery (`discovery.save_to_cache_on_discover`) keys.
66
+
* Added `server.instructions` for the `initialize` MCP response.
67
+
* Added `discovery.exclude_dirs` and `discovery.definitions_file`.
68
+
41
69
***`McpServiceProvider`:**
42
-
* Completely rewritten to correctly build and configure the `\PhpMcp\Server\Server` instance using Laravel's services for logging, caching (with fallback to core `FileCache`), container, and event loop.
43
-
* Loads manual definitions from the configured `definitions_file` via `McpRegistrar`.
44
-
* Sets up core `Registry` notifiers to dispatch Laravel events for list changes.
45
-
70
+
71
+
* Completely rewritten to correctly build and configure the `\PhpMcp\Server\Server` instance using Laravel's services for logging, caching (with fallback to core `FileCache`), container, and event loop.
72
+
* Loads manual definitions from the configured `definitions_file` via `McpRegistrar`.
73
+
* Sets up core `Registry` notifiers to dispatch Laravel events for list changes.
74
+
46
75
***`McpController` (Integrated HTTP):** More robustly handles the integrated server behavior, working with a custom `LaravelHttpTransport`.
76
+
47
77
***Artisan Commands:**
48
-
*`mcp:discover`: Now directly calls `Server::discover()` with configured/CLI parameters. `force` option behavior clarified.
49
-
*`mcp:list`: Fetches elements from the live, fully configured `Registry` from the resolved `Server` instance.
50
-
*`mcp:serve`: Refactored to use core `StdioServerTransport` or `HttpServerTransport` directly.
51
-
78
+
79
+
*`mcp:discover`: Now directly calls `Server::discover()` with configured/CLI parameters. `force` option behavior clarified.
80
+
*`mcp:list`: Fetches elements from the live, fully configured `Registry` from the resolved `Server` instance.
81
+
*`mcp:serve`: Refactored to use core `StdioServerTransport` or `HttpServerTransport` directly.
82
+
52
83
***Dependency:** Updated `php-mcp/server` to `^2.2.0`
84
+
53
85
54
86
### Fixed
55
87
@@ -66,7 +98,8 @@ This release marks a **major overhaul**, bringing it into full alignment with `p
66
98
***Configuration File:** The `config/mcp.php` file has been significantly restructured. You **must** republish and merge your customizations:
***`mcp:serve`forHTTP:** The `--transport=http` option for `mcp:serve` now launches a *dedicated* ReactPHP-based server process. For serving MCP via your main Laravel application routes, ensure the `http_integrated` transport is enabledin`config/mcp.php` and your web server is configured appropriately.
72
105
***Event Handling:** If you were directly listening to internal events from the previous version, these may have changed. Rely on the documented Laravel events (`ToolsListChanged`, etc.).
1. **Define Elements:** Create PHP classes with methods annotated with `#[McpTool]`, `#[McpResource]`, etc., within directories specified in`config/mcp.php` (e.g., `app/Mcp`). Inject dependencies as needed. See [Defining MCP Elements](https://github.com/php-mcp/laravel/blob/main/README.md#defining-mcp-elements).
171
+
137
172
2. **Discovery:**
138
-
* In development, discovery runs automatically when needed.
139
-
* In production, run `php artisan mcp:discover` during your deployment process. See [Automatic Discovery vs. Manual Discovery](https://github.com/php-mcp/laravel/blob/main/README.md#automatic-discovery-development-vs-manual-discovery-production).
140
-
173
+
174
+
* In development, discovery runs automatically when needed.
175
+
* In production, run `php artisan mcp:discover` during your deployment process. See [Automatic Discovery vs. Manual Discovery](https://github.com/php-mcp/laravel/blob/main/README.md#automatic-discovery-development-vs-manual-discovery-production).
176
+
141
177
3. **Run the Server:**
142
-
* For **Stdio Transport:** Use `php artisan mcp:serve` and configure your client to execute this command (using the full path to `artisan`).
143
-
* For **HTTP+SSE Transport:** Ensure `transports.http.enabled` is true, run your Laravel app on a suitable web server (Nginx+FPM, Octane, etc. - **not**`php artisan serve`), exclude the MCP route from CSRF protection, and configure your client with the SSE URL (e.g., `http://your-app.test/mcp/sse`). See [Running the Server](https://github.com/php-mcp/laravel/blob/main/README.md#running-the-server) for critical details.
144
-
178
+
179
+
* For **Stdio Transport:** Use `php artisan mcp:serve` and configure your client to execute this command (using the full path to `artisan`).
180
+
* For **HTTP+SSE Transport:** Ensure `transports.http.enabled` is true, run your Laravel app on a suitable web server (Nginx+FPM, Octane, etc. - **not**`php artisan serve`), exclude the MCP route from CSRF protection, and configure your client with the SSE URL (e.g., `http://your-app.test/mcp/sse`). See [Running the Server](https://github.com/php-mcp/laravel/blob/main/README.md#running-the-server) for critical details.
0 commit comments