Agentsnap

io.github.MukundaKatta由 GitHub 账号 MukundaKatta 发布v0.1.0更新于 Oct 24, 2026

Snapshot tests for AI tool-call traces: diff, validate, and catch silent regressions.

已验证STDIO仅桌面开发者工具AI 与机器学习

概览

AI 生成的概览

让助手规范化、比对并校验 AI 智能体的工具调用轨迹,以发现运行之间的隐性回归。

可以做什么
基于 agentsnap 库提供三个工具。normalize_trace 将原始工具调用轨迹转换为规范的 Trace 结构,并计算确定性的 SHA-256 指纹哈希。diff_traces 将基线轨迹与当前运行比对,返回新增、删除、变更以及状态码(如 PASSED、OUTPUT_DRIFT、TOOLS_REORDERED、TOOLS_CHANGED、REGRESSION),并可用 ignore_paths 忽略噪声字段。validate_snapshot 按 Trace 模式校验快照,报告必填字段或工具条目问题。
适用场景
适合维护会调用工具的智能体、并希望对其轨迹做回归检查的场景,例如比较改动前后的运行,或校验已保存的快照。当工具参数、顺序或非确定性结果可能在普通单元测试中不被发现地漂移时,它尤其有用。
运行要求
作为本地 stdio 进程在用户机器上运行,仅限桌面端。可通过 npx @mukundakatta/agentsnap-mcp 或全局 npm 安装;需要 Node.js 和 npm。未声明认证、环境变量或请求头。
安装前请注意
该服务器会读取你传入的轨迹数据,其中可能包含工具参数、输入和模型名称;发送前请将此类轨迹视为可能敏感。未声明凭据、支付或写入操作。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Agentsnap,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

agentsnap-mcp

[npm] [tests] [mcp]

An MCP server that gives AI assistants the ability to inspect, normalize, diff, and validate agent tool-call traces.

Built on top of @mukundakatta/agentsnap. Works with Claude Desktop, Cursor, Cline, Windsurf, Zed, and any other MCP client.

Tools exposed

normalize_trace

Coerce a raw tool-call trace into the canonical agentsnap Trace shape and compute a deterministic SHA-256 fingerprint hash. Use this to compare runs cheaply or feed downstream diff tools.

json
{  "trace": [    { "name": "search", "args": { "q": "cats" } },    { "name": "fetch",  "args": "https://example.com" }  ],  "input": "find cats",  "model": "claude-opus-4-7"}

→

json
{  "normalized": {    "version": 1,    "model": "claude-opus-4-7",    "input": "find cats",    "output": null,    "tools": [      { "name": "search", "args": { "q": "cats" } },      { "name": "fetch",  "args": "https://example.com" }    ],    "error": null,    "fingerprint": { "node": "v22.0.0", "agentsnap": "0.1.0" }  },  "hash": "sha256:..."}

diff_traces

Diff a baseline trace against a current run. Returns a uniform additions / removals / changes vocabulary plus the agentsnap status code (PASSED, OUTPUT_DRIFT, TOOLS_REORDERED, TOOLS_CHANGED, REGRESSION). Use ignore_paths to silence noisy fields before classification.

json
{  "baseline": { "version": 1, "tools": [{ "name": "search", "args": { "q": "cats" }, "result_hash": "sha256:aaa" }], "error": null, "fingerprint": {...} },  "current":  { "version": 1, "tools": [{ "name": "search", "args": { "q": "cats" }, "result_hash": "sha256:bbb" }], "error": null, "fingerprint": {...} },  "ignore_paths": ["tools[].result_hash"]}

→ { "same": true, "status": "PASSED", "additions": [], "removals": [], "changes": [] }

validate_snapshot

Sanity-check a snapshot against the agentsnap Trace schema. Verifies required fields, tool-entry shape, and surfaces actionable issues. Returns valid=true on success or a list of human-readable problems.

Install

Claude Desktop

Add to claude_desktop_config.json:

json
{  "mcpServers": {    "agentsnap": {      "command": "npx",      "args": ["-y", "@mukundakatta/agentsnap-mcp"]    }  }}

Cursor / Cline / Windsurf / Zed

Same shape, in the appropriate mcp.json for your client. Most clients auto-discover via npx -y @mukundakatta/agentsnap-mcp.

Local install

bash
npm install -g @mukundakatta/agentsnap-mcpmcp-agentsnap        # listens on stdio

Why this matters

Agents that call tools drift silently. A tool argument changes shape, a nondeterministic result flips a downstream branch, an extra tool sneaks in between releases — none of it shows up in unit tests. agentsnap captures the trace; this MCP server lets your assistant inspect and reason about traces directly: normalize one, diff two, or validate a saved snapshot, all from the model's tool-use surface.

License

MIT.

来源:README.md,提交 5bc93c8

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

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

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分