StackMCP
Blog
·7 min read

Best MCP Servers for Laravel PHP Development in 2026

The best MCP servers for Laravel — MySQL for Eloquent, Docker for Sail, Redis for queues, Context7 for docs, and GitHub for code review.

mcplaravelphpmysqlredis

Laravel is convention-heavy and moves fast -- Laravel 11 restructured the application skeleton, and features like Precognition, Folio, and Volt keep changing how apps are built. AI assistants often suggest raw PHP where a facade exists, use deprecated syntax, or miss where files should live. MCP servers fix this by connecting your assistant to your actual MySQL database, Docker containers, Redis instance, current docs, and GitHub workflow.

Server Author Tools Tokens Key Use
MySQL MCP Community 6 ~2,800 Eloquent debugging, schema inspection
Docker MCP Docker 14 ~5,400 Laravel Sail containers, service health
Context7 MCP Upstash 2 ~1,030 Laravel 11 docs, Livewire, packages
GitHub MCP Anthropic 20 ~8,200 PRs, CI with PHPUnit and Pint
Redis MCP Redis 8 ~3,200 Queues, cache, sessions
graph LR
    A[Your Editor] --> B[AI Assistant]
    B --> C[MySQL MCP]
    B --> D[Docker MCP]
    B --> E[Context7 MCP]
    B --> F[GitHub MCP]
    B --> G[Redis MCP]
    C --> H[MySQL]
    D --> I[Sail Containers]
    E --> J[Laravel Docs]
    F --> K[GitHub API]
    G --> L[Redis]

MySQL MCP -- See What Eloquent Actually Sees

Author: Community | Tools: 6 | Requires: MySQL credentials

Six tools for executing SQL queries, inspecting schemas, listing tables, and describing table structure including columns, indexes, and constraints. The assistant sees the real database state rather than inferring it from Eloquent models and migration files. For a comparison of database servers, see Postgres vs SQLite vs MySQL MCP.

Why use it

  • Query the actual category_product pivot table to diagnose belongsToMany relationship issues instead of reading migration files
  • Compare the live schema with your migration history to identify drift from manual changes or partial rollbacks
  • Run EXPLAIN on Eloquent-generated SQL to identify missing indexes
  • Debug unexpected query results by inspecting actual column names and foreign keys

Configuration

{
  "mcpServers": {
    "mysql": {
      "command": "npx",
      "args": ["-y", "mysql-mcp"],
      "env": {
        "MYSQL_HOST": "127.0.0.1",
        "MYSQL_USER": "sail",
        "MYSQL_PASSWORD": "password",
        "MYSQL_DATABASE": "laravel"
      }
    }
  }
}

Adjust credentials to match your docker-compose.yml or .env. These are the defaults for Laravel Sail.

Docker MCP -- Laravel Sail Without Switching Windows

Author: Docker | Tools: 14 | Setup: Zero-config (npx)

Fourteen tools for managing containers, images, volumes, and networks. Sail typically runs MySQL, Redis, Mailpit, and possibly MinIO, Selenium, or other services. Docker MCP lets your assistant check if everything is healthy and read logs when it is not.

Why use it

  • Diagnose Redis connection failures by checking container status and logs in one step
  • Verify a new service (like Meilisearch) is accessible from your application container after adding it to Sail
  • Inspect running containers to understand the current Docker setup for production Dockerfile improvements
  • Troubleshoot queue worker issues by reading Sidekiq or Horizon container logs

Configuration

{
  "mcpServers": {
    "docker": {
      "command": "npx",
      "args": ["-y", "docker-mcp"]
    }
  }
}

No credentials needed. Communicates with the local Docker daemon that Sail uses.

Context7 MCP -- Laravel Docs for the Version You Actually Use

Author: Upstash | Tools: 2 | Setup: Zero-config (npx)

Two tools: library resolution and documentation querying. Context7 indexes Laravel, Livewire, Inertia.js, Filament, and other PHP ecosystem libraries. Laravel 11 moved bootstrapping from app/Http/Kernel.php to bootstrap/app.php -- an assistant without Context7 will almost certainly suggest the old Kernel approach.

Why use it

  • Get the new ->withMiddleware() method in bootstrap/app.php instead of the removed Kernel registration
  • Use correct Livewire 3 component syntax instead of the deprecated v2 patterns
  • Get accurate Spatie laravel-permission or Laravel Cashier installation steps for your installed version
  • Avoid mixing Eloquent methods from different Laravel versions

Configuration

{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp"]
    }
  }
}

At roughly 1,030 tokens, this is the lightest server in the stack and should be the first one every Laravel developer installs.

GitHub MCP -- Code Review and CI for Laravel Teams

Author: Anthropic | Tools: 20 | Requires: GitHub personal access token

Twenty tools for repositories, pull requests, issues, branches, GitHub Actions, and code search. For a deeper look, see the GitHub MCP guide. If your team uses GitLab, see the GitHub vs GitLab MCP comparison.

Why use it

  • Create comprehensive PRs describing Livewire components, migrations, and tests with full context
  • Retrieve PHPUnit failures and Pint style violations from GitHub Actions and fix them inline
  • Cross-reference failing tests with the actual database schema (via MySQL MCP) and current framework docs (via Context7)
  • Search across app/Models, app/Http/Controllers, database/migrations, and tests to find every file related to a feature

Configuration

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "your-github-token"
      }
    }
  }
}

Redis MCP -- Queues, Cache, and Sessions in View

Author: Redis | Tools: 8 | Requires: Redis connection URL

Eight tools for getting and setting keys, listing keys by pattern, running Redis commands, and monitoring your instance. Redis is the backbone of Laravel's async infrastructure -- queues, cache, sessions, rate limiting, and broadcasting all use it by default.

Why use it

  • Inspect queue keys (queues:default, queues:default:delayed, queues:default:reserved) to see how many jobs are waiting or stuck
  • Check whether a cache key exists, its TTL, and its stored value when cached views re-render on every request
  • Debug unexpected logouts by inspecting session keys in Redis
  • Verify rate limiting configuration is working correctly by checking Redis key patterns

Configuration

{
  "mcpServers": {
    "redis": {
      "command": "npx",
      "args": ["-y", "redis-mcp"],
      "env": {
        "REDIS_URL": "redis://localhost:6379"
      }
    }
  }
}

The default port for Laravel Sail's Redis container is 6379.


For the complete pre-configured stack, visit the Laravel PHP Stack. If you want to understand how to keep your server setup secure, see how to secure your MCP setup.

Related Stacks

Related Servers