Download the PHP package wizardingcode/laravel-mcp-server without Composer
On this page you can find all versions of the php package wizardingcode/laravel-mcp-server. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wizardingcode/laravel-mcp-server
More information about wizardingcode/laravel-mcp-server
Files in wizardingcode/laravel-mcp-server
Package laravel-mcp-server
Short Description Laravel Model Context Protocol (MCP) server implementation
License MIT
Homepage https://github.com/wizardingcode/laravel-mcp-server
Informations about the package laravel-mcp-server
Laravel MCP Package
A Laravel package for implementing MCP (Model Context Protocol) servers, compatible with Laravel 12 and PHP 8.4.
Installation
You can install the package via Composer:
Publishing Configuration
You can publish the configuration file using:
This will create a config/mcp.php
file in your application where you can modify the MCP server settings.
Basic Usage
After installation, you can use the MCP facade to interact with the MCP service:
Real-World End-to-End Implementations
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 2: Install the MCP package
Step 3: Publish the configuration
Step 4: Create a database migration for storing documentation
Edit the migration file:
Run the migration:
Step 5: Create a Document model
Edit the model file:
Step 6: Create a DocumentationService
Create a new file app/Services/DocumentationService.php
:
Step 7: Set up MCP resources and tools in a service provider
Create a new file app/Providers/MCPServiceProvider.php
:
Step 8: Register the service provider in config/app.php
Add the following to the providers
array:
Step 9: Create a seeder to populate the documentation database
Edit the seeder file:
Run the seeder:
Step 10: Configure Claude.ai to use your MCP server
-
Start your Laravel server:
-
In a production environment, make sure your server is accessible via the internet with a valid SSL certificate.
-
In Claude.ai, go to Claude Labs, enable "Use Claude with other apps", and add your MCP server URL:
- MCP Server URL:
https://your-server.com/api/mcp
- MCP Server URL:
- Now you can ask Claude questions about your company documentation, such as:
- "What are our company's work hours?"
- "What is our deployment process?"
- "Search for information about code reviews"
2. E-commerce Integration with Postgres and WhatsApp
This example demonstrates setting up an MCP server that connects to a PostgreSQL database for e-commerce order information and can send WhatsApp notifications to customers.
Step 1: Create a new Laravel project (if needed)
Step 2: Install the MCP package and other dependencies
Step 3: Set up the database
Configure your .env
file with PostgreSQL connection details:
Step 4: Create migrations
Edit the migrations:
create_customers_table.php
create_products_table.php
create_orders_table.php
create_order_items_table.php
Run the migrations:
Step 5: Create models
Edit the models:
Customer.php
Product.php
Order.php
OrderItem.php
Step 6: Create a seeder to populate the database
Edit the seeder file:
Run the seeder:
Step 7: Create services for WhatsApp integration
Create a file app/Services/WhatsAppService.php
:
Step 8: Update the config file to include WhatsApp settings
Add the following to config/services.php
:
Update your .env
file with:
Step 9: Create an E-commerce MCP Service Provider
Create a file app/Providers/EcommerceMCPServiceProvider.php
:
Step 10: Register the EcommerceMCPServiceProvider in config/app.php
Add the following to the providers
array:
Step 11: Configure and start the server
Now your MCP server is ready to be used by Claude or other AI assistants. Connect it using:
MCP Server URL: http://localhost:8000/api/mcp
You can now ask questions like:
- "Show me all orders in the system"
- "What's the status of order #1?"
- "Find all orders that are shipped"
- "Update order #2 status to shipped"
- "Send a notification to customer #1 about their order status"
3. Business Intelligence Dashboard Integration with n8n
This example shows how to build an MCP server that can connect to various data sources and trigger n8n workflows for business intelligence tasks.
Step 1: Create a new Laravel project
Step 2: Install the MCP package and required dependencies
Step 3: Create sample data services
Create the file app/Services/SalesDataService.php
:
Create the file app/Services/N8NService.php
:
Step 4: Update your config file to include n8n settings
Add to config/services.php
:
Update your .env
file:
Step 5: Create the MCP service provider
Create the file app/Providers/BIMCPServiceProvider.php
:
Step 6: Register the BIMCPServiceProvider in config/app.php
Add the following to the providers
array:
Step 7: Start the server
Now your business intelligence MCP server is ready for use. Connect it to Claude AI or other AI assistants using:
MCP Server URL: http://localhost:8000/api/mcp
You can now ask questions like:
- "Show me an overview of all sales data"
- "What are the sales figures for the North region?"
- "List all available n8n workflows"
- "Generate a sales report for the South region and email it to [email protected]"
- "Export the East region sales data to Google Sheets with ID 1ABC123XYZ"
- "What were our total sales for Product A?"
Testing
Note: Feature tests are currently skipped and will be improved in future releases. Unit tests are fully functional and cover the core MCP service functionality.
License
This package is open-source software licensed under the MIT license.