armandsar / laravel-mcp-documentation-generator
Generate rich HTML documentation for Laravel MCP web servers.
Package info
github.com/armandsar/laravel-mcp-documentation-generator
pkg:composer/armandsar/laravel-mcp-documentation-generator
Fund package maintenance!
Requires
- php: ^8.2
- ext-json: *
- illuminate/container: ^12.0||^13.0
- illuminate/contracts: ^12.0||^13.0
- illuminate/routing: ^12.0||^13.0
- illuminate/support: ^12.0||^13.0
- laravel/mcp: ^0.7.0
- 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||^11.0.0
- pestphp/pest: ^3.8||^4.0
- pestphp/pest-plugin-laravel: ^3.0||^4.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
README
Generate HTML documentation for Laravel MCP servers.
Installation
You can install the package via composer:
composer require armandsar/laravel-mcp-documentation-generator
You can publish the config file with:
php artisan vendor:publish --tag="mcp-documentation-generator-config"
Contents of the published config file:
return [ 'enabled' => env('MCP_DOCS_ENABLED', false), 'url' => '/docs/mcp', 'middleware' => [], 'servers' => [], ];
Usage
Register one or more Laravel MCP web servers in your application:
use App\Mcp\CompanyMcpServer; use App\Mcp\OtherMcpServer; use Laravel\Mcp\Facades\Mcp; Mcp::web('/mcp/company', CompanyMcpServer::class); Mcp::web('/mcp/other', OtherMcpServer::class);
Enable the route and open /docs/mcp:
MCP_DOCS_ENABLED=true
The readable schema tables cover the common top-level fields, required flags, enums, arrays, and simple union types. The full raw JSON schemas are always available beside the readable tables for nested or advanced schema shapes.
To restrict the docs page to specific servers, configure servers with server classes. Leave it empty to include every discovered web MCP server:
'servers' => [
CompanyMcpServer::class,
],
Keep the route disabled in environments where it should not be public, or add middleware to protect it:
'middleware' => ['auth'],
Testing
composer test
Credits
License
The MIT License (MIT). Please see License File for more information.