Get the FREE Ultimate OpenClaw Setup Guide →

laravel

MCP server for Cursor to assist with Laravel development

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio jsonallen-laravel-mcp python server.py \
  --env LARAVEL_PATH="Path to your Laravel project"

How to use

This MCP server provides a set of Laravel helper tools designed to work within Cursor IDE. It exposes commands to tail the Laravel log, search for log errors, run Artisan commands, and show model information with relationships. In Cursor, you can invoke these tools from the command palette to quickly inspect logs, execute common Artisan workflows, and inspect Eloquent models without leaving your editor. The server is intended to streamline Laravel development by giving you direct feedback and capabilities inside your editing environment.

Available tools:

  • tail_log_file: View the most recent entries in your Laravel log file directly in Cursor.
  • search_log_errors: Search through log files for specific error patterns with integrated results.
  • run_artisan_command: Execute Laravel Artisan commands directly from Cursor.
  • show_model: Display model information and relationships in your editor. Use this to quickly understand model structure and relationships during development.

How to install

Prerequisites:

  • PHP 8.1+
  • Laravel 10.0+
  • Cursor IDE
  • UV (Python packaging tool)
  • Python 3.8+ (if not using UV packaging)

Installation steps:

  1. Clone the MCP repository for the Laravel helpers:
git clone https://github.com/your-username/laravel-mcp.git
cd laravel-mcp
  1. Ensure you have Python and UV installed. If needed, install UV:
pip install uv
# or via your preferred Python environment manager
  1. Prepare a simple server wrapper (example path and script):
# Create a server entrypoint if not present, e.g., server.py
# The server.py should expose the MCP server entry compatible with MCP framework
  1. Run the MCP server using the provided script path:
# Example execution (adjust path to server.py as needed)
python server.py
  1. If you’re using the MCP launcher, ensure your PATH includes the script location and that the environment variable LARAVEL_PATH is set to your Laravel project path (see additional notes).

  2. Optional: add a launcher alias or script to simplify startup, e.g., create ~/bin/run-laravel-mcp that launches the server with proper environment variables.

#!/bin/bash
export LARAVEL_PATH=/path/to/your/laravel/project
python /path/to/laravel-mcp/server.py

Additional notes

Notes and tips:

  • This MCP is marked as deprecated in the repository. If you rely on Cursor IDE integration, you may want to explore newer alternatives or forks.
  • Ensure LARAVEL_PATH points to the root directory of your Laravel application. The MCP tools may read config or log paths relative to this directory.
  • If you modify server.py or the tooling, keep your Python environment isolated (virtualenv/venv) to avoid conflicts with system Python.
  • When running Artisan commands from Cursor, consider using a non-interactive mode or redirect prompts if your commands require input.
  • Although the server is lightweight, long-running Artisan tasks may require background execution or chunked processing to avoid blocking the editor.
  • If you encounter permissions issues on log files, ensure the user running the MCP server has read access to storage/logs and related Laravel directories.

Related MCP Servers

Sponsor this space

Reach thousands of developers