LABSCO SUMMARY
Structure queries where vector search would burn tokens guessing.
The argument the README makes is specific and correct: searching code semantically costs a lot of tokens and still misses the full picture for routes and views, which are defined by framework conventions rather than by text. Asking "which routes use this controller" or "which models use this trait" returns a complete answer here and an approximate one from a file search. Being a dev dependency also means it disappears in production, which is where you want it.
What it is
An artisan command that serves your Laravel application's structure over MCP, built on the laravel-introspect package. It answers questions about what exists and how it connects, including code that lives inside installed packages.
What you get
- Views queried by name, path, which views use them, which views they use, and what they extend
- Routes queried by name, URI, controller and method, HTTP methods and middleware
- Classes queried by name or namespace, by the parent they extend, the interfaces they implement and the traits they use
- Models additionally queried by relationships, properties, casts, fillable and hidden fields, and read or write access
- Wildcard matching on names and several other filters, so components.*.paragraph is a single query
- Results include things defined in Laravel packages, which a file search over your own source would miss
Requirements
A Laravel application and Composer — installed as a dev dependency with composer require mateffy/laravel-codebase-mcp --dev. The client runs it as php /path/to/your/codebase/artisan introspect:mcp. The README notes a dependency conflict between php-mcp/server and ReactPHP that may need patched forks added to composer.json, and describes the server as still in beta.
Setup effort
One command — composer require mateffy/laravel-codebase-mcp --dev
USE CASES
01
Giving the assistant your data model
Models come back with relationships, casts and fillable fields rather than as files to read.
02
Checking a view is safe to change
Query which views use it and which it extends before touching anything.
03
Finding every route behind a controller
Routes are filterable by controller and method, including ones registered by packages.
04
Auditing middleware coverage
Filter routes by middleware to see which ones are missing it.
INSTALLATION
Connect your client
Server setup
TERMINAL
composer require mateffy/laravel-codebase-mcp --devMCP Clients
Any MCP client
ANY MCP CLIENT · JSON
{
"mcpServers": {
"laravel-introspect": {
"command": "php",
"args": [
"<YOUR_PATH_TO_CODEBASE_ARTISAN>",
"introspect:mcp"
]
}
}
}