Casebook MCP
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., "@Casebook MCPfind cases similar to 'runaway retry loop spammed customers'"
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.
Casebook MCP
A remote MCP server that turns AgentPostmortem, a public registry of documented AI-agent failures, into tools any agent can query. Deployable on Cloudflare Workers. Ships with a companion investigator agent built on the Claude Agent SDK that drafts postmortems grounded in real precedents.
Why: every team debugging an agent incident is rediscovering failure modes that are already documented. Casebook makes the registry agent-queryable, so Claude, Cursor, or any MCP client can ask "has anything like this happened before?" mid-investigation.
Tools
Tool | Purpose |
| Ranked full-text search over case files; |
| Full case detail: outcome, verified facts, unknowns, lessons |
| Keyword-similarity match of an incident against the corpus |
| All failure-mode tags with descriptions |
Related MCP server: deadends.dev
Architecture
MCP client (Claude Code, Cursor, agent SDK)
| streamable HTTP (JSON-RPC 2.0, stateless)
v
Cloudflare Worker src/index.ts (routing, per-IP rate limit)
| src/mcp.ts (MCP protocol: initialize, tools/list, tools/call)
| src/search.ts (pure ranking and similarity logic, unit tested)
v
src/data.ts: live agentpostmortem.com public API (/api/export, /api/search,
/api/tags) with a 5 minute in-memory cache, falling back to the bundled
dataset in data/ when offline.The MCP transport is implemented directly against the 2025-03-26 streamable HTTP spec in stateless mode: a single POST /mcp endpoint handling initialize, tools/list, and tools/call. JSON-RPC batches are limited to 100 requests and rejected as a unit before dispatch when larger. No sessions, no Durable Objects, no auth (the data is public and read-only). A light in-memory rate limit (60 requests per minute per IP) keeps it polite.
tools/call accepts an optional JSON object for arguments; arrays, scalar
values, and null return JSON-RPC -32602 Invalid params before tool dispatch.
Quickstart
npm install
npm test # vitest: search ranking, tag filter, CSV parsing
npm run typecheck # tsc --noEmit
npm run dev # wrangler dev on http://localhost:8787Smoke test the endpoint:
curl -s http://localhost:8787/mcp -H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'Add it to Claude Code:
claude mcp add --transport http casebook http://localhost:8787/mcpInvestigator agent
agent/investigate.ts uses the Claude Agent SDK query() API. Given an incident description, it connects to the MCP server, finds similar documented failures, pulls the top cases, and writes postmortem-draft.md. It runs on your local Claude Code subscription auth; no API key appears in the code.
# full investigation (uses the model)
npm run investigate -- "our support bot approved hundreds of fake refunds overnight"
# keyless mode for CI: stubs the model, still exercises the MCP server
npm run investigate -- --dry-run "runaway retry loop spammed customers"Point it at a deployed server with CASEBOOK_MCP_URL=https://casebook-mcp.<account>.workers.dev/mcp.
Example transcript
$ npm run investigate -- --dry-run "our support bot was tricked by text in a ticket into approving hundreds of refunds"
Wrote postmortem-draft.md (1091 chars)
$ head postmortem-draft.md
# Postmortem Draft (dry run)
## Incident
our support bot was tricked by text in a ticket into approving hundreds of refunds
## Similar documented failures (source: live (cached))
### APM-0003: Cursor support AI hallucinates login policy, triggering mass subscription cancellationsIn full mode the agent additionally calls get_case on the top precedents and produces a structured draft with suspected failure mode, contributing factors, and remediations grounded in the documented lessons.
Data
Live: public read-only endpoints on agentpostmortem.com (
/api/exportfor the corpus,/api/searchfor rich case detail,/api/tags).Bundled:
data/cases.jsonholds 12 representative case files (prompt-injection refund exploit, runaway retry loop, stale-cache hallucination, tool-permission escalation, and more) used as an offline fallback and as the deterministic fixture for tests.
Deploy
npx wrangler deployThis server cannot be deployed
Maintenance
Related MCP Connectors
Structured failure knowledge for AI agents — dead ends, workarounds, error chains
Never let your agent repeat a bug or linger on a known issue. Search 385+ failure lessons to skip known errors instantly.
Structured knowledge base for AI agent solutions. Search, explore, and retrieve build logs.
Shared knowledge base for AI agents. Semantic search across agents, no setup required — just a URL.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to read, write, and search security findings, engagement memory, and semantic triage via MCP tools on Cloudflare Workers.-
- AlicenseAqualityAmaintenanceHelps AI agents avoid repeating known failures by providing deterministic lookup of dead ends for coding errors and country-specific real-world rules.1131 PyPIMIT
- AlicenseAqualityAmaintenanceAgent failure memory network. Search 235+ verified debugging lessons from real engineering sessions. Includes guided prompts for failure triage and release auditing.91,082 npm727 PyPI511Apache 2.0
- AlicenseNot gradedqualityAmaintenanceEnables AI clients to access a shared, authenticated memory and project management system with durable storage, task tracking, roadmaps, and semantic search, deployed on Cloudflare.MIT