Routescore's modeled DeFi decision-support is available to agents and code two ways: as an MCP server you drop into Claude, Codex, Cursor, or any MCP-capable client, and as a keyed REST API you call from your own backend. Both speak the same trust-envelope contract. Each available MCP tool delegates to a corresponding keyed REST endpoint; tool availability differs by package version, transport, and environment as disclosed below.
Any signed-in tier can mint an API key. The pre-sign check_swap endpoint is
on the free agent tier (free 100/day, Pro 1,000, Power 10,000, per
account); the modeled-quote and scenario endpoints require the Power plan.
If a Power-only call reports a lower tier, upgrade on the pricing
page. Everything here is read-only decision support — it never
custodies assets, executes trades, or needs a private key or seed phrase.
Step 1 — Get an API key
- Open Account → Developer → API & MCP access at
/account. - Generate a key. Keys look like
rs_live_…and are shown once — copy it immediately and store it somewhere safe (a password manager or your platform's secret store). - Treat the key like a password. It carries your plan's quota; anyone with it can spend against your limits. Never commit it to source control or paste it into a public config.
Step 2, option A — Use it as an MCP server
The published @routescore/mcp
package is a thin, stateless wrapper around the API — nothing is stored locally.
Add it to your client config and set your key in the env block.
Claude Desktop (claude_desktop_config.json) or Cursor (.cursor/mcp.json):
{
"mcpServers": {
"routescore": {
"command": "npx",
"args": ["-y", "@routescore/mcp@latest"],
"env": {
"ROUTESCORE_API_KEY": "rs_live_your_key_here"
}
}
}
}Claude Code (CLI):
claude mcp add routescore --env ROUTESCORE_API_KEY=rs_live_... -- npx -y @routescore/mcp@latestRestart the client. You should see the Routescore tools appear. Ask the agent to
run whoami first — it confirms the key works and reports your plan tier. (The
server also checks the key shape at startup and exits with an actionable error
when ROUTESCORE_API_KEY is missing or obviously malformed.)
Building an agent that should use these tools with discipline? Install the agent skills for Routescore preflight — two SKILL.md files that teach the preflight-before-signing and verdict-relay workflow.
The published @routescore/mcp@latest package and live hosted /api/mcp
transport are currently 0.3.5 with eight tools. The source tree and
repository manifest prepare 0.4.0 with eleven tools for DEV previews:
owner-scoped record_execution and review_execution require an authenticated
Pro key, while
review_public_transaction is declared for contract discovery but disabled
against production. Promoting the hosted candidate or publishing the 0.4.0
stdio npm package remains founder-gated.
Set ROUTESCORE_API_URL in the same env block to override the base URL
(default https://www.routescore.io). For local development against a dev server,
use http://localhost:3000.
The tools
| Tool | What it does |
|---|---|
quote_mev_cover | Modeled premium estimate for MEV-sandwich exposure on a swap (modeled premium, expected/CVaR loss). |
quote_bridge_refund | Modeled premium estimate for cross-chain bridge execution failure vs a modeled SLA expectation. |
quote_lrt_slashing | Modeled premium estimate for slashing risk on an LRT position given AVS exposure. |
simulate_scenario | What-if Monte Carlo: modeled expected premium vs refund/loss over a horizon. |
check_swap | Pre-trade check before an agent signs: modeled route quality, price-impact / slippage band, modeled MEV/execution exposure where observable, and a registry-recognized-vs-unverified token read, as a clear / caution / unsupported verdict. Supports Ethereum (1) and Robinhood Chain (4663). Recognition is not safety, sellability, redemption, rights, liquidity, or investment-quality verification. Every keyed call also attempts to persist a hash-verifiable evidence record and returns its record_id — null, with a record_persistence_failed caveat, if the record store is unavailable. |
get_preflight_record | Fetch one persisted preflight evidence record by the record_id a check_swap call returned (owner-scoped to the key's account). The record embeds the original check response verbatim plus a canonical-JSON SHA-256 integrity hash so the evidence can be re-verified offline — see verifiable pre-sign evidence records. |
record_execution | (Source-tree/DEV-preview 0.4.0; Pro; absent from current production) Persist 1–100 complete personal-account execution_record.v1 documents for transactions executed elsewhere. A required stable idempotency key makes exact retries safe and conflicting reuse fails closed. MCP requests are capped at 32 KiB; use REST for larger batches. It never accepts signing material or executes a transaction. |
review_execution | (Source-tree/DEV-preview 0.4.0; Pro) Deterministically review one stored personal-account execution_record.v1 by UUID. Returns explicit evidence coverage, unavailable evidence, exceptions, caveats, and a canonical hash. It cannot query arbitrary public transactions, accept reviewer overrides, or certify best execution/compliance. Not present in published npm or hosted production 0.3.5. |
review_public_transaction | (Source-tree/DEV-preview 0.4.0; Pro, DEV-only and production-disabled) Review bounded public evidence for one Ethereum transaction hash without reading stored customer records. Receipt/block/gas/finality evidence is explicit; route, amounts, fees, arrival price, alternative benchmarks, dropped history, and historical reorg remain unavailable unless independently supported. Not present in published npm or hosted production 0.3.5. |
get_detector_manifest | Latest public MEV-detector run manifest (version hash + universe). |
whoami | Confirm the key works and report its plan tier. |
All quote_* results are modeled, point-in-time premium estimates —
decision support only, not a live cover, insurance, refund, or
premium-acceptance offer. Routescore does not underwrite risk.
Step 2, option B — Call the REST API directly
Prefer to call from a script or backend? Every tool maps to one endpoint under
https://www.routescore.io/api/public/v1. Authenticate with a bearer token.
Verify your key with GET /me:
curl https://www.routescore.io/api/public/v1/me \
-H "Authorization: Bearer rs_live_your_key_here"{
"authenticated": true,
"tier": "power",
"plan_includes_api": true,
"score_state": "valid"
}Request a modeled MEV estimate with POST /quote/mev — this returns a
modeled, point-in-time premium estimate for MEV-sandwich exposure, not a live
cover offer:
curl -X POST https://www.routescore.io/api/public/v1/quote/mev \
-H "Authorization: Bearer rs_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{ "notional_usd": 25000, "asset_pair": "USDC/ETH", "route": "uniswap-v3" }'The eleven-tool source-tree/repository DEV candidate maps to these REST endpoints. The published npm package and live hosted production endpoint expose the eight rows that are not marked source-tree/DEV-preview 0.4.0:
| MCP tool | Method | Endpoint |
|---|---|---|
quote_mev_cover | POST | /quote/mev |
quote_bridge_refund | POST | /quote/bridge |
quote_lrt_slashing | POST | /quote/lrt |
simulate_scenario | POST | /scenario/simulate |
check_swap | POST | /check/swap |
get_preflight_record | GET | /records/{record_id} |
record_execution | POST | /executions |
review_execution | GET | /executions/{record_id}/review |
review_public_transaction | POST | /executions/review |
get_detector_manifest | GET | /benchmark/manifest |
whoami | GET | /me |
Run a pre-sign check with POST /check/swap before an agent asks a user to
sign. This example scopes the check to Robinhood Chain (4663) and a tokenized
asset; the result remains decision support only and the token registry read does
not verify sellability, redemption, shareholder rights, custody, dividends, or
jurisdiction eligibility. For RHC tokenized stocks/ETFs, pass the Routescore
registry contract address; symbol-only checks are treated as unverified because
they are not contract verification:
curl -X POST https://www.routescore.io/api/public/v1/check/swap \
-H "Authorization: Bearer rs_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"notional_usd": 10000,
"chain_id": 4663,
"route": "uniswap-v3-rho",
"token_in": "USDG",
"token_out": "0xaF3D76f1834A1d425780943C99Ea8A608f8a93f9",
"slippage_allowance_bps": 75
}'Every evaluated check/swap response also carries two basis-regime gap-state
fields for tokenized assets: reference_price (reference-price freshness
state) and market_regime (market-open/closed regime flag). Tokenized assets
can trade on-chain around the clock while their reference instruments trade in
defined market sessions; until a basis observation source is live, these fields
report explicit unobserved states (unavailable with freshness: unknown /
regime: unknown for recognized tokenized assets, unsupported otherwise)
with caveats in-band — values are never guessed.
Agent policies may also declare three reserved basis-regime hooks —
max_basis_bps, max_reference_staleness_seconds, block_when_market_closed
— on POST /policy/evaluate. Reserved hooks are accepted but not evaluated
(there is no basis observation source yet): each one is surfaced in the
response's not_evaluated_fields with a basis_regime reason at your
policy's safe default, and is never treated as satisfied.
The complete, machine-readable schema for every endpoint — inputs, outputs, and
defaults — lives at
/api/public/v1/openapi.json.
Point your OpenAPI tooling or codegen at it.
What the responses tell you
Every check_swap, quote, and scenario response carries a trust envelope so agents and
dashboards never have to guess how much to trust a number. Render these fields
by default. Abbreviated example:
{
"score_state": "partial",
"source_freshness": {
"state": "partial",
"checked_at": "2026-06-21T00:00:00.000Z",
"sources": [
{ "name": "routescore_backend", "freshness_state": "fresh" },
{ "name": "bridge_risk_labels", "freshness_state": "unknown" }
]
},
"methodology_version": "routescore.public_api.v1",
"confidence_band": { "low": null, "high": null, "unit": "bps" },
"caveats": [
"Modeled, point-in-time decision support. Not an execution guarantee.",
"Unsupported or stale inputs widen uncertainty instead of hiding risk."
],
"commercial_disclosure": {
"paid_placement": false,
"score_influenced_by_partner": false
}
}score_state—valid,partial, or degraded.partialmeans some inputs were stale or unsupported; the estimate widens its uncertainty rather than hiding the gap.source_freshness— per-source freshness so you can see exactly which inputs were fresh, stale, or unknown at request time.confidence_band— the modeled uncertainty around the estimate, inbps.caveatsandcommercial_disclosure— plain-language limits, plus an explicit statement that estimates are not paid placements or partner-influenced.
Rate limits
The daily check_swap quota applies per account, shared across that account's
keys. Per-minute burst limits apply per key and scale with the plan. Read the
X-RateLimit-* and X-RateLimit-Daily-* headers and back off before a limit.
Routescore's API and MCP tools return modeled, point-in-time decision support — they are not a live cover, insurance, refund, or premium-acceptance offer, and not investment, legal, or tax advice. Routescore does not underwrite risk, custody assets, execute transactions, or guarantee outcomes. See how the Routescore is produced for the scoring methodology.