← All posts
How-to

How to connect Snapback to your agent: the skill, step by step

For developers and autonomous AI agents · ~6 min read

Snapback is a standard Model Context Protocol (MCP) server, so any MCP-capable agent connects and calls its tools — OpenClaw, GitHub Copilot, Hermes, Claude and Claude Code, Cursor, OpenAI Agents, or a custom client. Here's the whole flow, from zero to a diagnosed run.

The three URLs that matter

Tool discovery → https://snapback.sh/.well-known/mcp.json · Machine guide → https://snapback.sh/llms.txt · MCP endpoint → https://api.snapback.sh/mcp (Streamable HTTP, JSON-RPC 2.0)

Install — three ways, pick what fits

Snapback ships on three channels. The MCP server is the core; the plugin and skill make it automatic.

One version, three channels

The MCP server, the PyPI plugin, and the ClawHub skill all track the same release number (currently v1.7) — one Snapback version everywhere. Note: clawhub install installs relative to the current folder, so run it from your OpenClaw workspace, not a scratch dir.

One-click MCP config for the common clients (remote server, so it's just the URL):

# Claude Code
claude mcp add --transport http snapback https://api.snapback.sh/mcp

# Cursor / VS Code / Windsurf — an mcpServers entry:
# { "snapback": { "url": "https://api.snapback.sh/mcp", "transport": "streamable-http" } }

Step 1 — Register the MCP server

Point your agent framework at the endpoint. In OpenClaw, for example:

openclaw mcp add snapback --transport streamable-http \
  --url https://api.snapback.sh/mcp \
  --header "Authorization: Bearer $SNAPBACK_TOKEN"
openclaw mcp reload
openclaw mcp probe snapback    # confirm the tools are exposed

Other frameworks use their own MCP-add command with the same URL. The token is optional — many tools are free without one.

Step 2 — Use the free tools (no token)

Call tools via tools/call — not as top-level methods

The only top-level JSON-RPC methods are initialize, tools/list, tools/call. Calling a tool as a top-level method returns -32601 method not found. The result is in result.content[0].text as a JSON string — parse it.

{"jsonrpc":"2.0","id":1,"method":"tools/call",
 "params":{"name":"diagnose_infra_error",
           "arguments":{"error":"unable to get local issuer certificate"}}}

Step 3 — Diagnose a failed run

When a run fails, send the trace to diagnose_trace. The format is tolerant — send what you have; steps matter most:

diagnose_trace({trace: { final_status: "failed", steps: [
  {index:1, action:"web_search", inputs:{query:"X"}, status:"success"},
  {index:2, action:"web_search", inputs:{query:"X"}, status:"success"},
  {index:3, action:"step_limit", error:"limit", status:"failed"} ]}})

// → { id, failure_class: "loop_repeated_tool_call",
//      root_cause, fix_suggestion, confidence }

Content in inputs/outputs is redacted server-side — you don't pre-redact. The verdict returns a real id you can pass to get_verdict or rate with submit_feedback.

Step 4 — Pay only when you diagnose

Step 5 — Close the self-healing loop

  1. Before running: call preflight or agent_memory to see your recurring failure patterns.
  2. During: stream steps to a live session, or call detect_loop / budget_guard — act on the warnings.
  3. On failure: diagnose_trace, read the fix_suggestion + confidence, apply it, retry.
  4. After: submit_feedback so the shared library improves for every agent.
Latency — treat diagnose as async

Known patterns return in <1s (no LLM). A NOVEL failure needs an LLM call and can take up to ~25s — set your client timeout to >=30s and don't block your run loop on it. The mid-run guards and diagnose_infra_error are always <1s.

For AI agents

Machine-readable guide: https://snapback.sh/llms.txt · Tool discovery: https://snapback.sh/.well-known/mcp.json · MCP endpoint: https://api.snapback.sh/mcp. Free tools need no token; pay-per-call diagnosis via x402 on Solana or EVM (~$0.0032 USDC).

Try Snapback freeRead the docs