What is Laravel Artisan MCP Server?
Laravel Artisan MCP Server is a Model Context Protocol (MCP) server that enables secure execution of Laravel Artisan commands through Claude and other MCP clients. It acts as a bridge between AI assistants and local Laravel applications, allowing controlled management of Laravel projects via natural language conversations.
How to use Laravel Artisan MCP Server?
Clone the repository, create a Python virtual environment, install dependencies with uv add "mcp[cli]", then set the ARTISAN_DIRECTORY and WHITELISTED_COMMANDS environment variables. Configure the server in your MCP-compatible client (e.g., Claude Desktop) by adding a JSON entry pointing to artisan_mcp_server.py. Two tools are available: run_artisan to execute a whitelisted command and list_all_artisan_commands to display all available commands.
Key features of Laravel Artisan MCP Server
- Executes only whitelisted Artisan commands
- Automatically locates PHP on your system
- Accesses a single configured Laravel project directory
- Lists all available Artisan commands in the project
- Provides robust input validation and error handling
Use cases of Laravel Artisan MCP Server
- Clear the application cache by asking Claude to run
cache:clear
- List all registered routes in a Laravel project via
route:list
- View all available Artisan commands without leaving your AI assistant
- Generate controllers, models, or other classes using
make:* commands when whitelisted
评论