incident-lab
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., "@incident-lab Investigate inc_job_failed"
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.
MCP Incident Lab
A standalone TypeScript MCP server for investigating synthetic payment incidents. It does not grant an agent a database, a shell, or an unscoped log dump. It never calls a paid LLM API.
The data is fixture-backed. Nothing here is a live payment system.
Why this exists
Agents are useful during incidents only if their tools are narrower than the blast radius of a mistake. This project makes that boundary testable: the model can list incidents, inspect one payment, read bounded logs, and retry a failed job after an explicit confirmation. It cannot invent SQL, grep the whole disk, or retry a job that is not failed.
flowchart LR
Agent -->|"MCP tools"| Server
Server --> Fixtures["Seeded incidents"]
Server --> Audit["Audit trail"]
Agent -.->|"cannot"| SQL["Arbitrary SQL"]
Agent -.->|"cannot"| Shell["Shell / filesystem"]
Agent -.->|"cannot"| Unscoped["Unscoped log search"]Related MCP server: Payment Reconciliation Copilot
What it demonstrates
Three seeded scenarios: a failed job, a duplicate client request, and an unhealthy dependency.
Read-only tools:
list_incidents,get_payment,list_job_attempts,search_logs.One mutating tool:
retry_job, which requiresconfirm: true, a written reason, and always writes an audit event.Deterministic tests that diagnose each scenario from tool output alone.
Trust boundary
Allowed | Not allowed |
Look up one payment by | Arbitrary SQL, wildcards, or table scans |
List attempts for one job or payment | Shell commands or file reads |
Search logs for one incident or payment, optional substring, max 25 lines | Regex, glob, or searching all logs at once |
Retry a failed job after confirmation | Retrying succeeded or pending jobs |
Read-only is the default. retry_job is the exception, and it is gated.
Likely agent failure modes
This server does not make the agent correct. It only limits the damage.
The agent can still retry the wrong failed job.
The agent can treat a duplicate request as a failed charge unless it reads the logs. The tools will refuse that retry because the job succeeded.
The agent can try to “fix” an unhealthy dependency by retrying. The tools refuse that too: the job is pending, not failed, and Redis is down.
Those refusals are the point. The audit trail records accepted and rejected retries.
Quick start
npm install
npm test
npm run demonpm run demo walks all three scenarios without an LLM.
To inspect the tools in a UI:
npm run inspectorConnect, then call list_incidents.
Cursor
Add this to MCP settings, with the project path substituted:
{
"mcpServers": {
"incident-lab": {
"command": "npx",
"args": ["tsx", "src/server.ts"],
"cwd": "/absolute/path/to/mcp-incident-lab"
}
}
}Log to stderr only. stdout is the MCP protocol.
Seeded scenarios
Failed job (
inc_job_failed): payment still pending, three processor timeouts, retries exhausted.retry_jobis accepted.Duplicate request (
inc_duplicate): one processed payment, logs show the second request was suppressed.retry_jobis rejected.Unhealthy dependency (
inc_unhealthy_dep): Redis connection refused, job still pending with zero attempts.retry_jobis rejected.
Failure model and tradeoffs
This is a teaching lab, not an on-call platform. Fixtures are in-memory and reset per process. There is no authentication, no real log store, and no adapter to Payment Reliability Lab in the MVP.
A production incident MCP would still keep the same shape: named lookups,
hard caps, an explicit mutate-with-reason path, and an audit log. It would
not expose a generic query tool and hope the model is careful.
Development
npm test
npm run build
npm run devAvailable Tools
5 toolsget_paymentA
Fetch one synthetic payment by id (pay_…). Read-only. Does not accept SQL or wildcards.
Inputs: paymentId (required).
list_incidentsA
List seeded synthetic payment incidents. Read-only. No filters; the catalog is small on purpose.
Inputs: no named parameters.
list_job_attemptsA
List settlement-job attempts for one jobId or paymentId. Read-only.
Inputs: jobId, paymentId.
retry_jobA
The only mutating tool. Re-enqueues a failed job. Requires confirm=true and a written reason. Writes an audit event even when rejected.
Inputs: jobId (required), reason (required), confirm (required).
search_logsA
Search log lines for one incidentId or paymentId. Optional substring query (max 80 chars). Max 25 lines. No regex, glob, or unscoped search.
Inputs: limit, query, paymentId, incidentId.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool targets a distinct resource and action: incidents, payments, job attempts, logs, and retries. No two tools appear to do the same thing, and their scopes are clearly separated by entity and read-only vs. mutating behavior.
All tool names follow a consistent snake_case verb_noun pattern: list_incidents, get_payment, list_job_attempts, search_logs, retry_job. The verbs are predictable and match the tool's behavior, so an agent can infer the purpose from the name alone.
Five tools is well-scoped for an incident-lab server focused on investigating synthetic payment incidents and retrying failed jobs. Each tool earns its place, and the count is not bloated or too thin for the stated purpose.
The tool set covers the likely investigation workflow: list incidents, inspect payment details, examine job attempts, search logs, and retry a failed job. A dedicated get_incident tool is absent, but list_incidents explicitly says the catalog is small, so this is a minor gap rather than a blocking one.
Related MCP Connectors
Read-only triage for n8n, MCP, webhook, and AI agent workflow production failures.
Remote MCP for A2A failure replay MCP, structured receipts, audit logs, and reviewer-ready evidence.
Workflow diagnostics, capability routing, and x402 settlement for MCP-compatible agents.
MCP diagnostics that help AI agents find safe next steps for HTTP, API, and MCP failures.
Related MCP Servers
- FlicenseNot gradedqualityBmaintenanceEnables read-only Kubernetes incident investigation through MCP tools for listing pods, describing resources, fetching logs, and searching runbooks.1-
- FlicenseNot gradedqualityDmaintenanceEnables read-only investigation of payment transactions by building normalized timelines, detecting anomalies like duplicate charges and stuck refunds, and creating diagnostic escalations for human review. Never executes or modifies payment actions.-
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to investigate production incidents by exposing service health, logs, and deployment data through MCP tools.5 npmISC
- FlicenseNot gradedqualityCmaintenanceEnables SafeOps operators to monitor worker health, inspect job queues, investigate incidents, search runbooks, and approve or reject targeted failed-job retries through MCP tools, resources, and a prompt.-