|
| 1 | +# Changelog |
| 2 | + |
| 3 | +All notable changes to `php-mcp/laravel` will be documented in this file. |
| 4 | + |
| 5 | +## v1.1.1 - 2025-05-12 |
| 6 | + |
| 7 | +### What's Changed |
| 8 | +* McpServiceProvider File And loadElements function are not found by @tsztodd in https://github.com/php-mcp/laravel/pull/2 |
| 9 | + |
| 10 | +### New Contributors |
| 11 | +* @tsztodd made their first contribution in https://github.com/php-mcp/laravel/pull/2 |
| 12 | + |
| 13 | +**Full Changelog**: https://github.com/php-mcp/laravel/compare/1.1.0...1.1.1 |
| 14 | + |
| 15 | +## v1.1.0 - 2025-05-01 |
| 16 | + |
| 17 | +This release updates the package for compatibility with `php-mcp/server` v1.1.0. |
| 18 | + |
| 19 | +### What Changed |
| 20 | + |
| 21 | +* Updated dependency requirement to `php-mcp/server: ^1.1.0`. |
| 22 | +* Modified `McpServiceProvider` to correctly provide `ConfigurationRepositoryInterface`, `LoggerInterface`, and `CacheInterface` bindings to the underlying `Server` instance when resolved from the Laravel container. |
| 23 | +* Updated `ServeCommand` and `McpController` to inject the `Server` instance and instantiate `TransportHandler` classes according to `php-mcp/server` v1.1.0 constructor changes. |
| 24 | + |
| 25 | +### Fixed |
| 26 | + |
| 27 | +* Ensures compatibility with the refactored dependency injection and transport handler instantiation logic in `php-mcp/server` v1.1.0. |
| 28 | + |
| 29 | +**Full Changelog**: https://github.com/php-mcp/laravel/compare/1.0.0...1.1.0 |
| 30 | + |
| 31 | +# Release v1.0.0 - Initial Release |
| 32 | + |
| 33 | +**Initial Release** |
| 34 | + |
| 35 | +Welcome to the first release of `php-mcp/laravel`! This package provides seamless integration of the core [`php-mcp/server`](https://github.com/php-mcp/server) package with your Laravel application, allowing you to expose application functionality as Model Context Protocol (MCP) tools, resources, and prompts using simple PHP attributes. |
| 36 | + |
| 37 | +## Key Features |
| 38 | + |
| 39 | +* **Effortless Integration:** Automatically wires up Laravel's Cache, Logger, and Service Container for use by the MCP server. |
| 40 | +* **Attribute-Based Definition:** Define MCP tools, resources, and prompts using PHP attributes (`#[McpTool]`, `#[McpResource]`, etc.) within your Laravel application structure. Leverage Laravel's Dependency Injection within your MCP element classes. |
| 41 | +* **Configuration:** Provides a publishable configuration file (`config/mcp.php`) for fine-grained control over discovery, transports, caching, and capabilities. |
| 42 | +* **Artisan Commands:** Includes commands for element discovery (`mcp:discover`), listing discovered elements (`mcp:list`), and running the server via stdio (`mcp:serve`). |
| 43 | +* **HTTP+SSE Transport:** Sets up routes (`/mcp/message`, `/mcp/sse` by default) and a controller for handling MCP communication over HTTP, enabling browser-based clients and other HTTP consumers. |
| 44 | +* **Automatic Discovery (Dev):** Automatically discovers MCP elements in development environments on first use, improving developer experience (no need to manually run `mcp:discover` after changes). |
| 45 | +* **Manual Discovery (Prod):** Requires manual discovery (`mcp:discover`) for production environments, ensuring optimal performance via caching (integrates well with deployment workflows). |
| 46 | +* **Event Integration:** Dispatches Laravel events (`ToolsListChanged`, `ResourcesListChanged`, `PromptsListChanged`) when element lists change, allowing for custom integrations or notifications. |
| 47 | + |
| 48 | +## Installation |
| 49 | + |
| 50 | +Installation is straightforward using Composer. See the [README Installation Guide](https://github.com/php-mcp/laravel/blob/main/README.md#installation) for full details. |
| 51 | + |
| 52 | +```bash |
| 53 | +# 1. Require the package |
| 54 | +composer require php-mcp/laravel |
| 55 | + |
| 56 | +# 2. Publish the configuration file (optional but recommended) |
| 57 | +php artisan vendor:publish --provider="PhpMcp\Laravel\Server\McpServiceProvider" --tag="mcp-config" |
| 58 | +``` |
| 59 | + |
| 60 | +## Getting Started |
| 61 | + |
| 62 | +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). |
| 63 | +2. **Discovery:** |
| 64 | + * In development, discovery runs automatically when needed. |
| 65 | + * 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). |
| 66 | +3. **Run the Server:** |
| 67 | + * For **Stdio Transport:** Use `php artisan mcp:serve` and configure your client to execute this command (using the full path to `artisan`). |
| 68 | + * 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. |
| 69 | + |
| 70 | +## Important Notes |
| 71 | + |
| 72 | +* **HTTP Transport Server Requirement:** The standard `php artisan serve` development server is **not suitable** for the HTTP+SSE transport due to its single-process nature. Use a proper web server setup like Nginx/Apache + PHP-FPM or Laravel Octane. |
| 73 | +* **CSRF Exclusion:** If using the default `web` middleware group for the HTTP transport, you **must** exclude the MCP message route (default: `mcp` or `mcp/*`) from CSRF protection in your application to avoid `419` errors. |
| 74 | +* **Dependencies:** Requires PHP >= 8.1 and Laravel >= 10.0. |
| 75 | + |
| 76 | +## Links |
| 77 | + |
| 78 | +* **GitHub Repository:** https://github.com/php-mcp/laravel |
| 79 | +* **Packagist:** https://packagist.org/packages/php-mcp/laravel |
| 80 | + |
| 81 | +Please report any issues or provide feedback on the GitHub repository. |
0 commit comments