MCP Catalogs
Home

laravel-mcp-sdk

by mohamedahmed01·29·Score 41

A comprehensive Laravel implementation of the Model Context Protocol with multiple transport options and tool registration.

developer-toolsai-llmops-infra
4
Forks
0
Open issues
10 mo ago
Last commit
2d ago
Indexed

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:

you:Integrating AI capabilities into Laravel applications through standardized interfaces
you:Building custom AI tools that interact with Laravel's ecosystem
you:Creating real-time AI-powered features with WebSocket transport support
you:What transport options are available?
you:How do I register custom tools?
you:Can this package be used with non-Laravel PHP applications?

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 README
  • calculatefunction (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

php-mcpmcp-serverlaravel-openai

Installation

Installation

Install via Composer:

composer require laravelmcp/mcp

The package will automatically register its service provider and facade.

Configuration

  1. Publish the configuration:
php artisan vendor:publish --provider="LaravelMCP\MCP\MCPServiceProvider" --tag="config"
  1. Configure environment variables:
MCP_SERVER_HOST=127.0.0.1
MCP_SERVER_PORT=8080
MCP_SERVER_TRANSPORT=http

Claude 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

GitHub →

Last updated · Auto-generated from public README + GitHub signals.