{
  "markdown": "# agent-replay-mcp\n\nMCP server for agent session recording and replay — debug non-deterministic agent behavior with session comparison and divergence detection.\n\nRecord every action an agent takes, replay sessions step by step, diff two runs to find behavioral regressions, and pinpoint exactly where an agent diverged from expected output.\n\n## Install\n\n```bash\nnpx agent-replay-mcp\n```\n\n### Claude Desktop\n\nAdd to `claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"agent-replay\": {\n      \"command\": \"npx\",\n      \"args\": [\"agent-replay-mcp\"]\n    }\n  }\n}\n```\n\n### From source\n\n```bash\ngit clone https://github.com/mdfifty50-boop/agent-replay-mcp.git\ncd agent-replay-mcp\nnpm install\nnode src/index.js\n```\n\n## Tools\n\n### record_session\n\nStart recording all actions for an agent session.\n\n| Param | Type | Default | Description |\n|-------|------|---------|-------------|\n| `agent_id` | string | required | Unique agent identifier |\n| `metadata` | object | `{}` | Optional metadata (task, model, environment) |\n\nReturns a `session_id` for use with other tools.\n\n### stop_recording\n\nStop recording and return a session summary.\n\n| Param | Type | Description |\n|-------|------|-------------|\n| `session_id` | string | Session ID from record_session |\n\nReturns: action count, total duration, action type breakdown.\n\n### log_action\n\nLog a single action during a recording session.\n\n| Param | Type | Default | Description |\n|-------|------|---------|-------------|\n| `session_id` | string | required | Active session ID |\n| `action_type` | string | required | Type (tool_call, llm_response, decision, error) |\n| `input` | any | required | Input to the action |\n| `output` | any | required | Output from the action |\n| `reasoning` | string | `\"\"` | Agent reasoning for this step |\n| `duration_ms` | number | `0` | Action duration in milliseconds |\n\n### replay_session\n\nReplay a recorded session step by step with full action detail.\n\n| Param | Type | Description |\n|-------|------|-------------|\n| `session_id` | string | Session ID to replay |\n\nReturns: complete action sequence with timing, reasoning, inputs, and outputs.\n\n### compare_sessions\n\nBehavioral diff between two sessions. Aligns actions by step index and highlights differences.\n\n| Param | Type | Description |\n|-------|------|-------------|\n| `session_id_1` | string | First session |\n| `session_id_2` | string | Second session |\n\nReturns: similarity ratio, identical/divergent step counts, first divergence step, and per-step diffs.\n\n### find_divergence_point\n\nFind where an agent first deviated from expected output.\n\n| Param | Type | Description |\n|-------|------|-------------|\n| `session_id` | string | Session to analyze |\n| `expected_output` | any | Expected final output, or array of per-step expected outputs |\n\nIf `expected_output` is an array, compares step by step. If a single value, finds the last matching output and flags the next step as the divergence point.\n\n### export_session\n\nExport a session for sharing and offline analysis.\n\n| Param | Type | Default | Description |\n|-------|------|---------|-------------|\n| `session_id` | string | required | Session to export |\n| `format` | string | `\"json\"` | `\"json\"` or `\"markdown\"` |\n\nMarkdown format produces a readable transcript with step headers, reasoning, and code blocks.\n\n## Resources\n\n| URI | Description |\n|-----|-------------|\n| `agent-replay://sessions` | All recorded sessions with status and action counts |\n\n## Usage Pattern\n\n```\n1. record_session — start recording at agent launch\n2. For each agent action:\n   - log_action — capture input, output, reasoning, timing\n3. stop_recording — finalize the session\n4. Debug:\n   - replay_session — review what happened step by step\n   - compare_sessions — diff today's run vs yesterday's\n   - find_divergence_point — pinpoint where it went wrong\n5. Share:\n   - export_session — JSON for tooling, markdown for humans\n```\n\n## Tests\n\n```bash\nnpm test\n```\n\n## License\n\nMIT\n",
  "bytes": 3958,
  "sha": "c7adcab53c4e7d98153b7825a705bc873aae957f3f5b06b46e5045fc80cc7b6f",
  "repo_slug": "mdfifty50-boop/agent-replay-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_mdfifty50_boop_agent_replay_939d5359/readme"
}