nightwatch-mcp
v0.1.0
Published
MCP server exposing full Laravel Nightwatch telemetry to AI agents
Maintainers
Readme
nightwatch-mcp
MCP server that exposes the full breadth of Laravel Nightwatch telemetry to AI agents — requests, queries, jobs, mail, cache, exceptions, and more.
The official Nightwatch MCP only surfaces issues. This package gives your AI access to everything.
Tools
| Tool | Description |
|------|-------------|
| nightwatch_overview | Health summary: request volume, error rates, P95, job failures, slow routes |
| nightwatch_requests | HTTP routes with performance metrics (count, status codes, avg/p95) |
| nightwatch_request_route_detail | Individual requests for a specific route |
| nightwatch_request_trace | Full request timeline: middleware, queries, cache, jobs, mail |
| nightwatch_queries | Database query performance (SQL, connection, count, duration) |
| nightwatch_jobs | Job queue stats (processed, released, failed, duration) |
| nightwatch_mail | Outbound mail tracking (count, send duration) |
| nightwatch_scheduled_tasks | Scheduled task execution history |
| nightwatch_cache | Cache key hit/miss rates and failure stats |
| nightwatch_exceptions | Exception tracking with occurrence counts |
Setup
Claude Code
claude mcp add nightwatch -e [email protected] -e NIGHTWATCH_PASSWORD=your-password -- npx -y nightwatch-mcpClaude Desktop / Claude Code (settings.json)
{
"mcpServers": {
"nightwatch": {
"command": "npx",
"args": ["-y", "nightwatch-mcp"],
"env": {
"NIGHTWATCH_EMAIL": "[email protected]",
"NIGHTWATCH_PASSWORD": "your-password"
}
}
}
}Cursor (.cursor/mcp.json)
{
"mcpServers": {
"nightwatch": {
"command": "npx",
"args": ["-y", "nightwatch-mcp"],
"env": {
"NIGHTWATCH_EMAIL": "[email protected]",
"NIGHTWATCH_PASSWORD": "your-password"
}
}
}
}Environment Variables
| Variable | Required | Description |
|----------|----------|-------------|
| NIGHTWATCH_EMAIL | Yes | Your nightwatch.laravel.com email |
| NIGHTWATCH_PASSWORD | Yes | Your nightwatch.laravel.com password |
| NIGHTWATCH_APP | No | Default app name (auto-detected if you have one app) |
| NIGHTWATCH_ENV | No | Default environment (default: Production) |
| NIGHTWATCH_BASE_URL | No | Override base URL (default: https://nightwatch.laravel.com) |
Example Prompts
Once configured, ask your AI agent:
- "Give me a health summary of my production app"
- "What are my slowest routes in the last 24 hours?"
- "Show me my top 10 slowest database queries"
- "Which jobs have been failing?"
- "What's my cache hit rate looking like?"
- "Walk me through what happened during request abc123"
How It Works
This package authenticates with the Nightwatch dashboard using your credentials and communicates via the Inertia.js protocol (the same mechanism the dashboard uses internally). It does not use any undocumented or private API — it makes the same requests your browser makes.
All access is read-only.
Multi-App Support
If you have multiple Nightwatch apps, specify which one to query:
- Set
NIGHTWATCH_APPenv var as a default - Or pass the
appparameter to any tool call
Requirements
- Node.js 18+
- A Laravel Nightwatch account
License
MIT
