PHPackages                             hasanhawary/laravel-project-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. hasanhawary/laravel-project-mcp

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

hasanhawary/laravel-project-mcp
===============================

Project-aware MCP tools for Laravel applications that complement Laravel Boost.

0.1.0(1mo ago)10MITPHPPHP &gt;=8.1 &lt;8.6

Since Jun 5Pushed 1mo agoCompare

[ Source](https://github.com/hasanhawary/laravel-project-mcp)[ Packagist](https://packagist.org/packages/hasanhawary/laravel-project-mcp)[ Docs](https://github.com/hasanhawary/laravel-project-mcp)[ RSS](/packages/hasanhawary-laravel-project-mcp/feed)WikiDiscussions main Synced 1w ago

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

Laravel Project MCP
===================

[](#laravel-project-mcp)

[![Latest Version on Packagist](https://camo.githubusercontent.com/55d04e48871bed4336a3fd94da3dd0bf21590aaa83fb024d50982214d1debdb9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f686173616e6861776172792f6c61726176656c2d70726f6a6563742d6d63702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/hasanhawary/laravel-project-mcp)[![Total Downloads](https://camo.githubusercontent.com/5ec388fc80aa521292cab687e03589fe650dafeba6108602031a103d6175f985/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f686173616e6861776172792f6c61726176656c2d70726f6a6563742d6d63702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/hasanhawary/laravel-project-mcp)[![License](https://camo.githubusercontent.com/c33b745a3897351b445b55feb28b43eb7d041520193b9af75607d3a53652077d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f686173616e6861776172792f6c61726176656c2d70726f6a6563742d6d63702e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![PHP Version](https://camo.githubusercontent.com/520c3f454185deedcfbebd1d9f3f6966c532cb178ae3aefa3defe598acac6af6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f686173616e6861776172792f6c61726176656c2d70726f6a6563742d6d63702e7376673f7374796c653d666c61742d737175617265)](composer.json)[![Laravel](https://camo.githubusercontent.com/49c14d048bb20caa5cf1d3d569ecb99b5ea1cdf3255d5844fa2f0f62b582d92d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31302d2d31332d7265642e7376673f7374796c653d666c61742d737175617265)](composer.json)

Laravel Project MCP adds project-aware Model Context Protocol tools to Laravel applications. It discovers the installed application's Eloquent models, configured business entities, and schema so AI agents can understand the project domain without hardcoded, app-specific assumptions.

Use Laravel Boost for framework documentation, raw schema, routes, logs, and config. Use Laravel Project MCP for live business context, model-backed entity discovery, operational summaries, workflow dry-runs, and custom project tools.

Contents
--------

[](#contents)

- [Features](#features)
- [Requirements](#requirements)
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
- [MCP Server](#mcp-server)
- [Available Tools](#available-tools)
- [Custom Tools](#custom-tools)
- [Security](#security)
- [Testing](#testing)
- [Publishing](#publishing)
- [Changelog](#changelog)
- [Credits](#credits)
- [License](#license)

Features
--------

[](#features)

- Auto-discovered Laravel package service provider.
- Dynamic Eloquent model discovery from configurable model paths.
- Configurable business entities, modules, status columns, sensitive columns, export tables, and permission tables.
- Optional Laravel MCP web and local server registration.
- Business overview, metrics, entity lookup, app health, error impact, exports, permissions, workflows, and agent context tools.
- Read/write/destructive/system risk profiles.
- Safe-by-default behavior with write, destructive, and system tools disabled unless explicitly enabled.
- Sensitive value masking for arguments, tool output, errors, and audit logs.
- Output limiting to protect MCP clients from oversized responses.
- Optional database audit logging for tool calls.
- Custom project tools under `app/MCP/Tools`.
- Generated tool extension point under `app/MCP/Tools/Generated`.

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

[](#requirements)

- PHP `8.1`, `8.2`, `8.3`, `8.4`, or `8.5`
- Laravel `13.x` components
- Optional `laravel/mcp` to expose web/local MCP servers
- Optional `laravel/boost` for complementary Laravel agent tools

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

[](#installation)

Install the package via Composer:

```
composer require hasanhawary/laravel-project-mcp
```

Publish the package configuration and migration:

```
php artisan project-mcp:install
```

Run migrations:

```
php artisan migrate
```

Check the installation:

```
php artisan project-mcp:doctor
```

The install command publishes or prepares:

PathPurpose`config/project-mcp.php`Package configuration`database/migrations/*_create_project_mcp_tool_calls_table.php`Optional audit log table`app/MCP/Tools`Custom project tools`app/MCP/Tools/Generated`Generated tool extension point`app/MCP/Workflows`Project workflow definitions`app/MCP/Policies`Project MCP policy extension pointYou may also publish files manually:

```
php artisan vendor:publish --tag=project-mcp-config
php artisan vendor:publish --tag=project-mcp-migrations
```

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

[](#configuration)

The package is configured in `config/project-mcp.php`.

Common environment variables:

```
PROJECT_MCP_ENABLED=true
PROJECT_MCP_PROFILE=developer
PROJECT_MCP_FULL_ACCESS=false
PROJECT_MCP_ALLOW_WRITE=false
PROJECT_MCP_ALLOW_DESTRUCTIVE=false
PROJECT_MCP_ALLOW_SYSTEM=false
PROJECT_MCP_HTTP_ENABLED=false
PROJECT_MCP_SERVER_ENABLED=true
PROJECT_MCP_WEB_PATH=mcp/project
PROJECT_MCP_LOCAL_HANDLE=project-mcp
```

By default, business entities are discovered from Eloquent models in `app/Models`:

```
'business_model_paths' => [
    app_path('Models'),
],
```

If your application keeps models in modules or packages, add those paths:

```
'business_model_paths' => [
    app_path('Models'),
    base_path('modules/Billing/Models'),
    base_path('modules/CRM/Models'),
],
```

You can override entity discovery explicitly:

```
'searchable_business_entities' => [
    'customers' => 'customers',
    'invoices' => ['table' => 'billing_invoices'],
],
```

You can tune discovery and safety rules:

```
'business_entity_excluded_tables' => [
    'migrations',
    'jobs',
    'sessions',
    'personal_access_tokens',
],

'business_entity_search_columns' => [
    'name',
    'title',
    'email',
    'slug',
    'code',
    'status',
    'state',
    'type',
    'description',
],

'business_entity_sensitive_columns' => [
    'password',
    'remember_token',
    'token',
    'api_token',
    'secret',
    'private_key',
    'otp',
],
```

Usage
-----

[](#usage)

List registered tools:

```
php artisan project-mcp:list-tools
```

Run a tool from the command line:

```
php artisan project-mcp:test-tool business_overview
```

Run a tool with JSON arguments:

```
php artisan project-mcp:test-tool business_entity_lookup '{"query":"acme","limit":5}'
```

Generate and inspect the project map:

```
php artisan project-mcp:scan
```

Show current package capabilities:

```
php artisan project-mcp:capabilities
```

Review audited tool calls:

```
php artisan project-mcp:audit
```

MCP Server
----------

[](#mcp-server)

If `laravel/mcp` is installed, Laravel Project MCP can register both web and local MCP servers.

Default server settings:

SettingDefaultWeb MCP path`mcp/project`Local MCP handle`project-mcp`MCP middleware`[]`Inspect the web server:

```
php artisan mcp:inspector mcp/project
```

Inspect the local server:

```
php artisan mcp:inspector project-mcp
```

If you expose the web MCP server publicly, protect it with middleware:

```
'mcp_middleware' => ['auth:sanctum'],
```

Available Tools
---------------

[](#available-tools)

ToolGroupPurpose`business_overview``business`Summarizes detected modules, model-backed entities, counts, status totals, and recent activity`business_metric_summary``business`Returns dynamic entity totals, created-today counts, failed counts, and open counts`business_module_health``business`Reports detected/configured business module availability`business_entity_lookup``entities`Searches safe text columns across configured or detected entities`project_capabilities``agent_context`Explains registered tools, risk flags, Boost integration, and discovered app context`app_health_plus``diagnostics_plus`Summarizes queue health and detected entity status health`error_impact_summary``diagnostics_plus`Summarizes failed jobs and failed/error-like entity statuses`export_status``exports`Reports export table status when export tables are configured or detected`user_access_summary``permissions`Summarizes role/permission assignments when permission tables are configured`workflow_dry_run``workflows`Validates configured workflows without executing themTool definitions include input schemas, risk levels, groups, source, and Laravel Boost overlap metadata.

Custom Tools
------------

[](#custom-tools)

Create a custom tool:

```
php artisan project-mcp:make-tool CustomerRiskTool
```

Custom tools are written to `app/MCP/Tools` and extend `LaravelProjectMcp\Tools\AbstractProjectMcpTool`:

```
