abr4xas / mcp-tools
A collection of MCP (Model Context Protocol) tools for Laravel development
Fund package maintenance!
www.paypal.com/paypalme/soyangelcruz
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/abr4xas/mcp-tools
Requires
- php: ^8.4
- illuminate/contracts: ^11.0||^12.0
- laravel/mcp: ^0.4.2
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.8
- orchestra/testbench: ^10.0.0||^9.0.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-arch: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
This package is auto-updated.
Last update: 2025-12-15 01:10:29 UTC
README
MCP Tools for Laravel
A growing collection of Model Context Protocol (MCP) tools designed to enhance Laravel development with AI assistance. This package provides ready-to-use MCP tools that integrate seamlessly with your Laravel MCP server.
Important
This package provides MCP tools that must be registered in your project's MCP server. It does not create or run an MCP server itself - you need to have Laravel MCP configured in your project.
What's Included
Currently, this package focuses on API development tools, with more tools planned for future releases:
API Tools
- API Contract Generation: Automatically scan Laravel routes and generate comprehensive API documentation
- Route Discovery: List and filter API routes by method, version, and search terms
- Route Description: Get detailed endpoint information including auth, parameters, and schemas
Coming Soon
More MCP tools will be added to assist with various aspects of Laravel development.
Installation
Install the package via composer:
composer require abr4xas/mcp-tools
The package will automatically register its service provider and MCP tools.
Usage
API Contract Generation
Generate a comprehensive API contract from your Laravel routes:
php artisan api:generate-contract
This command will:
- Scan all your application routes
- Extract route information (methods, paths, parameters)
- Analyze controller methods and FormRequest classes
- Generate authentication requirements
- Create a JSON file at
storage/api-contracts/api.json
Available MCP Tools
Once installed, the package provides these MCP tools that will be automatically discovered by your Laravel MCP server:
1. list-api-routes
Lists all API routes with optional filtering.
Arguments:
method(optional): Filter by HTTP method (GET, POST, PUT, DELETE, PATCH)version(optional): Filter by API version (v1, v2, etc.)search(optional): Search term to filter routes by pathlimit(optional): Maximum number of results (default: 50, max: 200)
Example:
{
"method": "GET",
"version": "v1",
"search": "users",
"limit": 10
}
2. describe-api-route
Get detailed information about a specific endpoint.
Arguments:
path(required): The API route path (e.g.,/api/v1/users/{user})method(optional): HTTP method (defaults to GET)
Example:
{
"path": "/api/v1/users/{user}",
"method": "GET"
}
Response includes:
- Route description
- API version
- Authentication requirements
- Path parameters with types
- Request/response schemas (if available)
API Contract Structure
The generated contract at storage/api-contracts/api.json follows this structure:
{
"/api/v1/users": {
"GET": {
"description": "List all users",
"api_version": "v1",
"auth": {
"type": "bearer"
},
"path_parameters": {}
},
"POST": {
"description": "Create a new user",
"api_version": "v1",
"auth": {
"type": "bearer"
},
"request_schema": {...},
"response_schema": {...}
}
},
"/api/v1/users/{user}": {
"GET": {
"description": "Get user details",
"api_version": "v1",
"auth": {
"type": "bearer"
},
"path_parameters": {
"user": {
"type": "integer"
}
}
}
}
}
Requirements
- PHP 8.4+
- Laravel 12.x
- Laravel MCP ^0.4.2
Testing
composer test
Run tests with coverage:
vendor/bin/pest --coverage
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.