gomdimapps / laravel-mcp-pilot
Token-lean toolkit for Laravel projects, built for MCP and other low-token AI integrations: a lexical index (classes, routes, views, frontend files, with pluggable schema extraction) and a driver-agnostic database introspection tool (list tables, describe schema, run guarded queries, optional Spatie
Requires
- php: ^8.3
- laravel/framework: ^12.0|^13.0
Requires (Dev)
- orchestra/testbench: ^10.0|^11.0
- pestphp/pest: ^2.0|^3.0
- pestphp/pest-plugin-laravel: ^2.0|^3.0
- spatie/laravel-permission: ^6.0
Suggests
- spatie/laravel-permission: Enables Spatie Permission schema introspection (roles/permissions) in DatabaseIntrospectionService::describeTable().
README
Token-lean toolkit for Laravel projects โ Lexical Search ยท Database Introspection
LaravelMCPPilot gives AI agents (or an MCP server) two cheap ways to explore a Laravel project: a lexical code index (classes, routes, views, frontend files, with schema extraction) and a driver-agnostic database introspection tool (list tables, describe schema, run guarded queries).
Quick Start
composer require gomdimapps/laravel-mcp-pilot php artisan vendor:publish --tag=laravel-mcp-pilot-config
Search
use GomdimApps\LaravelMCPPilot\Search\SearchService; $index = app(SearchService::class); $index->refresh(); $index->search('store thing');
Database
use GomdimApps\LaravelMCPPilot\Database\DatabaseIntrospectionService; $db = app(DatabaseIntrospectionService::class); $db->listTables('pgsql', 'thing'); $db->describeTable('pgsql', 'things');
Requirements
| Requirement | Version |
|---|---|
| PHP | >= 8.3 |
| Laravel | ^12.0 or ^13.0 |
| spatie/laravel-permission (optional) | ^6.0 โ enables role/permission mapping in the Database tool |
Features
- ๐ Lexical search โ classes, routes, views, and frontend files by term, no AST/embeddings
- ๐๏ธ Database introspection โ tables, columns, indexes, and foreign keys on any Laravel-supported driver
- ๐งฉ Pluggable indexers & schema extractors โ extend the Search tool from your own app, no fork needed
- ๐ Safe by default โ write queries (INSERT/UPDATE/DELETE) are disabled until explicitly enabled
- ๐ญ Optional Spatie Permission integration โ auto-detected, zero hard dependency
- ๐งช Fully tested โ Pest + Testbench, Docker matrix, CI
Documentation
Full documentation is available at GomdimApps.github.io/LaravelMCPilot
Key sections:
Docker Testing
make test-8.3 # or test-8.4 / test-8.5 make test-all # runs all three
License
MIT.