«

Setting Up Laravel Boost with Claude Code

Written by Jorge on 
5 minute read

Claude Code is already fast. Point it at a Laravel project and it can read files, run tests, execute commands. But it's working blind. It doesn't know your routes, your database schema, or what's in your logs until it goes digging through files. That's where Laravel Boost comes in.

Boost exposes your Laravel application's internals as MCP tools. Routes, models, schema, logs, tinker, all available to Claude Code without it having to parse files or guess. The difference is immediate: instead of Claude Code grep-ing through your route files, it just knows your routes.

If you haven't read it yet, my post on What is Laravel Boost and Why Every Laravel Dev Needs It covers what Boost does and why it matters. This post focuses on the hands-on setup with Claude Code.

Installing Boost

Require it as a dev dependency and run the interactive installer:

composer require laravel/boost --dev
php artisan boost:install

The installer auto-detects your IDE and AI agents, then generates the necessary configuration files: .mcp.json for MCP-compatible editors and guideline files (CLAUDE.md, AGENTS.md) for AI context.

If you want to customize behavior, Boost generates a boost.json in your project root.

Configuring Claude Code

Boost registers itself with Claude Code automatically during boost:install. After installation, start a Claude Code session from your project root and verify:

claude mcp list

You should see laravel-boost in the output. If it doesn't appear, register it manually:

claude mcp add -s local -t stdio laravel-boost php artisan boost:mcp

Or add it directly to your project's .mcp.json:

{
  "mcpServers": {
    "laravel-boost": {
      "command": "php",
      "args": ["artisan", "boost:mcp"]
    }
  }
}

After adding the config, restart Claude Code or run /mcp to reload.

What Changes in Your Workflow

Before Boost, a typical interaction looked like this:

"Add a status scope to the Order model that filters by the status column."

Claude Code would read app/Models/Order.php, read the migration files to understand the schema, maybe check the routes to see how orders are used, then write the scope. Multiple file reads, sometimes wrong guesses about column types.

With Boost, Claude Code queries the schema tool first, gets the exact column definitions, and writes the scope in one shot. No file archaeology.

Querying the database

"How many orders were created in the last 7 days, grouped by status?"

Boost gives Claude Code a database query tool. It runs a read-only query through your application's database connection and returns results directly. No need to open Tinker yourself or write a throwaway script.

Checking routes

"What routes does the OrderController handle?"

Instead of parsing routes/web.php and routes/api.php and tracing through route groups, Boost returns the compiled route list, the same output as php artisan route:list, but structured as data Claude Code can reason about.

Reading logs

"What errors showed up in the last hour?"

Boost reads your Laravel log and returns recent entries. Useful when you're debugging a failing request and don't want to switch terminals.

Running Tinker expressions

"What does User::find(1)->roles look like?"

Boost can evaluate Tinker expressions and return the result. This is useful for exploratory debugging. Claude Code can inspect live data to understand relationships, check accessor output, or verify a fix.

Tips from Daily Usage

Scope your database access. If you're connecting Boost to a staging database, be mindful of what queries the agent runs. The database query tool is read-only by default, but large queries on big tables can still impact performance. Add limits where it matters.

Use it for onboarding. When jumping into an unfamiliar codebase, I ask Claude Code to describe the schema, list the routes, and show recent log activity. With Boost, this takes seconds instead of manually exploring the project structure.

Combine tools in one prompt. Claude Code can chain Boost tools in a single response. "Check the orders table schema, then write a migration to add a shipped_at timestamp." It'll query the schema, confirm the current columns, and generate a migration that fits.

Keep Boost updated. The package is actively developed and new tools land regularly. Run composer update laravel/boost periodically, then php artisan boost:install again to regenerate guideline files.

Common Gotchas

"Server not found" after adding config. Claude Code reads .mcp.json on startup. If you added it while Claude Code was running, restart the session or run /mcp to reload.

PHP version mismatch. Boost requires PHP 8.1+. If your system php points to an older version but your project uses Herd or Valet, specify the full path in your MCP config:

{
  "mcpServers": {
    "laravel-boost": {
      "command": "/Users/you/.config/herd/bin/php",
      "args": ["artisan", "boost:mcp"]
    }
  }
}

Database connection errors. Boost uses your app's default database connection. If your .env has DB_HOST=127.0.0.1 and your database runs on a socket, you'll get connection refused. This isn't a Boost problem. It's the same issue you'd hit running php artisan tinker. Fix your .env.

Artisan command not found. If php artisan boost:mcp fails, make sure you required the package with --dev and that your APP_ENV is set to local or testing. Boost registers its commands conditionally to avoid exposing tools in production.

Worth the Setup

The initial setup takes two commands. The payoff is every interaction after that. Claude Code goes from "smart assistant that reads files" to "assistant that understands your application." Schema-aware refactoring, log-driven debugging, live data inspection, all without leaving your terminal.

If you're already using Claude Code with Laravel, adding Boost is the highest-impact improvement you can make to that workflow. And if you want to go further and build your own MCP server for your app, check out my post on Building an MCP Server with Laravel.

Thanks for reading, and see you in the next one.

Copyright 2026. All rights reserved
  • Codepen Logo
  • Youtube Logo
  • GitHub Logo
  • Twitter Logo
  • LinkedIn Logo