PHPackages                             mateffy/laravel-codebase-mcp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mateffy/laravel-codebase-mcp

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mateffy/laravel-codebase-mcp
============================

An MCP server to give Cursor, Aider, etc. the ability to introspect your Laravel codebase directly, by querying for your models, views, routes and classes without raw file search.

0.1.0(10mo ago)201.1k2[2 PRs](https://github.com/Capevace/laravel-codebase-mcp/pulls)MITPHPPHP ^8.2CI passing

Since May 22Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/Capevace/laravel-codebase-mcp)[ Packagist](https://packagist.org/packages/mateffy/laravel-codebase-mcp)[ Docs](https://github.com/mateffy/laravel-codebase-mcp)[ GitHub Sponsors]()[ RSS](/packages/mateffy-laravel-codebase-mcp/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (14)Versions (6)Used By (0)

[![](./docs/header.png)](./docs/header.png)

[![Development Tests Status](https://camo.githubusercontent.com/26ea60f4fbf492d6521602b3e2764513070fd500932ecd99bda4e5c73c34971e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f63617065766163652f6c61726176656c2d696e74726f73706563742f72756e2d74657374732e796d6c3f6c6162656c3d6465762532307465737473)](https://camo.githubusercontent.com/26ea60f4fbf492d6521602b3e2764513070fd500932ecd99bda4e5c73c34971e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f63617065766163652f6c61726176656c2d696e74726f73706563742f72756e2d74657374732e796d6c3f6c6162656c3d6465762532307465737473)[![Latest Version](https://camo.githubusercontent.com/7f989aaab076f84ef9d62c35050c6e4b374321c53028e1fc1dc62f8c1f833992/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f7461672f63617065766163652f6c61726176656c2d636f6465626173652d6d63703f6c6162656c3d6c61746573742b76657273696f6e)](https://camo.githubusercontent.com/7f989aaab076f84ef9d62c35050c6e4b374321c53028e1fc1dc62f8c1f833992/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f7461672f63617065766163652f6c61726176656c2d636f6465626173652d6d63703f6c6162656c3d6c61746573742b76657273696f6e)[![GitHub Release Date](https://camo.githubusercontent.com/3a06eb164106b0123fe99e15c5a0e963f2b5399f52004cb1ca2d31a169d06c93/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652d646174652f63617065766163652f6c61726176656c2d636f6465626173652d6d63703f6c6162656c3d6c61737425323072656c656173652663616368655365636f6e64733d30)](https://camo.githubusercontent.com/3a06eb164106b0123fe99e15c5a0e963f2b5399f52004cb1ca2d31a169d06c93/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652d646174652f63617065766163652f6c61726176656c2d636f6465626173652d6d63703f6c6162656c3d6c61737425323072656c656173652663616368655365636f6e64733d30)

MCP Server for Laravel Codebase Intelligence and Introspection
==============================================================

[](#mcp-server-for-laravel-codebase-intelligence-and-introspection)

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](https://modelcontextprotocol.io) (MCP) server for the [mateffy/laravel-introspect](https://github.com/capevace/laravel-introspect) package, which allows you to introspect your codebase and get structured information about it.

- 🔍 Let AI query views, routes, classes and models without needing to read through all of the code
- 🔍 Can even use wildcards (`*`) to match multiple views, routes, classes and models
- 🔍 Supports querying for things from Laravel packages, which most file searchers can't do
- 🪄 Gives your AI quick overviews of your datamodel and its relationships
- 🤖 Supports any AI agent implementing the [MCP protocol](https://modelcontextprotocol.io)

QueryAvailable FiltersViewsname, path, used by view, uses view, extendsRoutesname, URI, controller + fn, methods, middlewareClassesname / 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`)

### Who is this for?

[](#who-is-this-for)

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.

#### Example tasks

[](#example-tasks)

- Give your AI an overview of your datamodel and its relationships
- Refactoring views and making sure it's not used anywhere else
- Finding all routes that use a specific controller
- Finding models that use a specific trait or interface
- Making sure all routes are using the correct middleware

### `laravel-codebase-mcp` vs. `laravel-introspect`

[](#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](https://github.com/capevace/laravel-introspect).

Installation
------------

[](#installation)

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](https://github.com/php-mcp/server/issues/23)) and ReactPHP ([\#542](https://github.com/reactphp/http/pull/542)). You may temporarily need to use these patched forks if you run into issues when installing `laravel-codebase-mcp` by adding the following to your `composer.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!

Available queries
-----------------

[](#available-queries)

If you want to see all available queries, please check the [`laravel-introspect` package documentation](https://github.com/capevace/laravel-introspect).

Acknowledgements
----------------

[](#acknowledgements)

The MCP server uses the [php-mcp/server](https://github.com/php-mcp/server) package to implement the MCP protocol.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance75

Regular maintenance activity

Popularity28

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~19 days

Total

3

Last Release

315d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e572442281b0c1b6e8e8f966cc908161a66c4c822e950ff278f8f90dc4f2d2cd?d=identicon)[mateffy](/maintainers/mateffy)

---

Top Contributors

[![Capevace](https://avatars.githubusercontent.com/u/10093858?v=4)](https://github.com/Capevace "Capevace (14 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

laravelmcpaicursorLukas Mateffylaravel-codebase-mcpmcp-server

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/mateffy-laravel-codebase-mcp/health.svg)

```
[![Health](https://phpackages.com/badges/mateffy-laravel-codebase-mcp/health.svg)](https://phpackages.com/packages/mateffy-laravel-codebase-mcp)
```

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.7k28.9M626](/packages/spatie-laravel-data)[maestroerror/laragent

Power of AI Agents in your Laravel project

630106.4k](/packages/maestroerror-laragent)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
