Introspects Laravel codebases to provide structured information about views, routes, classes, and models using the mateffy/laravel-introspect package.
For AIs to make sense of your codebase, they need to be able to know what's in it. While vector search is a powerful tool for searching through code, it uses a lot of tokens and doesn't even give you the full picture of your codebase for things like views or routes. This package implements a Model Context Protocol (MCP) server for the mateffy/laravel-introspect package, which allows you to introspect your codebase and get structured information about it.
*
) to match multiple views, routes, classes and modelsQuery | Available Filters |
---|---|
Views | name, path, used by view, uses view, extends |
Routes | name, URI, controller + fn, methods, middleware |
Classes | name / namespace, extends parent, implements interfaces, uses traits |
โคท Models | ... relationships, properties, casts, fillable, hidden, read/writeable |
โคท Commands | ... signature, description (coming soon) |
Name and a few other queries even support wildcard queries (e.g.
components.*.paragraph
)
If you use AI tools like Aider, Cursor, Windsurf or Claude Code to help you build your app, this package is for you. Simply configure the MCP server in your agent and it can automatically query your codebase for views, routes, classes and models.
This is especially useful for large codebases where just searching through the code is less practical.
laravel-codebase-mcp
vs. laravel-introspect
The MCP server uses the laravel-introspect
package to introspect your codebase and get structured information about it.
If you want to write tests or run the same queries multiple times, you can also just use the package directly.
Install the package via composer:
composer require mateffy/laravel-codebase-mcp --dev
[!NOTE]
At the moment, there is a dependency issue with
php-mcp/server
(#23) and ReactPHP (#542). You may temporarily need to use these patched forks if you run into issues when installinglaravel-codebase-mcp
by adding the following to yourcomposer.json
:{ "repositories": [ { "type": "vcs", "url": "https://github.com/leantime/php-mcp-server.git" }, { "type": "vcs", "url": "https://github.com/Leantime/reactphp-http.git" } ] }
And then add it to your AI agent's MCP configuration:
{
"mcpServers": {
"laravel-introspect": {
"command": "php",
"args": [
"/path/to/your/codebase/artisan",
"introspect:mcp"
]
}
}
}
[!IMPORTANT]
The MCP server is still in beta, there will probably be bugs!
If you want to see all available queries, please check the laravel-introspect
package documentation.
The MCP server uses the php-mcp/server package to implement the MCP protocol.
The MIT License (MIT). Please see License File for more information.
Performs data enrichment on observables using third-party services via the security-cli Python package.
Interact with the Moralis Web3 API to access blockchain data across multiple networks through a structured interface.
Query the BuiltWith API to discover the technology stacks of websites. Requires a BuiltWith API key.
Programmatically access and parse NOAA Electronic Navigational Charts (ENC) in S-57 format.
A server for solving combinatorial, convex, integer, and non-linear optimization problems.
Server for advanced AI-driven video editing, semantic search, multilingual transcription, generative media, voice cloning, and content moderation.
Interact with the CODING DevOps platform for managing projects and work items.
A diagram generation server supporting multiple UML and other diagram types, with various output formats. It integrates with rendering services like Kroki and PlantUML.
An autonomous agent that integrates large language models with ParaView for creating and manipulating scientific visualizations using natural language and visual inputs.
Access comprehensive documentation for Ant Design components, including examples, API references, and best practices.