laravel-mcp-sdk
by mohamedahmed01·★ 29·Score 41
A comprehensive Laravel implementation of the Model Context Protocol with multiple transport options and tool registration.
Overview
This Laravel MCP SDK provides a robust implementation of the Model Context Protocol for Laravel applications. It offers multiple transport options including HTTP, WebSocket, and Stdio, making it versatile for different integration scenarios. The package supports tool registration, resource management, prompt handling, progress tracking, and comprehensive logging system. The codebase follows PHP best practices with clear structure and extensive PHPDoc documentation.
Try asking AI
After installing, here are 6 things you can ask your AI assistant:
When to choose this
Choose this server if you're building Laravel applications that need AI integration with Laravel's ecosystem features, require multiple transport options, or need to leverage existing Laravel infrastructure.
When NOT to choose this
Avoid this if you're working outside the Laravel ecosystem, need a pure PHP implementation without framework dependencies, or require very lightweight footprint.
Tools this server exposes
4 tools extracted from the READMEcalculatefunction (num1, num2, operation)Performs basic mathematical operations (addition, subtraction, multiplication, division)
process-datafunction (items, token)Processes an array of items with progress tracking and logging
analyze-complexityfunction (code, language)Analyzes code complexity metrics and provides suggestions
review-codefunction (code, language, style)Performs code reviews with different styles (serious, fun, sarcastic)
Comparable tools
Installation
Installation
Install via Composer:
composer require laravelmcp/mcpThe package will automatically register its service provider and facade.
Configuration
- Publish the configuration:
php artisan vendor:publish --provider="LaravelMCP\MCP\MCPServiceProvider" --tag="config"- Configure environment variables:
MCP_SERVER_HOST=127.0.0.1
MCP_SERVER_PORT=8080
MCP_SERVER_TRANSPORT=httpClaude Desktop Configuration
Add to your Claude Desktop configuration:
{
"mcpServers": {
"laravel-mcp": {
"command": "php",
"args": ["artisan", "mcp:serve"]
}
}
}FAQ
- What transport options are available?
- The package supports HTTP (RESTful API), WebSocket (for real-time communication), and Stdio (for command-line applications) transports.
- How do I register custom tools?
- Use the FastMCP class to register tools with defined parameters and handler functions. Example: $mcp->tool('tool-name', $parameters)($handler);
- Can this package be used with non-Laravel PHP applications?
- While designed for Laravel, the core MCP components may be usable in other PHP applications with some adaptation, though full integration would require additional work.
Compare laravel-mcp-sdk with
Last updated · Auto-generated from public README + GitHub signals.