PHPackages                             wizardingcode/laravel-mcp-server - 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. wizardingcode/laravel-mcp-server

ActiveLibrary

wizardingcode/laravel-mcp-server
================================

Laravel Model Context Protocol (MCP) server implementation

0.0.1-beta(1y ago)803MITPHPPHP ^8.4

Since Apr 3Pushed 1y ago1 watchersCompare

[ Source](https://github.com/andreagroferreira/laravel-mcp-package)[ Packagist](https://packagist.org/packages/wizardingcode/laravel-mcp-server)[ Docs](https://github.com/wizardingcode/laravel-mcp-server)[ RSS](/packages/wizardingcode-laravel-mcp-server/feed)WikiDiscussions V0.0.1-beta Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (3)Used By (0)

Laravel MCP Package
===================

[](#laravel-mcp-package)

A Laravel package for implementing MCP (Model Context Protocol) servers, compatible with Laravel 12 and PHP 8.4.

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

[](#installation)

You can install the package via Composer:

```
composer require andreagroferreira/laravel-mcp-package
```

Publishing Configuration
------------------------

[](#publishing-configuration)

You can publish the configuration file using:

```
php artisan vendor:publish --tag=mcp-config
```

This will create a `config/mcp.php` file in your application where you can modify the MCP server settings.

Basic Usage
-----------

[](#basic-usage)

After installation, you can use the MCP facade to interact with the MCP service:

```
use WizardingCode\MCPServer\Facades\MCP;

// Register a static resource
MCP::registerResource('config', 'config://app', function ($uri, $request) {
    return [
        'contents' => [
            [
                'uri' => $uri,
                'text' => 'Application configuration content here',
            ],
        ],
    ];
}, ['description' => 'Application configuration']);
```

Real-World End-to-End Implementations
-------------------------------------

[](#real-world-end-to-end-implementations)

### 1. Enterprise Documentation System with Claude AI

[](#1-enterprise-documentation-system-with-claude-ai)

This example shows a complete implementation of an MCP server that gives Claude AI access to your company's internal documentation, allowing employees to query company docs right from Claude.

#### Step 1: Create a new Laravel project (if needed)

[](#step-1-create-a-new-laravel-project-if-needed)

```
composer create-project laravel/laravel documentation-mcp
cd documentation-mcp
```

#### Step 2: Install the MCP package

[](#step-2-install-the-mcp-package)

```
composer require andreagroferreira/laravel-mcp-package
```

#### Step 3: Publish the configuration

[](#step-3-publish-the-configuration)

```
php artisan vendor:publish --tag=mcp-config
```

#### Step 4: Create a database migration for storing documentation

[](#step-4-create-a-database-migration-for-storing-documentation)

```
php artisan make:migration create_documents_table
```

Edit the migration file:

```
