This repository provides a Model Context Protocol (MCP) server that securely executes whitelisted Laravel Artisan commands from AI assistants like Claude, bridging natural language conversations with local Laravel project management.
This project provides a Model Context Protocol (MCP) server, enabling secure execution of Laravel Artisan commands via AI assistants like Claude. It bridges AI and local Laravel applications, allowing project management through natural language.
Features: Access to a single Laravel project directory, automatic PHP location, whitelisted Artisan command execution, and command viewing, all secured with input validation.
Requirements: Python 3.10+, a Laravel project with Artisan CLI, PHP in PATH, and an MCP-compatible client.
Installation: Clone the repository, create a virtual environment using uv
, and install the mcp[cli]
dependency.
Configuration: Set ARTISAN_DIRECTORY
(Laravel project path) and WHITELISTED_COMMANDS
via command line, .env
file, or Claude Desktop configuration.
Testing: Use MCP Inspector to test resources and tools like list_all_artisan_commands
and run_artisan
.
Claude Integration: Configure Claude Desktop to use the server by adding a new mcpServers
entry with the server's command, arguments, and environment variables.
The server prioritizes security with directory isolation, command whitelisting, and input validation. Use with caution, especially in production environments.
diggy/laravel-artisan-mcp
March 25, 2025
March 26, 2025
Python