Laravel MCP SDK

v1.0.0Developer Toolsstable

Laravel Based Implementation for Model Context Protocol

laravelmcpmcp-clientsmcp-servermodel-context-protocol
Share:
29
Stars
0
Downloads
0
Weekly
0/5

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

Build MCP servers using Laravel framework for PHP applications.
Implement Model Context Protocol integrations with Laravel.
Develop AI-assistant-compatible tools in PHP with Laravel patterns.
mohamedahmed01

Maintainer

LicenseMIT
Languagephp
Versionv1.0.0
UpdatedMay 2, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx laravel-mcp-sdk

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

Install the package via Composer

Add the Laravel MCP SDK to your Laravel project's dependencies using Composer.

composer require laravelmcp/mcp
2

Publish 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"
3

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=http
4

Register 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'])];
});
5

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=stdio
6

Connect 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.

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.

Quick Config Preview

{ "mcpServers": { "laravel-mcp-sdk": { "command": "npx", "args": ["-y", "laravel-mcp-sdk"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides