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 分

    请在仓库或注册中心条目中声明许可证。