# laravel-artisan-mcp

> MCP Server

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.

## Overview

- **Category:** Developer Tools
- **Language:** Python
- **Stars:** 6
- **Forks:** 0
- **Owner:** diggy
- **GitHub:** https://github.com/diggy/laravel-artisan-mcp
- **Created:** 2025-03-25T23:41:15+00:00
- **Updated:** 2025-03-26T20:46:59+00:00
- **Source:** https://model-context-protocol.com/servers/laravel-artisan-commands-ai-execution-server

## Setup

## Setup
1. Clone the repository:
   ```bash
   git clone https://github.com/diggy/laravel-artisan-mcp.git
   cd laravel-artisan-mcp
   ```

2. Create a virtual environment:
   ```bash
   uv init
   uv venv
   source .venv/bin/activate  # On Windows: .venv\Scripts\activate
   ```

3. Install dependencies:
   ```bash
   uv add "mcp[cli]"
   ```

The server requires `ARTISAN_DIRECTORY` and `WHITELISTED_COMMANDS` environment variables, which can be provided via command line, `.env` file, or Claude Desktop configuration.

## Tools

## Available Tools

1. Access a single directory containing a Laravel project (Allows the server to interact with a specific Laravel project). 
2. Automatically locate PHP on your system (The server automatically finds the PHP executable).
3. Execute only whitelisted Artisan commands (The server only runs pre-approved Artisan commands).
4. View all available Artisan commands (The server can display all Artisan commands in the project).
5. `run_artisan` (Executes a whitelisted Artisan command).
6. `list_all_artisan_commands` (Displays all available Artisan commands in the Laravel application).
7. `artisan://commands` (Returns a list of all whitelisted commands configured for the server).
