• Joined on 2023-10-26

kletellier/mcp-debug (1.0.0)

Published 2026-08-03 14:54:03 +00:00 by greg

Installation

{
	"repositories": [{
			"type": "composer",
			"url": ""
		}
	]
}
composer require kletellier/mcp-debug:1.0.0

About this package

Laravel package exposing MCP (Model Context Protocol) tools to debug a Laravel app's database and logs, via an `php artisan mcp:debug` server.

kletellier/mcp-debug

Composer package exposing an MCP (Model Context Protocol) server to debug a Laravel application's database and logs. It registers an php artisan mcp:debug command that starts an HTTP MCP server using the host app's own database connection, config, and log files — no separate .env parsing, no manual MySQL/SQLite code.

Requirements

  • PHP 8.2+
  • Laravel 10, 11, 12 or 13

Installation

composer require kletellier/mcp-debug

The service provider is auto-discovered. Optionally publish the config file:

php artisan vendor:publish --tag=mcp-debug-config

Configuration

All settings live in config/mcp-debug.php and can be overridden via .env:

Env var Default Description
MCP_DEBUG_HOST 127.0.0.1 Host the MCP server binds to
MCP_DEBUG_PORT 8090 Port the MCP server binds to
MCP_DEBUG_DB_CONNECTION (default connection) Which config/database.php connection to inspect/query
MCP_DEBUG_ALLOW_WRITE_QUERIES false If false, getQuery only allows SELECT/SHOW/EXPLAIN/PRAGMA
MCP_DEBUG_LOG_PATH storage/logs/laravel.log Log file exposed by the laravel_log tool
MCP_DEBUG_LOG_DEFAULT_LINES 200 Default number of lines laravel_log returns

Running the server

php artisan mcp:debug
# or override host/port for this run:
php artisan mcp:debug --host=0.0.0.0 --port=8091

Leave the process running while your MCP client (VS Code Agent mode, etc.) is connected. Verify it's up:

curl -v http://127.0.0.1:8090/

Tools exposed

  • getSchema — full schema: every table with its columns and indexes.
  • getTables — compact table → column name/type listing.
  • getQuery(sql) — runs a SQL statement against the configured connection. Read-only by default (SELECT/SHOW/EXPLAIN/PRAGMA); set MCP_DEBUG_ALLOW_WRITE_QUERIES=true to allow writes.
  • laravel_log(lines?, search?) — returns the last N lines of the Laravel log file, optionally filtered by a search string.

Using from VS Code (Agent mode)

  1. Start the server as above and keep the terminal open.
  2. Point your Agent/MCP extension at http://127.0.0.1:8090 (or your configured host/port).
  3. Ask the agent to use getSchema, getTables, getQuery, or laravel_log.

Security

  • The server binds to 127.0.0.1 by default — don't expose it publicly without additional protection.
  • getQuery can run arbitrary SQL against your real database when write queries are enabled; only enable that on trusted/local environments.

See SKILL.md for a Claude-oriented guide to driving these tools during a debugging session.

Dependencies

Dependencies

ID Version
illuminate/console ^10.0|^11.0|^12.0|^13.0
illuminate/database ^10.0|^11.0|^12.0|^13.0
illuminate/support ^10.0|^11.0|^12.0|^13.0
php ^8.2
php-mcp/server ^3.3
Details
Composer
2026-08-03 14:54:03 +00:00
2
MIT
8.3 KiB
Assets (1)
Versions (1) View all
1.0.0 2026-08-03