Laravel MCP SDK
Laravel Based Implementation for Model Context Protocol
What is Laravel MCP SDK?
Laravel MCP SDK is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to laravel based implementation for model context protocol
Laravel Based Implementation for Model Context Protocol
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Laravel Based Implementation for Model Context Protocol
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx laravel-mcp-sdkConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Laravel MCP SDK
The Laravel MCP SDK is a Composer package that brings full Model Context Protocol support to Laravel applications, letting PHP developers register tools, resources, and prompts that any MCP-compatible AI client can discover and call. It supports HTTP, WebSocket, and stdio transports through a single Artisan command, and includes progress tracking, structured logging, and model preference configuration out of the box. Teams building AI-powered Laravel backends can use it to expose database queries, business logic, or file operations as typed MCP tools without leaving the framework they already know.
Prerequisites
- PHP 8.1 or higher with OpenSSL, PDO, Mbstring, XML, Ctype, and JSON extensions
- Laravel 10.x application
- Composer 2.x
- An MCP-compatible client such as Claude Desktop or Cursor
Install the package via Composer
Add the Laravel MCP SDK to your Laravel project's dependencies using Composer.
composer require laravelmcp/mcpPublish the configuration file
Publish the package's config file so you can customise transport settings, host, and port.
php artisan vendor:publish --provider="LaravelMCP\MCP\MCPServiceProvider" --tag="config"Set environment variables
Add the following keys to your .env file. MCP_SERVER_TRANSPORT can be http, websocket, or stdio depending on how your client connects.
MCP_SERVER_HOST=127.0.0.1
MCP_SERVER_PORT=8080
MCP_SERVER_TRANSPORT=httpRegister tools in your application
Use the FastMCP class to register callable tools with typed parameters. Place this in a service provider or dedicated MCP bootstrap file.
use LaravelMCP\MCP\FastMCP;
$mcp = new FastMCP();
$mcp->tool('get_user', [
'id' => ['type' => 'integer', 'required' => true]
])(function ($args) {
return ['user' => User::find($args['id'])];
});Start the MCP server
Use the Artisan command to launch the MCP server. For Claude Desktop integration, use --transport=stdio.
# HTTP mode
php artisan mcp:serve
# WebSocket mode
php artisan mcp:serve --transport=websocket --host=0.0.0.0 --port=8081
# Stdio mode (for Claude Desktop)
php artisan mcp:serve --transport=stdioConnect your MCP client
For Claude Desktop using stdio transport, register the server in claude_desktop_config.json pointing to your Laravel project's artisan binary.
{
"mcpServers": {
"laravel-mcp": {
"command": "php",
"args": ["/path/to/your/laravel/artisan", "mcp:serve", "--transport=stdio"]
}
}
}Laravel MCP SDK Examples
Client configuration
Claude Desktop configuration using stdio transport to connect to a local Laravel MCP server.
{
"mcpServers": {
"laravel-mcp": {
"command": "php",
"args": ["/var/www/myapp/artisan", "mcp:serve", "--transport=stdio"]
}
}
}Prompts to try
Example prompts once your Laravel tools are registered and the server is running.
- "List all available MCP tools registered in this Laravel server."
- "Call the get_user tool with id 42 and show me the result."
- "Use the calculate tool to multiply 17 by 89."
- "What resources are exposed by this MCP server?"Troubleshooting Laravel MCP SDK
php artisan mcp:serve fails with 'Class not found' error
Run composer dump-autoload to regenerate the autoloader after installation. Also confirm the service provider was published correctly.
Claude Desktop cannot connect when using stdio transport
Ensure the full absolute path to the artisan binary is in the args array and that PHP is in the system PATH accessible by Claude Desktop. Test by running the command manually in a terminal.
WebSocket transport connection drops repeatedly
Install the optional ext-pcntl and ext-posix PHP extensions and use Supervisor to keep the process alive. ReactPHP is required for HTTP and WebSocket transports — verify it is installed with composer show react/event-loop.
Frequently Asked Questions about Laravel MCP SDK
What is Laravel MCP SDK?
Laravel MCP SDK is a Model Context Protocol (MCP) server that laravel based implementation for model context protocol It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Laravel MCP SDK?
Follow the installation instructions on the Laravel MCP SDK GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Laravel MCP SDK?
Laravel MCP SDK works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Laravel MCP SDK free to use?
Yes, Laravel MCP SDK is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Laravel MCP SDK Alternatives — Similar Developer Tools Servers
Looking for alternatives to Laravel MCP SDK? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
Browse More Developer Tools MCP Servers
Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Laravel MCP SDK in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Laravel MCP SDK?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.