PHPackages                             dalehurley/laravel-php-mcp-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. dalehurley/laravel-php-mcp-sdk

ActiveLibrary[HTTP &amp; Networking](/categories/http)

dalehurley/laravel-php-mcp-sdk
==============================

Comprehensive Laravel wrapper for PHP MCP SDK with full MCP 2025-06-18 specification support

v0.1.6(5mo ago)1372↑233.3%MITPHPPHP ^8.1

Since Sep 17Pushed 5mo agoCompare

[ Source](https://github.com/dalehurley/laravel-php-mcp-sdk)[ Packagist](https://packagist.org/packages/dalehurley/laravel-php-mcp-sdk)[ Docs](https://github.com/dalehurley/laravel-php-mcp-sdk)[ RSS](/packages/dalehurley-laravel-php-mcp-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (17)Versions (8)Used By (0)

Laravel MCP SDK
===============

[](#laravel-mcp-sdk)

[![Latest Version](https://camo.githubusercontent.com/d85e3fe7ab0d9137f44d419507eff34916a4455939d6ca2c43ef4b459a37c339/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64616c656875726c65792f6c61726176656c2d7068702d6d63702d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dalehurley/laravel-php-mcp-sdk)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Total Downloads](https://camo.githubusercontent.com/1635f1ae324c1d8f6ed63be52fe669e405bade9fe2fd9305744cda99334391d7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64616c656875726c65792f6c61726176656c2d7068702d6d63702d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dalehurley/laravel-php-mcp-sdk)

A comprehensive Laravel wrapper around the [PHP MCP SDK](https://github.com/dalehurley/php-mcp-sdk) that provides full **MCP 2025-06-18 specification support** with Laravel's ease of use and conventions.

Features
--------

[](#features)

### 🚀 **Full MCP 2025-06-18 Specification Support**

[](#-full-mcp-2025-06-18-specification-support)

- Complete implementation of the Model Context Protocol
- All transport types: STDIO, HTTP, WebSocket
- Full support for tools, resources, prompts, roots, sampling, and elicitation
- Advanced utilities: cancellation, ping, progress reporting, completion, logging, pagination

### 🔄 **Multiple Dynamic Servers &amp; Clients**

[](#-multiple-dynamic-servers--clients)

- Support for multiple named server instances
- Multiple named client connections
- Dynamic server/client creation and management
- Connection pooling and lifecycle management
- Per-instance configuration and capabilities

### 🎯 **Laravel-Native Integration**

[](#-laravel-native-integration)

- Deep integration with Laravel's service container, events, cache, queue system
- Laravel-style configuration with environment variables
- Comprehensive Artisan commands for all MCP operations
- Auto-discovery of tools, resources, and prompts
- Laravel validation, middleware, and security features

### 🔒 **Production-Ready Security**

[](#-production-ready-security)

- OAuth 2.1 authentication with PKCE support
- Bearer token and API key authentication
- Scope-based authorization
- CORS handling, rate limiting, input validation
- Security headers and suspicious activity detection

### 🛠 **Developer Experience**

[](#-developer-experience)

- Zero configuration for basic use cases
- Intuitive Laravel-style APIs
- Rich debugging and monitoring capabilities
- Comprehensive testing with Laravel's test helpers
- Extensive documentation and examples

Installation
------------

[](#installation)

Install the package via Composer:

```
composer require dalehurley/laravel-php-mcp-sdk
```

The package will automatically register its service provider and facades.

Quick Start
-----------

[](#quick-start)

### 1. Install MCP Scaffolding

[](#1-install-mcp-scaffolding)

```
php artisan mcp:install --all
```

This will:

- Publish the configuration file
- Create necessary directories
- Install example tools, resources, and prompts
- Set up the basic structure

### 2. Configure Your Servers

[](#2-configure-your-servers)

Edit `config/mcp.php` to configure your servers:

```
'servers' => [
    'main' => [
        'name' => 'My MCP Server',
        'version' => '1.0.0',
        'transport' => 'stdio',
        'tools' => [
            'discover' => [app_path('Mcp/Tools')],
            'auto_register' => true,
        ],
    ],

    'api' => [
        'name' => 'API Server',
        'transport' => 'http',
        'tools' => [
            'discover' => [app_path('Mcp/Api/Tools')],
            'auto_register' => true,
        ],
    ],
],
```

### 3. Create Your First Tool

[](#3-create-your-first-tool)

```
# This creates app/Mcp/Tools/CalculatorTool.php
```

```
