Laravel package for secure Model Context Protocol servers
Top 91.9% on SourcePulse
This package provides a Laravel implementation for Model Context Protocol (MCP) servers, focusing on secure Streamable HTTP transport for real-time communication between LLM clients and enterprise applications. It offers a robust alternative to traditional STDIO transport, enhancing security and control over API exposure.
How It Works
The package leverages Streamable HTTP for communication, allowing LLM clients to interact with defined "tools" (PHP classes implementing ToolInterface
). This approach contrasts with STDIO, offering better security by avoiding direct exposure of internal system details. Tools define their input schemas, descriptions, and execution logic, enabling structured and validated interactions. It also supports a legacy SSE provider for backward compatibility.
Quick Start & Requirements
composer require opgginc/laravel-mcp-server
php artisan vendor:publish --provider="OPGG\LaravelMcpServer\LaravelMcpServerServiceProvider"
php artisan serve
is not supported.Highlighted Details
make:mcp-tool
), migrating tools (mcp:migrate-tools
), and testing tools (mcp:test-tool
).ToolInterface
has undergone significant changes, with messageType()
deprecated in favor of isStreaming()
.Maintenance & Community
The project is maintained by OP.GG. The README includes detailed migration guides for breaking changes and deprecations, indicating active development and version management.
Licensing & Compatibility
Distributed under the MIT license, allowing for commercial use and integration with closed-source applications.
Limitations & Caveats
The legacy SSE provider is not compatible with php artisan serve
and requires specific server configurations. The messageType()
method in ToolInterface
is deprecated and will be removed in v2.0.0, necessitating updates to existing tools.
1 week ago
1 week