PHPackages                             skylence/laravel-model-inspector-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. [Database &amp; ORM](/categories/database)
4. /
5. skylence/laravel-model-inspector-mcp

ActiveLibrary[Database &amp; ORM](/categories/database)

skylence/laravel-model-inspector-mcp
====================================

MCP server for Laravel model introspection — relationships, attributes, scopes, observers, and database schema

v1.2.0(1mo ago)04↓100%MITPHPPHP ^8.2

Since Mar 19Pushed 1mo agoCompare

[ Source](https://github.com/skylence-be/laravel-model-inspector-mcp)[ Packagist](https://packagist.org/packages/skylence/laravel-model-inspector-mcp)[ Docs](https://github.com/skylence-be/laravel-model-inspector-mcp)[ RSS](/packages/skylence-laravel-model-inspector-mcp/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (10)Versions (4)Used By (0)

Laravel Model Inspector MCP
===========================

[](#laravel-model-inspector-mcp)

An MCP (Model Context Protocol) server that gives AI coding assistants deep introspection into your Laravel application's Eloquent models, relationships, and database schema.

What it does
------------

[](#what-it-does)

Exposes four tools to any MCP-compatible client (Claude Code, Cursor, VS Code, PhpStorm, etc.):

ToolDescription`eloquent-list-models`List all Eloquent models with their tables and relationship counts. Auto-discovers models from Composer PSR-4 autoload paths.`eloquent-inspect-model`Inspect a model's columns, fillable/guarded, casts, relationships, scopes, observers, and policy.`eloquent-get-relationships`Map relationships for one or more models: types, foreign keys, pivot tables, morph types.`eloquent-get-table-schema`Get the database schema for a model or table: columns, types, indexes, and foreign keys.Models are auto-discovered from all Composer PSR-4 namespaces containing `Models` in the path — your app models and vendor package models are found automatically without configuration.

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 11 or 12
- `laravel/mcp` ^0.3.0 or ^0.5.0

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

[](#installation)

```
composer require skylence/laravel-model-inspector-mcp --dev
```

### Quick setup with the install command

[](#quick-setup-with-the-install-command)

```
php artisan model-inspector:install
```

This detects your IDE (Claude Code, Cursor, VS Code, PhpStorm) and configures the MCP server automatically.

### Manual setup

[](#manual-setup)

Add to your `.mcp.json` in the project root:

```
{
    "mcpServers": {
        "laravel-model-inspector-mcp": {
            "command": "php",
            "args": ["artisan", "model-inspector:mcp"]
        }
    }
}
```

If using Laravel Sail:

```
{
    "mcpServers": {
        "laravel-model-inspector-mcp": {
            "command": "./vendor/bin/sail",
            "args": ["artisan", "model-inspector:mcp"]
        }
    }
}
```

Restart your editor/AI tool to connect to the MCP server.

Configuration
-------------

[](#configuration)

Publish the config file (optional):

```
php artisan vendor:publish --tag=model-inspector-mcp-config
```

```
// config/model-inspector-mcp.php
return [
    // Disable specific tools
    'tools' => [
        'model-discovery' => true,
        'model-inspector' => true,
        'relationship-map' => true,
        'schema-inspector' => true,
    ],

    // Add paths for models outside standard PSR-4 "Models" directories
    'extra_model_paths' => [
        // 'packages/my-package/src/Entities',
    ],
];
```

Usage examples
--------------

[](#usage-examples)

Once connected, your AI assistant can use the tools automatically. You can also prompt it directly:

- *"List all models in this project"* — calls `eloquent-list-models`
- *"Show me the Order model's relationships"* — calls `eloquent-get-relationships`
- *"What columns does the sales\_orders table have?"* — calls `eloquent-get-table-schema`
- *"Inspect the Customer model"* — calls `eloquent-inspect-model`

Security
--------

[](#security)

MCP routes are only registered in `local` and `testing` environments. The MCP server runs over stdio and is not exposed over HTTP.

License
-------

[](#license)

MIT

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance89

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

3

Last Release

54d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8ad0eeb3e0f0183e243d7edf649313243750f8048918eb00c9c041c5dc379149?d=identicon)[skylence](/maintainers/skylence)

---

Top Contributors

[![jonasvanderhaegen](https://avatars.githubusercontent.com/u/7755555?v=4)](https://github.com/jonasvanderhaegen "jonasvanderhaegen (1 commits)")

---

Tags

laravelschemamcpmodeleloquentRelationshipsintrospection

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/skylence-laravel-model-inspector-mcp/health.svg)

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

###  Alternatives

[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)

PHPackages © 2026

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