Agent Replay

io.github.mdfifty50-boop由 GitHub 帳號 mdfifty50-boop 發布v0.1.1更新於 Oct 24, 2026

Record and replay AI agent execution for debugging

已驗證STDIO僅桌面開發者工具AI 與機器學習

概覽

AI 產生的概覽

本機 MCP 伺服器,可記錄 AI 代理工作階段,讓助理回放、比較並匯出工作階段,以偵錯非確定性行為。

可以做什麼
開始與停止代理工作階段的錄製,回傳工作階段 ID 以及動作數量與時長摘要,並記錄單一動作的輸入、輸出、推理與耗時。逐步回放已錄製的工作階段,檢視完整動作細節。比較兩個工作階段,取得相似度、相同與分歧步驟數以及首次分歧位置。依單一期望值或逐步期望輸出,找出代理首次偏離預期輸出的位置。將工作階段匯出為 JSON 或易讀的 Markdown 紀錄,並透過資源列出所有已錄製工作階段。
適用情境
適合偵錯每次執行結果不一致的代理、將本次執行與先前的基準比較以找出行為回歸,或需要一份可分享的代理執行紀錄時使用。
執行需求
以本機程序在使用者電腦上執行,透過 npx agent-replay-mcp 啟動,或從原始碼以 Node.js 與 npm install 執行。需要設定桌面用戶端;未宣告帳號、API 金鑰或環境變數。
安裝前請注意
錄製的動作包含輸入、輸出與代理推理內容,可能含有敏感資料;匯出的工作階段與工作階段資源會揭露這些內容,分享前請先檢查。伺服器會在本機寫入工作階段紀錄。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Agent Replay,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

agent-replay-mcp

MCP server for agent session recording and replay — debug non-deterministic agent behavior with session comparison and divergence detection.

Record 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.

Install

bash
npx agent-replay-mcp

Claude Desktop

Add to claude_desktop_config.json:

json
{  "mcpServers": {    "agent-replay": {      "command": "npx",      "args": ["agent-replay-mcp"]    }  }}

From source

bash
git clone https://github.com/mdfifty50-boop/agent-replay-mcp.gitcd agent-replay-mcpnpm installnode src/index.js

Tools

record_session

Start recording all actions for an agent session.

ParamTypeDefaultDescription
agent_idstringrequiredUnique agent identifier
metadataobject{}Optional metadata (task, model, environment)

Returns a session_id for use with other tools.

stop_recording

Stop recording and return a session summary.

ParamTypeDescription
session_idstringSession ID from record_session

Returns: action count, total duration, action type breakdown.

log_action

Log a single action during a recording session.

ParamTypeDefaultDescription
session_idstringrequiredActive session ID
action_typestringrequiredType (tool_call, llm_response, decision, error)
inputanyrequiredInput to the action
outputanyrequiredOutput from the action
reasoningstring""Agent reasoning for this step
duration_msnumber0Action duration in milliseconds

replay_session

Replay a recorded session step by step with full action detail.

ParamTypeDescription
session_idstringSession ID to replay

Returns: complete action sequence with timing, reasoning, inputs, and outputs.

compare_sessions

Behavioral diff between two sessions. Aligns actions by step index and highlights differences.

ParamTypeDescription
session_id_1stringFirst session
session_id_2stringSecond session

Returns: similarity ratio, identical/divergent step counts, first divergence step, and per-step diffs.

find_divergence_point

Find where an agent first deviated from expected output.

ParamTypeDescription
session_idstringSession to analyze
expected_outputanyExpected final output, or array of per-step expected outputs

If 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.

export_session

Export a session for sharing and offline analysis.

ParamTypeDefaultDescription
session_idstringrequiredSession to export
formatstring"json""json" or "markdown"

Markdown format produces a readable transcript with step headers, reasoning, and code blocks.

Resources

URIDescription
agent-replay://sessionsAll recorded sessions with status and action counts

Usage Pattern

1. record_session — start recording at agent launch2. For each agent action:   - log_action — capture input, output, reasoning, timing3. stop_recording — finalize the session4. Debug:   - replay_session — review what happened step by step   - compare_sessions — diff today's run vs yesterday's   - find_divergence_point — pinpoint where it went wrong5. Share:   - export_session — JSON for tooling, markdown for humans

Tests

bash
npm test

License

MIT

來源:README.md,提交 5b16b48

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.1最新Sep 16, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。