Laravel MCP Server

Laravel MCP Server

Exposes Laravel development tools (artisan, migrations, config, schema, logs) as MCP tools for use with compatible clients.

Category
Visit Server

README

Laravel AI Development Agent

An MCP-powered autonomous development toolkit for Laravel projects.

Give Claude / OpenCode / Cursor a Laravel engineering brain.

A Model Context Protocol (MCP) server that makes your AI coding agent understand, generate and debug Laravel applications. Works with any MCP-compatible client: Claude Desktop, Cursor, Codex, OpenCode, and more.

Features

✅ Understand Laravel project structure — models, routes, migrations, packages, frontend — injected automatically

✅ Generate complete features — from a natural-language request to working CRUD, Blade views, and REST APIs

✅ Debug exceptions — locate the file, diagnose common Laravel errors, suggest fixes

✅ Generate REST APIs — migration, model, API controller, Sanctum-protected routes, tests

✅ Analyze database — schema, tables, columns, migrations, relationships

✅ Safe Artisan execution — command whitelist, dangerous commands blocked, sensitive data redacted

Demo

Once connected, ask your AI agent in any MCP-compatible client:

> Add a comment feature to the blog
→ intentPlanner: parsed as create_feature/Comment
→ createFeature: migration → model → controller → request → views → test
→ workflowStatus: run persisted to .mcp/runs/

> List the routes
→ routeList: 47 routes, filterable by name

> SQLSTATE[42P01] Table not found — how to fix?
→ debugWorkflow: locate + diagnose + suggest fixes

Tools

Tool Description
artisan Run any php artisan command (whitelist restricted)
migrateStatus Check migration status
envInfo Display APP_ENV, APP_DEBUG, DB connection
cache Clear/cache config, routes, views
configGet Inspect config values by key
schema List database tables, view column definitions
model Scan Eloquent models in app/Models
log Tail the Laravel log file
routeList List routes with optional name/URI/method filter
runTest Run PHPUnit tests with optional filter
envInfoSafe Read .env filtering out sensitive values
frontendScanner Scan resources/views, js, css structure
makeModel Create a new Eloquent model with optional migration/factory
makeController Create a controller with optional resource/api/model binding
makeMigration Create a new migration file
migrationAnalyzer Parse migrations and extract schema (columns, types, FKs)
composerAnalyzer List project dependencies with version info
projectContext Get comprehensive project context (version, models, routes, packages)
crudGenerator Generate full CRUD: migration, model, controller, request, route, test
createFeature Generate full feature: CRUD + Blade views
apiGenerator Generate REST API: migration, model, API controller, routes, tests
debugWorkflow Analyze an error: locate, diagnose, suggest fixes
intentPlanner Parse a natural-language dev request into an executable plan
workflowStatus List/inspect/resume/rollback workflow runs

Usage

Installation

# From npm (demo version)
npm install laravel-ai-agent@beta

# From GitHub (demo version)
npm install github:dok4everak47/laravel-ai-agent

With OpenCode

Add to ~/.config/opencode/opencode.jsonc:

{
  "mcpServers": {
    "laravel": {
      "type": "local",
      "command": ["node", "/path/to/laravel-ai-agent/dist/index.js"]
    }
  }
}

With Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "laravel": {
      "command": "node",
      "args": ["/path/to/laravel-ai-agent/dist/index.js"]
    }
  }
}

Environment Variables

Variable Default Description
LARAVEL_PROJECT_PATH process.cwd() Path to Laravel project
PHP_PATH php PHP executable path
LLM_API_KEY (empty) Enables the LLM semantic layer for intentPlanner (e.g. DeepSeek/OpenAI key)
LLM_BASE_URL https://api.deepseek.com/v1 OpenAI-compatible API base URL
LLM_MODEL deepseek-chat LLM model used for intent analysis

Requirements

  • Node.js 18+
  • PHP 8.1+ (for Laravel project interaction)
  • A Laravel project with artisan in its root

Development

npm install
npm run typecheck   # tsc --noEmit (type-check only)
npm test            # run all tests
npm run build       # compile to dist/
npm start           # node dist/index.js
npm run dev         # npx tsx src/index.ts (hot reload)

Security Model

✓ Local only — runs entirely on your machine, no server component ✓ No telemetry — sends zero usage data ✓ No external API by default — works fully offline; the LLM semantic layer only makes network calls when LLM_API_KEY is set ✓ Command whitelist — artisan restricted to safe commands ✓ Dangerous commands blocked — db:wipe, migrate:fresh, tinker, shell ✓ Sensitive data redaction — .env values filtered before returning

See SECURITY.md for details.

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured