feat: Upgrade to php-mcp/server ^3.x with enhanced session management and streamable transport#24
Merged
CodeWithKyrian merged 8 commits intomainfrom Jun 26, 2025
Merged
Conversation
…handling - Updated `php-mcp/server` dependency to version `^3.0` in composer.json. - Refactored HTTP transport handling by removing the old `McpController` and introducing `SseTransportController` and `StreamableTransportController`. - Enhanced configuration options in `mcp.php` for dedicated and integrated HTTP transports, including support for JSON responses and event stores. - Updated routing to use a new web.php file for handling transport routes. - Improved session management and logging configurations in the MCP setup. - Adjusted command outputs for clarity when starting the MCP server.
- Added a lottery configuration for session garbage collection in `mcp.php`. - Updated `LaravelHttpTransport` to include session garbage collection on message requests. - Refactored `LaravelStreamableHttpTransport` to streamline message handling and improve context management. - Adjusted command output formatting for better readability when starting the MCP server.
- Add FileSessionHandler with directory auto-creation and proper gc() - Add DatabaseSessionHandler with base64 encoding and session tracking - Update McpServiceProvider to construct handlers directly instead of using server builder - Add session configuration options for file path and database settings - Include database migration for mcp_sessions table - Support all Laravel session drivers: array, file, cache, database, redis, memcached, dynamodb
- Refactored tests to replace deprecated methods with updated ones for retrieving tools, resources, and prompts. - Enhanced assertions in tests to align with the new schema structure for registered elements. - Updated command tests to reflect changes in the MCP registry and output messages for better clarity.
- Updated the capabilities structure in `mcp.php` to streamline the configuration by removing nested arrays for tools, resources, prompts, and logging. - Enhanced the `McpServiceProvider` to reflect the new configuration structure, ensuring compatibility with the updated capabilities. - Added support for completions and clarified the experimental capabilities in the configuration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
php-mcp/serverfrom ^2.x to ^3.xFixes
Breaking Changes
php-mcp/server ^3.0Migration
See the updated README for migration guide from v2.x to v3.x, including configuration changes and new session management options.