s2ar/ mcp

s2ar in Claude Code, Codex and Claude — the MCP server

Add it in one line and start with no key: ten calls a day on each tool, every answer with a receipt, every verdict a signed record.

claude mcp add s2ar --transport http https://api.s2ar.dev/mcp

Or install the plugin, which adds three skills that teach the agent when to assert an output and when to inspect an endpoint, and a hook that adds one line under an answer when JSON went out unasserted or an x402 endpoint was named and not inspected. A hook never makes a paid call.

claude plugin marketplace add https://github.com/codylwalker/sym
claude plugin install s2ar@starlab

A key, when you want one, goes in --header "Authorization: Bearer …" on the one-liner or in the plugin's api_key setting (/config). Measured (2026-10-10T2309Z, 16 sessions per arm, claude-sonnet-5, 8 tasks × 2 runs): final outputs pass 100% with the plugin and 100% without — no gain to claim on these eight tasks — at a median paired session cost +79.2% (asserting is turns: a median of 3.5 against 1.0; cheaper on 2 of 8 tasks); the plugin arm asserted before returning in 10 of 16 sessions, counting only calls that ran. The first day (2026-10-10T1447Z, 94% vs 88%) is withdrawn as a comparison: its plugin sessions never had the server loaded and its counter counted denied attempts as assertions. Every run is in bench-s2ar/results, losses included.

Use it from Claude

In Claude (web or desktop) add a custom connector with the URL https://api.s2ar.dev/mcp/directory and no authentication: ten read-only tools (the directory surface carries no payment path and no watch), each answering a few calls a day free; a key from get a key pasted as the connector’s bearer token adds credits at half a cent to a cent a call. That surface carries no payment path inside a tool (no buy_credits, no per-call USDC argument): a spent free sample answers with the price, the free samples and where a key comes from. Agents that pay per call keep using https://api.s2ar.dev/mcp. Every tool declares a title and whether it is read-only; a call that fails is never charged.

claude mcp add s2ar --transport http https://api.s2ar.dev/mcp --header "Authorization: Bearer sk-lens-…"

With a key, the same line. Your coding agent gains ten tools over its own outputs, any public repository and any image: its output asserted (JSON schema, terms, citations, quotations found in a source; a signed record), a repo map fitted to a token budget, a file's skeleton, one function's source, code search by name or by meaning, a text graded against a form, an image certified (compressed, then proven still readable by a vision model, as a signed record), and buy_credits. Every paid answer carries a receipt; a failed call is never charged.

1. Get a key — or skip it

A key comes from a card pack: $5 · $25 · $100. The key is shown once after checkout, with these snippets filled in. No account is needed; signing in with an email instead grants $1 to start. An agent with a USDC wallet on Base needs no key at all: every paid tool takes an optional x402_payment argument (see paying without a key below).

2. Add it to your agent

Claude Code is the one-liner above. Codex, in ~/.codex/config.toml:

[mcp_servers.s2ar]
url = "https://api.s2ar.dev/mcp"
http_headers = { Authorization = "Bearer sk-lens-…" }

Any other MCP client: Streamable HTTP, POST https://api.s2ar.dev/mcp, the Authorization header on every request. A keyless call is answered, not refused: a few calls a day are free, and after that the tool returns payment required with the price, the x402 accepts, the card packs and how_to_pay.

Tools it exposes

toolargumentsreturnsprice
sym_map_reporepo, ref?, budget?files ranked by who imports them, each with its definitions, fitted to the budget — start here$0.01
sym_ls_reporepo, ref?, fileevery function, type and method in the file with line ranges, no bodies$0.005
sym_read_reporepo, ref?, file, symbolone symbol's source with its doc comment$0.005
sym_find_reporepo, ref?, name, prefix?every definition of a name, with file and lines$0.005
sym_where_reporepo, ref?, query, k?the definitions that best match a question by meaning (the first call on a repo answers "indexing"; call again in ~20 s, nothing charged)$0.01
score_texttext, form | specmeter, rhyme and line checks against a form, gated (line count, content, identical end words, floors), each gate with its evidence, the dictionary named; a signed record$0.005
assert_outputtext | json, checks | rubric, source?, schema?every check's verdict with its evidence (the offset, the count, the missing key) and a signed record; GET /v1/assert/checks lists the kinds and rubrics$0.005
inspect_x402resource, method?, checks?one unpaid probe of an x402 endpoint and eleven checks on what it declares (the 402, accepts, price, Bazaar extension, Coinbase's validator); a signed point-in-time record$0.005
certify_imageimage_url | image_b64, probe?the image compressed to the smallest version a vision model reads the same way, as a signed Assay record anyone can verify free$0.01
buy_creditsusd?the card-pack links and the Machine Payments Protocol link, and the header to send afterwardsfree

repo is owner/repo (GitHub), github.com/owner/repo, or an https URL on github.com, gitlab.com or codeberg.org. Ten languages: Rust, Python, TypeScript/TSX, JavaScript, Go, Lua, C, C++, Java, Ruby. Only public repositories are read; checkouts are cached for an hour and never logged.

Paying without a key (x402)

A tool called without a key answers payment required carrying accepts (USDC on Base, the amount, the payee) and x402_v2 (the resource to sign for). Sign accepts[0] with any x402 client, then call the same tool again with the base64 payload as x402_payment. The server verifies it, does the work, settles only once the answer exists, and returns the settlement in the result's _meta.payment_response. The same payload works over plain HTTP as the PAYMENT-SIGNATURE header on https://api.s2ar.dev/x402/v1/….

The same tools over HTTP

curl "https://api.s2ar.dev/v1/sym/read?repo=BurntSushi/ripgrep&ref=14.1.1&file=crates/core/flags/defs.rs&symbol=Glob%20as%20Flag" \
     -H "Authorization: Bearer sk-lens-…"
curl "https://api.s2ar.dev/v1/certify?image_url=https://s2ar.dev/examples/media/invoice.png&probe=ocr" \
     -H "Authorization: Bearer sk-lens-…"

Every route takes GET with query parameters or POST with a JSON body. The OpenAPI with prices and examples: api.s2ar.dev/openapi.json; the worked examples, each receipt re-derived: s2ar.dev/examples.

Local and free

The code reads also run on your machine, free: cargo install starlab-sym gives the sym CLI and an MCP server over stdio; the Claude Code plugin (claude plugin marketplace add https://github.com/codylwalker/sym && claude plugin install sym@starlab) makes a whole-file Read of a big source file come back as its skeleton. The lens@starlab plugin does the same for images: a whole-image Read over 1024 px comes back downscaled. The sym page →

Troubleshooting