PHPackages                             0xmergen/lmad - 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. [API Development](/categories/api)
4. /
5. 0xmergen/lmad

ActiveLibrary[API Development](/categories/api)

0xmergen/lmad
=============

LMAD - Laravel MCP API Discovery Package

v0.1.0(3mo ago)26MITPHPPHP ^8.2

Since Jan 29Pushed 3mo agoCompare

[ Source](https://github.com/0xmergen/lmad)[ Packagist](https://packagist.org/packages/0xmergen/lmad)[ RSS](/packages/0xmergen-lmad/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

 [![LMAD - Laravel MCP API Discovery](docs/banner.jpg)](docs/banner.jpg)

LMAD - Laravel MCP API Discovery
================================

[](#lmad---laravel-mcp-api-discovery)

A Laravel 12 MCP (Model Context Protocol) package that provides AI agents with comprehensive API discovery and analysis capabilities. LMAD enables AI coding assistants to understand your Laravel application's API structure, validation rules, and response schemas.

Features
--------

[](#features)

- **Route Discovery**: List and filter API routes by path, HTTP method, domain, and vendor exclusion
- **Controller Inspection**: Get detailed controller method information including file paths and line numbers
- **Request Validation Analysis**: Parse FormRequest validation rules, custom error messages, and authorization logic
- **Response Schema Analysis**: Analyze controller return types, JsonResource structures, and Model attributes
- **Complete Endpoint Analysis**: Get comprehensive information about any endpoint in a single call
- **Dynamic Resources**: Access controller and route information via MCP URI templates

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

[](#requirements)

- **PHP**: 8.2 or higher
- **Laravel**: 12.x
- **laravel/mcp**: 0.5.x or higher

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

[](#installation)

```
composer require 0xmergen/lmad
```

The package will automatically register its service provider.

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

[](#configuration)

### Publish the Routes File (Optional)

[](#publish-the-routes-file-optional)

If you want to customize the MCP server registration:

```
php artisan vendor:publish --tag=lmad-routes
```

This publishes the MCP routes to `routes/lmad.php`.

### MCP Server Registration

[](#mcp-server-registration)

The LMAD MCP server is automatically registered in your application via the package's `routes/ai.php` file:

```
use Laravel\Mcp\Facades\Mcp;
use Lmad\Mcp\LmadServer;

Mcp::local('lmad', LmadServer::class);
```

Available MCP Tools
-------------------

[](#available-mcp-tools)

ToolDescription`list_api_routes`List all API routes with optional filters for path, method, domain, and vendor routes`get_route_details`Get detailed information about a specific route including controller, middleware, and file locations`get_request_rules`Parse FormRequest validation rules, custom error messages, and authorization logic`get_response_schema`Analyze what an endpoint returns (JsonResource, Model, array, JsonResponse)`analyze_endpoint`Complete endpoint analysis combining route, controller, request, and response informationAvailable MCP Resources
-----------------------

[](#available-mcp-resources)

ResourceURI TemplateDescription`api_routes``route://{uri}`Dynamic access to API routes`controller``controller://{class}/{method?}`Controller and method information---

Claude Code Setup Guide
-----------------------

[](#claude-code-setup-guide)

### Step 1: Verify MCP Server

[](#step-1-verify-mcp-server)

Start your Laravel development server:

```
composer run dev
```

### Step 2: Configure Claude Code

[](#step-2-configure-claude-code)

Create or edit your Claude Code MCP configuration file to connect to the LMAD server.

**For local MCP server via stdio:**

Add to your Claude Desktop config (`~/.claude_desktop_config.json` on macOS/Linux):

```
{
  "mcpServers": {
    "lmad": {
      "command": "php",
      "args": [
        "/path/to/your/lmad/project/artisan",
        "mcp:serve",
        "--server=lmad"
      ],
      "env": {
        "APP_ENV": "local"
      }
    }
  }
}
```

**For HTTP-based MCP server:**

```
{
  "mcpServers": {
    "lmad": {
      "url": "http://localhost:8000/mcp/lmad"
    }
  }
}
```

### Step 3: Restart Claude Code

[](#step-3-restart-claude-code)

Restart Claude Desktop or reload your IDE extension to activate the MCP server.

### Step 4: Verify Connection

[](#step-4-verify-connection)

Ask Claude Code:

```
List all available MCP tools and resources.

```

You should see LMAD tools like `list_api_routes`, `get_route_details`, etc.

### Example Usage in Claude Code

[](#example-usage-in-claude-code)

```
Get all CRM API routes:
Use list_api_routes with path filter "api/crm"

Analyze the companies endpoint:
Use analyze_endpoint for URI "api/crm/companies" with method "GET"

Get validation rules for company creation:
Use get_request_rules for "App\Http\Requests\Crm\Company\StoreRequest"

```

---

Cline (VS Code) Setup Guide
---------------------------

[](#cline-vs-code-setup-guide)

### Step 1: Install Cline Extension

[](#step-1-install-cline-extension)

Install the [Cline extension](https://marketplace.visualstudio.com/items?itemName=saoudrizwan.cline) from the VS Code Marketplace.

### Step 2: Configure MCP Server in Cline

[](#step-2-configure-mcp-server-in-cline)

1. Open VS Code Settings
2. Search for "Cline: MCP Servers"
3. Add the LMAD server configuration:

**For stdio connection:**

```
{
  "lmad": {
    "command": "php",
    "args": [
      "/absolute/path/to/your/lmad/project/artisan",
      "mcp:serve",
      "--server=lmad"
    ],
    "env": {
      "APP_ENV": "local",
      "LARAVEL_ROOT": "/absolute/path/to/your/lmad/project"
    }
  }
}
```

**For HTTP connection:**

```
{
  "lmad": {
    "url": "http://localhost:8000/mcp/lmad",
    "headers": {
      "Accept": "application/json"
    }
  }
}
```

### Step 3: Start Laravel Server

[](#step-3-start-laravel-server)

```
cd /path/to/your/lmad/project
composer run dev
```

### Step 4: Reload VS Code

[](#step-4-reload-vs-code)

Reload the VS Code window to activate the MCP server connection.

### Step 5: Test the Connection

[](#step-5-test-the-connection)

In Cline chat, ask:

```
What MCP tools are available?

```

You should see LMAD tools listed.

### Example Usage in Cline

[](#example-usage-in-cline)

```
I need to understand the CRM API. Can you:
1. List all routes under "api/crm"
2. Get details for the companies store endpoint
3. Show me the validation rules for creating a company

```

Cline will use the LMAD MCP tools to gather this information.

---

Development
-----------

[](#development)

### Running Tests

[](#running-tests)

```
composer test
```

### Code Formatting

[](#code-formatting)

```
composer pint
```

### MCP Inspector

[](#mcp-inspector)

Laravel MCP provides an inspector tool for testing MCP servers:

```
php artisan mcp:inspector lmad
```

License
-------

[](#license)

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

Author
------

[](#author)

**0xmergen**

- GitHub: [@0xmergen](https://github.com/0xmergen)
- X: [@0xm3rg3n](https://x.com/0xm3rg3n)

Support
-------

[](#support)

For issues, questions, or contributions, please visit the [GitHub repository](https://github.com/0xmergen/lmad).

###  Health Score

36

—

LowBetter than 81% of packages

Maintenance86

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

99d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9d024b6f776c6c743283743009462e7b7d4e6d52d44ade38fa4103e792d57ee4?d=identicon)[0xmergen](/maintainers/0xmergen)

---

Top Contributors

[![0xmergen](https://avatars.githubusercontent.com/u/36132897?v=4)](https://github.com/0xmergen "0xmergen (2 commits)")

---

Tags

apilaravelmcpdiscoverylmad

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/0xmergen-lmad/health.svg)

```
[![Health](https://phpackages.com/badges/0xmergen-lmad/health.svg)](https://phpackages.com/packages/0xmergen-lmad)
```

###  Alternatives

[mollie/laravel-mollie

Mollie API client wrapper for Laravel &amp; Mollie Connect provider for Laravel Socialite

3624.1M28](/packages/mollie-laravel-mollie)[api-ecosystem-for-laravel/dingo-api

A RESTful API package for the Laravel and Lumen frameworks.

3121.5M10](/packages/api-ecosystem-for-laravel-dingo-api)[smodav/mpesa

M-Pesa API implementation

16363.7k1](/packages/smodav-mpesa)[specialtactics/l5-api

Dependencies for the Laravel API Boilerplate package

3672.8k2](/packages/specialtactics-l5-api)

PHPackages © 2026

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