Labsco
MCP SERVER

Laravel Codebase Introspection

by Capevace

Query a Laravel codebase structurally — views, routes, classes and models with their relationships — instead of making the agent read through it.

Code Intelligence & Repository Indexing
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