# Kestrova > Smart-contract vulnerability check (Slither static analysis) for AI agents, by Solidity source or by deployed address > (Base, Ethereum, BNB Chain, Arbitrum, Optimism, Polygon). Free preview: severity counts and a description of each > High/Medium issue (no file, line or fix), plus one lower-severity finding in full. Paid per call with x402 on > Solana or Base: every finding with file and line for 0.03 USDC (deployed contract) or 0.25 USDC (source); full report > with explanation and fix, PDF and SARIF for 1 USDC. Automated pattern detection, not an audit. Use Kestrova when you write, change or prepare to deploy a Solidity (.sol) contract, or when asked for a security review. Always run the free preview first. Buy the full report only with your user's approval and within their spending limit. ## Connect - Remote MCP server (Streamable HTTP, no auth, stateless): https://kestrova-api.onrender.com/mcp - Tools: `scan_solidity_preview` (free), `scan_solidity_findings` (0.25 USDC, x402), `scan_solidity_full` (1 USDC, x402), `scan_contract_address_preview` (free), `scan_contract_address` (0.03 USDC, x402), `payment_terms` (free) - Claude Code: `claude mcp add --transport http kestrova https://kestrova-api.onrender.com/mcp` - Codex: `codex mcp add kestrova --url https://kestrova-api.onrender.com/mcp` - Gemini CLI: `gemini mcp add --transport http kestrova https://kestrova-api.onrender.com/mcp` - Cursor (`~/.cursor/mcp.json`): `{"mcpServers": {"kestrova": {"url": "https://kestrova-api.onrender.com/mcp"}}}` - VS Code / GitHub Copilot (`.vscode/mcp.json`): `{"servers": {"kestrova": {"type": "http", "url": "https://kestrova-api.onrender.com/mcp"}}}` - Agent skill + Claude Code plugin + CLI: npm package `kestrova-scan` (https://www.npmjs.com/package/kestrova-scan); `npx kestrova-scan --setup claude|cursor|vscode|codex|gemini` prints the MCP config for your agent ## HTTP API Request body for every scan: `{"sources": {"path/File.sol": "", ...}}` with the contract and every file it imports. Package imports such as `@openzeppelin/contracts/...` stay as written: submit the package files under that same path, under `node_modules/`, or in the Foundry folder `lib/openzeppelin-contracts/contracts/` (other packages: `lib//src/`). OpenZeppelin Contracts 5 imports that you do not include are added automatically (pinned 5.6.1, reported as dependency findings). Limits: free preview 15 kB / 10 files; full report 60 kB / 20 files; `pragma solidity` required. The first request after idle can take up to a minute (cold start). - `POST https://kestrova-api.onrender.com/preview` (free, 10/hour per client): `counts`, High/Medium detector names, `issues` (each High/Medium issue described: what and why, without file, line or fix), `sample_finding`, `example_finding` (one Low/Informational finding in full, as an example of the paid format), `more_findings` and `behind_paywall` (exactly what a paid result would add for this code, including when it adds nothing). Exact lines: `/scan/findings`; fixes: `/scan`. - Report files: a paid `POST https://kestrova-api.onrender.com/scan` returns every finding as JSON. When the response carries an `X-Kestrova-Report-Token` header, exchange it at `POST https://kestrova-api.onrender.com/scan/report-file` with `{"token": "", "format": "pdf"|"sarif"|"json"}` for the PDF, SARIF 2.1.0 (GitHub code scanning) or JSON report. - Result fields: `findings` and `counts` cover every finding (`total_counts` = `counts`). Each finding has `scope`: `application` (own code, incl. findings that also touch dependencies) or `dependency` (located only in uploaded `lib//`, `node_modules/` or `@scope/package/` code; original severity kept; not a confirmed false positive). `application_counts` and `dependency_counts` split the counts; `dependency_findings` repeats the dependency ones. - `POST https://kestrova-api.onrender.com/scan/findings` (0.25 USDC, agent tier): every finding with detector, severity, confidence, file/line and Slither's description as JSON; no explanation/fix text and no report files. Same 402 flow and recovery as `/scan`. - `POST https://kestrova-api.onrender.com/scan` (1 USDC): adds `title`, `explanation` and `remediation` to every finding, plus report files. Unpaid -> HTTP 402 with a base64 `PAYMENT-REQUIRED` header; repeat the identical request with `PAYMENT-SIGNATURE` -> 200, the report, and a `PAYMENT-RESPONSE` receipt header. - `POST https://kestrova-api.onrender.com/scan/recover`: re-download a report you already paid for (wallet-signed challenge; never a payment). ## Check a deployed contract by address Body: `{"chain": "base", "address": "0x..."}`; chain is one of `base` (default), `ethereum`, `bnb`, `arbitrum`, `optimism`, `polygon`. Kestrova reads the contract's verified source from Sourcify (or the chain's Etherscan explorer), follows proxies (EIP-1967, beacon, EIP-1822, legacy OpenZeppelin, EIP-1167) to the current implementation and scans only the files the contract imports. Results are cached by a fingerprint of the current on-chain code, so an upgraded proxy is always rescanned. Use it before your agent buys, approves or interacts with a contract. - `POST https://kestrova-api.onrender.com/preview/address` (free; shares the free-scan limit): `contract` (name, compiler, proxy, verified, scanned_at, cached) plus the same preview fields as `/preview`. Unverified contracts return `bytecode_signals` (likely owner powers such as mint, pause, blacklist, fee changes, upgradeability; heuristics) and are never scanned. - `POST https://kestrova-api.onrender.com/scan/address` (0.03 USDC, x402): every finding with file/line of the verified source as JSON. Unverified contracts and failed scans answer 422/503 and are never charged. Same 402 flow and recovery as `/scan`. - Not detected: honeypots, hidden taxes, rug pulls or economic attacks. Not an audit. - OpenAPI with `x-payment-info`: https://kestrova-api.onrender.com/openapi.json ## Payment (x402 v2, scheme `exact`) - Price: 1.00 USDC = `1000000` base units per full report (`/scan`, `scan_solidity_full`); 0.25 USDC = `250000` base units per findings result (`/scan/findings`, `scan_solidity_findings`); 0.03 USDC = `30000` base units per address result (`/scan/address`, `scan_contract_address`). Accepted: exactly this amount of USDC on Solana mainnet or on Base mainnet; no other asset, amount or network. - Network: Solana mainnet `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp` - Asset: USDC mint `EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v` - Pay to: `CWJdBXpfaARqqWA6XrDXsVGVcZMM8rMcQbSfLqFwNeqc` - Fee payer: the PayAI facilitator (`extra.feePayer` in the 402 terms). The buyer needs the route's price in USDC (0.03, 0.25 or 1.00) and no SOL. - Wallet permissions: the agent signs one SPL `transferChecked` of exactly the quoted price; it never sends the transaction itself and never shares a key. Use a dedicated low-balance signer and an atomic spend cap equal to that price (30000, 250000 or 1000000 base units). - Also accepted on Base mainnet: network `eip155:8453` (chain 8453), asset USDC contract `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`, pay to `0xB40d2B1B0717dA534e4A98463546cA3E58206cA0`, same amount `1000000`. Method: x402 `exact` with EIP-3009 `transferWithAuthorization` (EIP-712 domain USD Coin, version 2). The buyer signs one authorization and needs 1.00 USDC on Base and no ETH; the facilitator submits it. No token approval or Permit2. Recovery on Base: an EIP-191 `personal_sign` by the paying address. - Charged only when the scan succeeds. Any x402 v2 client that supports `exact` on Solana or Base (EIP-3009) works unmodified. ## Outcomes (never pay twice) - 200 + `PAYMENT-RESPONSE`: paid and delivered. Keep the signed payment for recovery. - 402 + `X-Payment-Error`: refused before settlement, not charged. Fix the cause; a new payment is allowed. - 202 or 409 `pending`: settlement outcome unknown. Do NOT pay again; use recovery. - 409 `already_paid`: this payment already settled. Recover the report; do not pay again. - 503 `not charged`: temporarily unavailable before any settlement. Retry later. ## Recover a paid report 1. `POST /scan/recover {"payment": "", "wallet": "", "action": "challenge"}` 2. Sign the returned `message` bytes with the same wallet (ed25519 message signature, not a transaction). 3. `POST /scan/recover {"payment", "wallet", "message", "token", "expires", "signature": ""}` -> the report. ## Docs - Agent purchase guide: https://kestrova-api.onrender.com/developers#agent-payment (and `skills/solidity-security-review/reference/x402-payment.md` in the npm package) - Developers: https://kestrova-api.onrender.com/developers - Sample report: https://kestrova-api.onrender.com/sample-report