Snapback

io.github.ra1labsworkx-wq由 GitHub 账号 ra1labsworkx-wq 发布v1.8.4更新于 Oct 24, 2026

Diagnose why an AI agent failed and get the verified fix instantly. Free, no token.

已验证Streamable HTTP可网页运行开发者工具安全与监控AI 与机器学习

概览

AI 生成的概览

Snapback 是一个托管型 MCP 服务器,用于诊断 AI 智能体运行失败的原因,并返回带修复建议的结构化结论。

可以做什么
诊断故障:诊断单条 trace、最多 20 条的批量 trace 或晦涩的基础设施错误,并按 id 或 trace id 取回已有结论。运行前指导:列出某套配置的已知失败模式,找出错误级联中的真正根因,并给出重试、切换或停止的建议。监控实时运行:开启会话、上报步骤、检测重复的工具调用循环,并检查 token、成本、上下文与步骤预算。参考历史:查看本智能体反复出现的失败类别,以及其他智能体对某类失败的匿名化处理结果。管理反馈闭环:评价结论、上报修复结果、请求新增模式,并查看请求状态、用量与影响。把原始日志转换为 trace,并检索文档。
适用场景
适合运行 AI 智能体、希望快速获得结构化的失败解释、运行中循环或预算超支预警,以及不稳定服务商路由建议的场景。既可用于事后批量分析失败 trace,也可用于运行前对照已知陷阱做检查。
运行要求
远程 Streamable HTTP 端点,无需本地运行。多数工具据称免费且无需令牌;诊断、结论、反馈与用量类工具按量计费,需要入门令牌或 x402 支付。README 中可选的拦截器是一个 Python 文件,通过 SNAPBACK_MCP 环境变量配置。
安装前请注意
部分工具按量计费并可能产生费用,批量调用按多次诊断计费,大量使用前请查看用量。反馈评分与模式请求会更新共享的匿名化模式库,结果上报也会进入共享遥测。可选拦截器可自动应用修复并重试,但文档称对 mutate 或 destructive 类修复会升级给人工处理。

安装

在 SourceWeft 中

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

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.ra1labsworkx-wq%2Fsnapback/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "snapback": {
      "type": "http",
      "url": "https://api.snapback.sh/mcp"
    }
  }
}

README

Snapback self-heal interceptor for OpenClaw

mcp-name: io.github.ra1labsworkx-wq/snapback

Make Snapback automatic. Instead of remembering to call the diagnosis tool, wrap your agent's tool calls once — and every error is auto-diagnosed, and gated-safe fixes are applied and retried without a human.

"Power tools are optional. Infrastructure is not." This turns Snapback from a tool you reach for into infrastructure that runs on every failure.

Connect the MCP server

Snapback is a hosted remote MCP server — nothing to run locally. Add it to any MCP client (Claude Code, Cursor, Cline, VS Code, Windsurf). Most tools are free and need no token.

json
{  "mcpServers": {    "snapback": {      "url": "https://api.snapback.sh/mcp"    }  }}

Endpoint: https://api.snapback.sh/mcp (Streamable HTTP, JSON-RPC 2.0). Then call tools/list (23 tools) and try diagnose_infra_error with {"error": "dns nxdomain servfail"} → family: dns-tls + a verified fix.

Tools

Free (no token): diagnose_infra_error, detect_loop, budget_guard, search_docs, what_others_did, recommend_failover, cascade_root, suggest_budget_recovery, convert_trace, preflight, session_start, session_step, session_end, discovery.

Metered (free starter token or x402): diagnose_trace, diagnose_batch, get_verdict, submit_feedback, report_outcome, request_pattern, my_usage, my_impact, agent_memory.

  • diagnose_infra_error — a cryptic infra error → its family + the verified fix (library-first, ~150ms, no LLM on a hit). 46 families.
  • detect_loop — catch a repeating tool-call loop mid-run before the step limit.
  • budget_guard — catch token / step / context / cost overruns mid-run.
  • what_others_did — anonymized cross-agent outcomes for a failure class.
  • diagnose_trace — full multi-step trace diagnosis (metered).

What it does

