clockwork-mcp
Provides debugging and performance analysis for Laravel applications via Clockwork, enabling inspection of requests, queries, errors, cache, and more.
Enables reading Clockwork debugging data stored in MySQL for performance and error analysis.
Enables reading Clockwork debugging data stored in PostgreSQL for performance and error analysis.
Provides tools to inspect Redis commands executed during requests, as well as cache operations and statistics.
Enables reading Clockwork debugging data stored in SQLite for performance and error analysis.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@clockwork-mcp Find slow queries in the last request"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
clockwork-mcp
MCP server for Laravel Clockwork - debug Laravel apps with Claude Code.
What it does
This MCP server gives Claude Code access to your Laravel application's Clockwork debugging data, enabling:
Debugging - Find slow queries, N+1 problems, cache issues, errors
Performance analysis - Track response times, query counts, memory usage
Development insight - Understand request flow, see runtime behavior
Related MCP server: mcp-sequel
Installation
Option 1: Claude Code Plugin (Recommended)
/marketplace add github:fridzema/clockwork-mcp
/plugin install clockworkThis installs the MCP server and adds convenience commands:
/clockwork:status- Check storage status/clockwork:latest- Show latest request summary/clockwork:slow- Find slow queries/clockwork:n+1- Detect N+1 patterns
Option 2: Manual MCP Configuration
Add to your Claude Code MCP settings:
{
"mcpServers": {
"clockwork": {
"command": "npx",
"args": ["-y", "clockwork-mcp"]
}
}
}Quick Start
1. Install Clockwork in your Laravel app
composer require itsgoingd/clockwork2. Start debugging
Ask Claude to analyze your requests:
"Show me the latest request"
"Find slow queries in the last request"
"Check for N+1 query problems"
"Compare this request with the previous one"
Or use the slash commands:
/clockwork:status/clockwork:latest/clockwork:slow/clockwork:n+1
Usage Examples
Debugging a Slow Endpoint
You: "The /api/orders endpoint is slow, can you analyze it?"Claude will use the MCP tools to:
Find the latest request to
/api/ordersAnalyze query performance
Detect N+1 patterns
Suggest fixes like eager loading or caching
Investigating a 500 Error
You: "I just got a 500 error on the checkout page, what happened?"Claude will:
Find the latest failed request
Show error logs and exception details
Identify the problematic code path
Optimizing Database Queries
You: "Check if there are N+1 issues on the products page"Claude will:
Analyze recent requests to the products route
Detect repeated query patterns
Suggest eager loading with
->with('relation')
More Natural Language Examples
Performance:
"Compare the last two requests to /api/users"
"Which queries are taking the longest?"
"Show me the cache hit ratio"
Debugging:
"What middleware ran on the last request?"
"Show me all log entries with errors"
"List the events that were dispatched"
Analysis:
"Give me a performance summary of the latest request"
"Show the full request timeline"
"What views were rendered?"
Exception & Error Analysis:
"Show me exception patterns from the last hour"
"What errors have been occurring?"
"Group recent exceptions by type"
Route Performance:
"Which routes are slowest? Show p95 response times"
"Analyze route performance for the past day"
"Compare response times across endpoints"
Memory Issues:
"Are there any memory issues?"
"Detect memory leaks or growth patterns"
"Which requests are using the most memory?"
Queue Jobs:
"List failed queue jobs"
"Show me recent job executions"
"What jobs are pending?"
Test Execution:
"List recent test runs"
"Show failed tests"
"What tests are being skipped?"
Tools
Request Discovery
Tool | Description |
| List recent requests with filtering |
| Get full request details by ID |
| Get the most recent request |
| Search by controller, URI, status, duration |
Database Analysis
Tool | Description |
| Get all database queries for a request |
| Find queries above threshold |
| Detect N+1 query patterns |
| Get aggregate query statistics |
Performance
Tool | Description |
| Response time, memory, query overview |
| Execution timeline events |
| Compare two requests side by side |
Cache & Redis
Tool | Description |
| Cache hits, misses, writes |
| Hit ratio and totals |
| Redis commands executed |
Application Context
Tool | Description |
| Log entries with level filtering |
| Dispatched events and listeners |
| Rendered views |
| Outgoing HTTP requests |
Artisan Commands
Tool | Description |
| List profiled command executions |
| Full command execution details |
Traces & Execution Flow
Tool | Description |
| Hierarchical execution tree from timeline events |
| Source location for a database query |
| Source location for a log entry |
Profiling (Xdebug)
Tool | Description |
| Xdebug profiling data (stub) |
| Xdebug hotspots (stub) |
Queue Jobs
Tool | Description |
| List queue jobs with filtering |
| Full queue job details |
Test Execution
Tool | Description |
| List test executions with filtering |
| Full test execution details |
Request Context
Tool | Description |
| Authenticated user for a request |
| Session data for a request |
| Middleware chain for a request |
| Route details for a request |
Multi-Request Analysis
Tool | Description |
| Group exceptions by message pattern |
| Route performance with percentiles (p50/p95/p99) |
| Detect high memory usage and growth patterns |
Utility
Tool | Description |
| Storage status and statistics |
| High-level request summary |
Configuration
Storage Backends
By default, Clockwork MCP auto-detects your Laravel project and uses php artisan tinker to read Clockwork data. This works with all Clockwork storage backends:
File (default)
SQLite
MySQL
PostgreSQL
Redis
When you configure Clockwork to use SQL or Redis storage in your Laravel app (config/clockwork.php), the MCP server automatically uses the same storage by running PHP commands through artisan tinker. No additional configuration required.
Environment Variables
Variable | Default | Description |
| Auto-detect | Path to Laravel project root |
| Auto-detect | Force storage driver ( |
|
| Custom PHP binary path |
| Auto-detect | Direct path to storage (file driver only) |
Auto-detection
The MCP server automatically finds Clockwork storage by:
Checking
CLOCKWORK_PROJECT_PATHenvironment variableLooking for Laravel project (has
artisanfile) in current directoryTraversing up to find a Laravel project
When a Laravel project is found, the artisan driver is used by default, which supports all Clockwork storage backends. The file driver is used as a fallback when only a direct storage path is available.
Requirements
Node.js 18+
Laravel project with Clockwork installed
Claude Code with MCP support
License
MIT
Available Tools
38 toolsanalyze_exceptionsC
Analyze exceptions across requests, grouping by message pattern
Inputs: requestId, count, since, all, +3 more.
analyze_route_performanceC
Analyze route performance with percentile statistics
Inputs: requestId, count, since, all, +3 more.
analyze_slow_queriesC
Find slow database queries above threshold
Inputs: requestId, count, since, all, +3 more.
compare_requestsC
Compare two requests side by side
Inputs: requestId1 (required), requestId2 (required).
detect_memory_issuesC
Detect high memory usage and growth patterns
Inputs: requestId, count, since, all, +3 more.
detect_n_plus_oneC
Detect N+1 query patterns in a request
Inputs: requestId, count, since, all, +2 more.
explain_request_flowC
Get high-level summary of what happened in a request
Inputs: requestId (required).
get_auth_userC
Get authenticated user for a request
Inputs: requestId (required).
get_cache_operationsC
Get cache operations for a request
Inputs: requestId (required).
get_cache_statsB
Get cache statistics (hit ratio, totals)
Inputs: requestId, from, to.
get_call_graphC
Build hierarchical execution tree from timeline events
Inputs: requestId (required), minDuration.
get_clockwork_statusB
Check Clockwork storage status and statistics
Inputs: no named parameters.
get_commandC
Get full details of an Artisan command execution
Inputs: requestId (required).
get_eventsC
Get dispatched events for a request
Inputs: requestId (required).
get_http_requestsC
Get outgoing HTTP requests made during a request
Inputs: requestId (required).
get_latest_requestB
Get the most recent Clockwork request
Inputs: no named parameters.
get_logsC
Get log entries for a request
Inputs: requestId (required), level.
get_log_stack_traceC
Get source location for a log entry
Inputs: requestId (required), logIndex (required).
get_middleware_chainC
Get middleware chain for a request
Inputs: requestId (required).
get_performance_summaryC
Get performance overview for a request
Inputs: requestId, from, to.
get_queriesC
Get database queries for a request
Inputs: requestId (required), slow, threshold.
get_query_stack_traceB
Get source location for a database query
Inputs: requestId (required), queryIndex (required).
get_query_statsC
Get aggregate query statistics for a request
Inputs: requestId, from, to.
get_queue_jobB
Get full details of a queue job
Inputs: requestId (required).
get_redis_commandsC
Get Redis commands for a request
Inputs: requestId (required).
get_requestA
Get full details of a specific request by ID
Inputs: requestId (required).
get_route_detailsC
Get route details for a request
Inputs: requestId (required).
get_session_dataC
Get session data for a request
Inputs: requestId (required), keys.
get_testB
Get full details of a test execution
Inputs: requestId (required).
get_timelineB
Get timeline events for a request
Inputs: requestId (required).
get_viewsB
Get rendered views for a request
Inputs: requestId (required).
get_xdebug_hotspotsA
Get Xdebug hotspots for a request (stub - not available in Clockwork)
Inputs: requestId (required), limit.
get_xdebug_profileA
Get Xdebug profiling data for a request (stub - not available in Clockwork)
Inputs: requestId (required).
list_commandsB
List profiled Artisan command executions
Inputs: name, from, to, limit, +1 more.
list_queue_jobsC
List queue jobs with optional filtering
Inputs: queue, job, status, from, +3 more.
list_requestsC
List recent Clockwork requests with optional filtering
Inputs: type, status, uri, method, +4 more.
list_testsB
List test executions with optional filtering
Inputs: name, status, from, to, +2 more.
search_requestsB
Search requests by controller, URI, status, or duration
Inputs: controller, uri, status, minDuration, +3 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 38 tools
Most tools target distinct debugging aspects (e.g., queries, cache, logs, events), but slight overlap exists between analyze_slow_queries, get_queries, and get_query_stats, as well as between get_request and get_latest_request. Descriptions mitigate confusion.
All tool names follow a consistent verb_noun pattern in snake_case (e.g., get_*, analyze_*, list_*), making them predictable and easy to navigate.
38 tools is high but acceptable for a comprehensive debugging server. However, two stub tools (get_xdebug_hotspots, get_xdebug_profile) are unnecessary and inflate the count.
The toolset covers most debugging needs (requests, queries, logs, cache, events, performance, etc.). Minor gaps include the missing Xdebug functionality indicated by stubs.
Maintenance
Related MCP Connectors
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Hosted MySQL MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Free MCP server for WordPress: Claude and ChatGPT connect with OAuth. No account, cap or API key.
Related MCP Servers
- AlicenseBqualityDmaintenanceMCP server that allows Claude AI to interact directly with MySQL databases, enabling query execution and table information retrieval through natural language.14ISC
- AlicenseAqualityCmaintenanceMCP server for Claude that connects to MySQL, MariaDB, and SQLite databases. Query your databases using natural language.3132 PyPIMIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that allows Claude Code to interact with the OpenAI Codex CLI.40 npm20MIT
- AlicenseAqualityDmaintenanceAn MCP server that lets Claude Code recall the context of past conversations from any project on demand.546 npm3MIT