Download the PHP package elliottlawson/mcp-laravel-sdk without Composer
On this page you can find all versions of the php package elliottlawson/mcp-laravel-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download elliottlawson/mcp-laravel-sdk
More information about elliottlawson/mcp-laravel-sdk
Files in elliottlawson/mcp-laravel-sdk
Package mcp-laravel-sdk
Short Description Laravel-native implementation of the Model Context Protocol (MCP)
License MIT
Informations about the package mcp-laravel-sdk
Laravel MCP Server
A Laravel-native implementation of the Model Context Protocol (MCP) Server, allowing seamless integration of MCP capabilities into Laravel applications. Compatible with Laravel 10.x, 11.x, and 12.x, with optimizations for the latest Laravel versions.
Installation
You can install the package via composer:
The service provider will be automatically registered through Laravel's package discovery.
Configuration
Laravel 10 and 11
For Laravel 10 and 11, publish the configuration file using:
This will create a config/mcp.php
file that you can customize.
Laravel 12
For Laravel 12, the configuration should be placed in the bootstrap/mcp.php
file, following Laravel 12's new configuration approach. Create this file manually or publish it using:
Features
- Full Laravel-native implementation with no external JSON-RPC dependencies
- Proper SSE implementation that works with Laravel's response lifecycle
- Direct integration with Laravel's Eloquent models
- Simple registration API for resources, tools, and prompts
- JSON-RPC 2.0 compliant API
- Support for batch requests
- Comprehensive error handling
Basic Usage
Registering Resources, Tools, and Prompts
You can register resources, tools, and prompts in your service provider or directly in your application code:
Configuration File
Here's an example configuration file:
Creating Custom Components
Custom Resource
Custom Tool
Making MCP Requests
JSON-RPC Request Format
Available Methods
server.info
- Get server informationresource.get
- Get a resourcetool.execute
- Execute a toolprompt.get
- Get a prompt
Example Response
SSE Connection
The MCP server supports Server-Sent Events (SSE) for real-time communication. Connect to the SSE endpoint:
Testing
License
The MIT License (MIT). Please see License File for more information.
All versions of mcp-laravel-sdk with dependencies
laravel/framework Version ^10.48.29|^11.0|^12.0
symfony/http-foundation Version ^6.0|^7.0
laravel/helpers Version ^1.6
sajya/server Version ^7.0
guzzlehttp/guzzle Version ^7.0