mcp-server-laravel
Provides tools for introspecting Laravel codebases: routes, models, controllers, migrations, scheduled tasks, events, middleware, and Artisan commands.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-server-laravellist all routes"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-server-laravel
Laravel Codebase MCP Server — introspect routes, models, controllers, migrations, and more through the Model Context Protocol. Works with any AI client that supports MCP: opencode, Claude Desktop, Cursor, and others.
Stop grepping your Laravel codebase. Let your AI assistant answer "what routes exist?", "show me the User model", or "list all migrations" instantly.
Quick Start
# Install
npx mcp-server-laravel-codebase
# Or clone
git clone git@github.com:rendi-febrian/mcp-server-laravel-codebase.git
cd mcp-server-laravel-codebase
npm install && npm run buildopencode Configuration
Add to ~/.config/opencode/opencode.json:
{
"mcp": {
"laravel-codebase": {
"type": "local",
"command": ["node", "/path/to/mcp-server-laravel/dist/index.js"],
"environment": {
"LARAVEL_PROJECT_PATH": "/path/to/your/laravel-project"
},
"enabled": true
}
}
}Claude Desktop / Cursor / Other MCP Clients
{
"mcpServers": {
"laravel-codebase": {
"command": "node",
"args": ["/path/to/mcp-server-laravel/dist/index.js"],
"env": {
"LARAVEL_PROJECT_PATH": "/path/to/your/laravel-project"
}
}
}
}Related MCP server: Laravel AI MCP Server
Features
Tools
Tool | Description | Example |
| All routes with method, URI, controller, middleware |
|
| All Eloquent models with paths and namespaces |
|
| Single model: columns, relations, casts, policies |
|
| Controllers with optional route mapping |
|
| Laravel version, env, packages, config |
|
| Migration status (ran/pending) |
|
| Scheduled tasks with frequency |
|
| Events and registered listeners |
|
| Middleware aliases with class names |
|
| All registered Artisan commands |
|
| Run read-only Artisan commands |
|
Resources
URI | Content |
| Application info (version, env, drivers) |
| Full route table as JSON |
Security
artisan_run is restricted to read-only commands:
route:list · model:show · about · migrate:status · schedule:list · event:list · middleware · db:show · db:table · config:show · queue:failed · package:discover
Write operations (migrate, make:*, db:wipe, etc.) are blocked.
Requirements
Node.js >= 18
PHP 8.1+ with
phpon PATHA Laravel project (Laravel 9/10/11/12/13)
Environment Variables
Variable | Required | Default | Description |
| Yes | — | Absolute path to Laravel project root |
| No |
| Path to PHP binary |
Switching Projects
Point LARAVEL_PROJECT_PATH at any Laravel project. No rebuild needed.
// Inspect FlightManagement API
"LARAVEL_PROJECT_PATH": "/home/user/Kerjaan/FlightManagement"
// Inspect admin panel
"LARAVEL_PROJECT_PATH": "/home/user/Projects/admin-panel"Architecture
src/
├── index.ts # MCP server entry point (raw Server)
├── artisan.ts # PHP exec wrapper + whitelist
├── scanner.ts # Laravel filesystem scanner
├── tools/
│ ├── routes.ts # routes_list, routes_cache, routes_clear
│ ├── models.ts # models_list, model_detail
│ ├── controllers.ts # controllers_list
│ ├── migrations.ts # migrations_list
│ ├── schedule.ts # schedule_list
│ ├── events.ts # events_list
│ ├── middleware.ts # middleware_list
│ ├── about.ts # app_about
│ ├── commands.ts # commands_list
│ └── artisan.ts # artisan_run
└── resources/
└── index.ts # laravel:// URIsNo external API calls — everything runs locally via php artisan commands and filesystem scanning.
Contributing
See CONTRIBUTING.md.
License
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceA Model Context Protocol server that analyzes application codebases with real-time file watching, providing AI assistants like Claude with deep insights into project structure, code patterns, and architecture.Last updatedMIT
- FlicenseAqualityDmaintenanceProvides AI assistants with direct access to Laravel documentation, coding rules, and implementation templates stored locally. It enables searching documentation, retrieving design system guides, and accessing domain-specific code examples to streamline Laravel development.Last updated8
- Alicense-qualityCmaintenanceEnables secure execution of Laravel Artisan commands through AI assistants, allowing controlled management of Laravel projects via natural language.Last updated6MIT
- AlicenseBqualityCmaintenanceEnables AI assistants to deeply interact with the PHP ecosystem, including runtime, static analysis, security scanning, testing, Composer, and frameworks like Laravel and Symfony. It exposes over 30 tools, 8 resources, and 7 prompts via MCP, allowing natural language commands to run PHP linting, static analysis, audits, tests, and project initialization.Last updated41MIT
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
A Model Context Protocol (MCP) application for automated GitHub PR analysis and issue management.…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/rendi-febrian/mcp-server-laravel-codebase'
If you have feedback or need assistance with the MCP directory API, please join our Discord server