On any tool-call error, the interceptor:

  1. Calls diagnose_infra_error (free, no token, no LLM, <150ms).
  2. Applies the three-factor gate — auto-apply a fix only when all are true:
    • confidence >= 0.85
    • source == "library" (a curated verified fix, not an LLM guess)
    • auto_safe == true (the fix is retry / refetch / config — reversible, side-effect-free)
  3. If the gate passes → applies the fix and retries once. If it fails → escalates to a human (logs the verdict). It never auto-applies a mutate or destructive fix (create/change state, money, auth grants).

It fails closed: when unsure, it escalates rather than acting.

Install

bash
# no install needed beyond the stdlib; drop the file in, or:cp snapback_interceptor.py your_agent/export SNAPBACK_MCP=https://api.snapback.sh/mcp   # default; the free tools need no token

Use

python
from snapback_interceptor import SnapbackInterceptor
heal = SnapbackInterceptor(    auto_apply=True,    on_escalate=lambda v: my_ops_inbox.log(v),   # human sees non-auto-safe verdicts    on_heal=lambda v: metrics.count("snapback.autoheal", family=v["family"]),)
# wrap any call that might raise:result = heal.run(call_solana_rpc, wallet, amount)
# or as a decorator:@heal.guarddef call_solana_rpc(wallet, amount): ...
# or manually on a caught error:verdict = heal.diagnose("BlockhashNotFound")if verdict["gate"]["auto_apply_ok"]:    ...apply verdict["fix"] and retry...

The gate contract (returned by Snapback)

diagnose_infra_error returns {matched, family, fix, confidence, source, action_class, auto_safe, gate}. action_class is one of:

classmeaningauto-safe?
retryre-run with backoff (idempotent)✅
refetchre-fetch/re-price/re-sync then re-apply✅
configclient-side param change (raise max_tokens, serve intermediate cert)✅ (to suggest)
mutatecreates/changes external state, money, auth❌ escalate
destructivedeletes/reverts/irreversible❌ never

Defense in depth (1.8.3): even a reversible-class fix is down-graded to escalate if its text contains a destructive command (delete a pod, flush keys, drop a table). The gate returns gate.contains_destructive_step, so a fix can never auto-run a state-destroying step regardless of its action_class.

gate.auto_apply_ok is the ready-made verdict; the interceptor also re-derives it locally so a stale client can't over-trust.

Privacy & safety

  • 100% client-side. Talks only to the free public diagnose_infra_error endpoint.
  • Never sends your Snapback token for the diagnosis (diagnosis is free).
  • Snapback scrubs trace content server-side; this sends only the error string you pass.
  • Composes with bridge.py (post-mortem forwarding) — this is the live auto-heal layer.

Roadmap

  • submit_feedback on the retry outcome (did the fix work?) → feeds the shared library (the network effect).
  • Hermes + LangChain adapters (same gate, different framework hook).

来源:README.md,提交 18fcc9d

工具

23

diagnose_trace

Diagnose Trace

Diagnose why an AI agent run failed. Returns a structured verdict (failure_class, failed_at_step, root_cause, fix_suggestion, confidence). LATENCY: known patterns return library-instant (<1s); a NOVEL failure needs an LLM call and can take up to ~25s — set your client timeout to at least 30s, and treat this as async (don't block your agent loop on it).

输入参数trace必填

diagnose_batch

Diagnose Batch

Diagnose SEVERAL traces in one call (up to 20). Each trace is metered like a separate diagnose_trace. Returns a verdicts array (per-trace, order preserved); a bad trace in the batch is isolated and doesn't fail the rest. Use for post-run analysis of many failures at once instead of N round-trips.

输入参数traces必填

get_verdict

Get Verdict

Fetch a previously produced verdict by its id or by trace_id (your org only).

输入参数trace_idverdict_id

preflight

Preflight

BEFORE running: get known failure patterns for a given agent setup so you can avoid them. Returns a ranked list of {failure_class, root_cause, fix_suggestion} from Snapback's library. Call this before executing a plan and self-correct.

输入参数tagslimitagent_stack

submit_feedback

Submit Feedback

Tell Snapback whether a verdict was correct (correct=true/false), with an optional free-text note (did the fix work? what was wrong?). ONE rating per verdict — call it AFTER you act on a verdict and see the outcome. Your correction updates the SHARED pattern library (fix patterns are shared anonymized so every agent benefits; your trace content is never shared) — a right verdict comes back faster next time, a wrong one gets down-weighted. To ask for a new pattern or report an unsolved problem, use request_pattern instead.

输入参数notecorrect必填verdict_id必填

get_request_status

Get Request Status

Check what happened to a pattern you requested (from request_pattern's request_id). Returns pending / approved / rejected / in_library so you can see if your suggestion was actioned — the feedback loop isn't a black box. Free, no token.

输入参数request_id必填

my_usage

My Usage

See YOUR current usage + remaining allowance so you can self-govern spend: snapbacks (diagnoses) used/cap/remaining, guard checks used/cap/remaining, estimated spend, % used, and when it resets. Call it periodically to avoid surprises. Token-scoped, free.

无需输入参数。

my_impact

My Impact

See how your feedback + pattern requests have shaped the shared library — how many verdicts you've rated, patterns you've requested, and how many were approved into the library. Turns your input into visible collaboration. Token-scoped to you.

无需输入参数。

what_others_did

What Others Did

THE CROWD: for a failure_class (or pass the family/error and we'll map it), see what OTHER agents did about the same failure and whether it worked — anonymized, aggregated across everyone. Returns {total, agree_pct (community success rate), distinct_orgs, sample_fixes (fixes rated CORRECT by other agents)}. Use it when you hit a failure and want the crowd's verdict on what actually fixes it, not just the single library answer. Free, no token. Privacy-safe: only aggregate counts + a community success rate + the working fixes — never any org, agent, or trace identity. Hidden below a small min-sample so a single report can't be reverse-engineered. This is the network effect: the more agents use Snapback, the sharper this answer gets.

输入参数errorfailure_class

report_outcome

Report Outcome

Report the outcome of an auto-applied fix (the self-heal interceptor calls this after it gate-applied a fix and retried). Pass failure_class, family, fix, confidence, action_class, and succeeded (did the retry work?). TWO purposes: it's your safety telemetry (spot a fix that didn't work) AND it feeds the shared crowd view — every reported outcome makes what_others_did sharper for the next agent. Token-scoped (so we know it's your org), free.

输入参数fixfamilyfix_idsucceeded必填confidenceaction_classfailure_class必填

recommend_failover

Recommend Failover

Should you RETRY the same target, SWITCH provider, FALL BACK to another chain, or STOP? Pass the error + your configured topology (current_chain, available_chains, and/or current_provider, available_providers) and get deterministic routing advice with the reason — so a flaky Solana RPC doesn't get retried 5x when you should switch to Base. Free, no token, no LLM. Reads only what you tell it (no network calls).

输入参数error必填current_chainavailable_chainscurrent_provideravailable_providers

cascade_root

Cascade Root

Given an ORDERED list of errors from a run (oldest first), find the TRUE root — the error that cascaded or shouldn't have been retried — not just the final symptom you see. E.g. a 429 that got retried and triggered a downstream 401: the root is the 429, not the 401. Each error can be a string or {error, retried, action}. Free, no token, no LLM.

输入参数errors必填

suggest_budget_recovery

Suggest Budget Recovery

Approaching a token/context/cost budget mid-run? Pass your counters and get the LEAST-DISRUPTIVE recovery ranked: truncate context | switch to a cheaper model | batch steps | wrap up — scored by speed gained, accuracy lost, cost saved. Turns budget_guard's 'you're at 94%' into 'here's what to do about it'. Free, no token, no LLM.

输入参数tokens_usedcontext_usedtoken_budgetcost_used_usdcontext_windowrecent_actionscost_budget_usd

request_pattern

Request Pattern

Leave us a message: ask us to add a failure pattern to the library, or report a problem we couldn't diagnose well. Use this when diagnose_trace didn't have a good answer, when you keep hitting a failure we don't classify, or when you want a specific kind of problem supported. It goes straight to our roadmap/backlog. Free — no token needed.

输入参数kindcontextmessage必填verdict_id

detect_loop

Detect Loop

MID-RUN loop check (fast, no LLM, free). Send your recent steps DURING a run; get back whether you're stuck repeating a tool call and a concrete next move. Call this every few steps to catch a loop BEFORE you burn your step budget — don't wait for a postmortem. Non-blocking advice, not a verdict.

输入参数steps必填threshold

session_start

Session Start

Open a LIVE mid-run session so Snapback can watch your run step-by-step and warn you in real time (loop / token / cost / context) - the always-on guardian mode. Returns a session_id. Free, no token. Call session_step as you run, session_end when done.

输入参数agent_id

session_step

Session Step

Report ONE step of a live run and get back any warnings immediately (loop detected / budget breach). Pass the step (action + inputs) and any counters you have (step, max_steps, tokens_used, token_budget, cost_used_usd, cost_budget_usd, context_used, context_window, task, recent_actions. context_window). Warnings are advisory - act on them to self-correct mid-run. Free.

输入参数step必填counterssession_id必填loop_threshold

session_end

Session End

Close a live session and get a short run summary (total steps, duration). Frees the session. Free, no token.

输入参数session_id必填

agent_memory

Agent Memory

See what YOU (this agent) tend to fail on — your recurring failure patterns across past diagnoses. Returns your top failure classes with counts and what share of your failures each is (e.g. 'loop_repeated_tool_call: 12 times, 40%'). Call it before a run to know what to guard against. Token-scoped to your own agent. Free.

输入参数limit

budget_guard

Budget Guard

Live MID-RUN budget check (fast, no LLM). Send whatever counters you have and get an advisory on context %, token burn, cost burn, step budget, and off-task drift - with concrete suggested_actions and the projected cost of NOT acting. Call it every few steps to catch a runaway BEFORE you hit a limit. Advisory only (never blocks). Params: step, max_steps, tokens_used, token_budget, cost_used_usd, cost_budget_usd, context_used, context_window.

输入参数steptaskformatmax_stepstokens_usedcontext_usedtoken_budgetcost_used_usdcontext_windowrecent_actionscost_budget_usd

convert_trace

Convert Trace

Turn your raw logs into a Snapback trace so you don't hand-craft JSON. Pass 'source' = a list of log/step entries, or an object with a spans/steps/messages/events/logs array (OTel spans, OpenAI/LangChain message lists, or generic {tool,input,output} arrays all work). Returns {trace} ready to pass straight to diagnose_trace. Free, no token.

输入参数hintsource必填

search_docs

Search Docs

Search Snapback's documentation for how to use it — how to format a trace, what each tool does, the failure taxonomy, auth, pricing, and errors. Free and needs no token. Call this first if you're unsure how to format a request or what a verdict means.

输入参数limitquery必填

diagnose_infra_error

Diagnose Infra Error

Diagnose a cryptic AGENT-INFRASTRUCTURE error — payments (x402/EIP-3009), Solana on-chain (ATA, blockhash, compute), MCP protocol, RPC/providers, EVM & Solana wallets, library of VERIFIED fixes the base model often gets wrong. Pass the error text (and optional context). Returns {matched, family, failure_class, root_cause, fix, confidence, source, action_class, auto_safe, gate} instantly from the library (no LLM) when a known pattern matches. Free and no token. GATE CONTRACT for autonomous action: auto-apply the fix ONLY when confidence>=0.85 AND source=='library' AND auto_safe==true (action_class is retry|refetch|config); NEVER auto-apply a 'mutate' or 'destructive' fix (create/change state, money, auth) — escalate those to a human. gate.auto_apply_ok gives you the verdict. Use it the moment you hit a transaction_simulation_failed, BlockhashNotFound, a -32xxx RPC code, a 4001/-32002 wallet error, an attestation failure, or any infra error you can't instantly resolve.

输入参数error必填actionformatcontext

版本历史

4
  1. v1.8.4最新Oct 2, 2026
  2. v1.8.3Oct 1, 2026
  3. v1.8.2Sep 22, 2026
  4. v1.7.0Sep 21, 2026

评分

已满足适用检查项的 90%

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

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

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