// docs

MCP server for AI tools

Let Claude, Codex, and Cursor read your Laravel projects and run code in them through LaraBench, with production off by default and every write kept in view.

LaraBench can act as an MCP server, so AI coding tools can work with your Laravel projects directly instead of you copying snippets and output back and forth. An AI tool can see your connections, saved library, run history, and logs, and — if you allow it — run Tinker snippets and Artisan commands in the real app context.

Reading is free on any plan. Running code and saving to your library need Premium. The server itself is free and on by default, so browsing your library from an AI tool never requires an upgrade.

The MCP Server page: every tool AI clients can call, what each one needs, and the connections you have exposed.

The tools an AI client can call

Eight tools cover the whole surface — four reads, free on any plan, and four writes that need Premium.

  • list_connections (free): see which projects LaraBench can reach, and how much of each is exposed.
  • list_saved_items (free): browse saved snippets and Artisan commands by folder, tag, or search.
  • get_run_history (free): read recent runs with their output, exit codes, and query counts.
  • read_logs (free): list and read Laravel log files, filtered by level.
  • run_snippet (Premium): run a Tinker snippet in your app context and get back output and query analysis.
  • run_artisan (Premium): run an Artisan command against a connection.
  • run_saved_item (Premium): run something from your library, filling in any {placeholder} values it needs.
  • save_snippet (Premium): save a snippet or Artisan command back to your library for next time.

Turning it on

Open the MCP Server page in LaraBench, in the same rail group as Batch Runs. The server is on by default, listening only on a local socket restricted to your own user account. The toggle at the top of Connect a tool switches it off entirely if you would rather nothing listened.

Connecting an AI tool

On the MCP Server page, click the button for the tool you use. LaraBench writes itself into that tool's own MCP configuration and leaves every other server already configured there untouched. Restart the tool afterwards to pick up the change.

  • Claude Code: one click updates both Claude Code and Claude Desktop, since they read the same kind of config on your machine. Restart whichever one you use.
  • Codex: one click writes LaraBench into Codex's own config file alongside anything else you already have configured there.
  • Cursor: one click adds LaraBench to Cursor's MCP configuration.

For any other MCP-compatible client, Show config on the MCP Server page prints the exact JSON block to paste in by hand. The command it points at is the LaraBench app itself with an --mcp-stdio flag, so nothing extra needs installing.

How much each project is exposed

Every connection has an AI access level you set on the MCP Server page, independent of anything else in LaraBench:

  • Off: hidden from AI tools entirely. Production connections start here, and turning one on asks you to confirm first.
  • Read only: run history and logs are readable, but no code runs. Use this for a connection you want an AI tool to have context on without ever executing anything there.
  • Dry run: code runs for real, in a database transaction that is always rolled back, and schema changes are blocked outright. This is the default for local and staging connections. It is a database guard, not a full sandbox — HTTP calls, file writes, and mail your snippet triggers still happen for real.
  • Full: code runs normally and writes stick. Never the default; you choose it deliberately per connection.

Safety

The posture is the opposite of "review the code before you run it": production is unreachable until you say otherwise, and even once reachable, a write still waits for a human.

  • Production connections are hidden until you opt them in, and opting in asks for confirmation in the app.
  • A connection set to Dry run cannot be talked out of it by anything an AI tool sends. Asking to skip the rollback still runs with writes suppressed.
  • Artisan commands cannot be dry run — there is no transaction to wrap them in — so a connection needs Full access before Artisan will run through MCP at all.
  • A write against a Full production connection stops and shows a confirmation inside LaraBench before it executes. If the app is closed, the answer is no; nothing runs unattended.
  • Every run an AI tool makes is recorded in History with an AI badge, the same place your own runs land.
  • Connection details never leave the app: hostnames, SSH users, container names, and key paths are never sent to an AI tool, only the connection's name and how it's exposed.