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.
Currently, this package focuses on API development tools, with more tools planned for future releases:
- 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
More MCP tools will be added to assist with various aspects of Laravel development.
Install the package via composer:
composer require abr4xas/mcp-toolsThe package will automatically register its service provider and MCP tools.
Generate a comprehensive API contract from your Laravel routes:
php artisan api:generate-contractThis 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
Once installed, the package provides these MCP tools that will be automatically discovered by your Laravel MCP server:
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
}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)
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"
}
}
}
}
}- PHP 8.4+
- Laravel 12.x
- Laravel MCP ^0.4.2
composer testRun tests with coverage:
vendor/bin/pest --coveragePlease see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.