Laravel Artisan MCP Server

A Model Context Protocol (MCP) server that enables secure execution of Laravel Artisan commands through Claude and other MCP clients.

Local serverstdioPython

What is the Laravel Artisan MCP server?

A Model Context Protocol (MCP) server that enables secure execution of Laravel Artisan commands through Claude and other MCP clients. That is what the laravel artisan mcp server brings to an AI assistant: the same capability, reachable through the Model Context Protocol rather than a separate app or dashboard.

The short version

  • Access a single directory containing a Laravel project
  • Automatically locate PHP on your system
  • Execute only whitelisted Artisan commands
  • View all available Artisan commands
  • Secure by design with robust input validation

The tools it exposes

The server publishes 2 tools. What each one is for:

  • run_artisan — The run_artisan tool exposed by this server
  • list_available_artisan_commands — Displays all available whitelisted Artisan commands in the Laravel application

What it needs from you

Configuration is passed through the environment: ARTISAN_DIRECTORY, WHITELISTED_COMMANDS. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

  • Python 3.10 or higher - Laravel project with Artisan CLI - PHP installed and accessible in your PATH - MCP-compatible client (such as Claude Desktop)

Getting it running

Setup follows the usual MCP pattern — install or clone the server, register it in your client's configuration file, restart the client. The configuration blocks on this page cover the common clients.

How it compares

Among the file and storage access options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Laravel Artisan's toolset — run_artisan, list_available_artisan_commands — is a fair guide to whether it matches your workflow. It is maintained by entanglr; worth a glance at recent repository activity before you build anything load-bearing on it.

This entry was verified against Laravel Artisan's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.

Things to watch

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

ToolWhat it does
run_artisanThe run_artisan tool exposed by this server.
list_available_artisan_commandsDisplays all available whitelisted Artisan commands in the Laravel application.

How to install the Laravel Artisan MCP server

{
     "mcpServers": {
       "laravel-artisan": {
         "command": "uv",
         "args": [
           "--directory", 
           "/absolute/path/to/laravel-artisan-mcp",
           "run", 
           "artisan_mcp_server.py"
         ],
         "env": {
           "ARTISAN_DIRECTORY": "/absolute/path/to/your/laravel/project",
           "WHITELISTED_COMMANDS": "route:list,cache:clear,make:controller"
         }
       }
     }
   }

Configuration as documented by the project. Restart the client after saving.

Configuration

  • Python 3.10 or higher - Laravel project with Artisan CLI - PHP installed and accessible in your PATH - MCP-compatible client (such as Claude Desktop)
VariableDescriptionRequired
ARTISAN_DIRECTORYFilesystem location the server is allowed to use.Optional
WHITELISTED_COMMANDSConfiguration value read at startup.Optional

Example prompts to try

  • Use Laravel Artisan to run artisan.
  • Use Laravel Artisan to list available artisan commands.

Frequently asked questions

The server will error with “ARTISAN_DIRECTORY must be provided in configuration”. Ensure the environment variable is set and the directory exists.