{
  "markdown": "# 402sentinel-mcp\n\nMCP tools that let your AI agent **check an x402 counterparty's risk before it\npays** — and turn that risk into an enforceable wallet spending policy. Give it a\npayTo address, get back a 0–100 risk score + an `allow` / `review` / `block`\ndecision, scored from on-chain settlement behaviour on Base (address age,\nfacilitator-aware payer diversity, settlement maturity) + a delivery-outcome\nflywheel, with honest confidence/coverage.\n\nTools — vet the **seller**:\n- `assess_counterparty` ($0.002) — risk score + decision + a ready-to-apply `recommended_policy`\n- `assess_counterparty_deep` ($0.02) — same, scans more on-chain history\n- `recommend_policy` ($0.002) — decision + wallet-ready spending policy (caps, denylist, approval)\n- `report_outcome` (free) — after paying, report delivery to train the reliability flywheel\n\nTools — vet the **payment itself** (buyer-side):\n- `firewall` ($0.002) — should YOUR agent make THIS payment now? Catches fraudulent routing (payTo swapped vs the address you usually pay), drain velocity, overcharge, and injection-sourced instructions. `agent_id` + a wallet-ownership signature are attached automatically from your configured wallet — trusted routing history with no extra steps.\n- `firewall_record` (free) — seed your agent's payment history so the firewall has a behavioural baseline.\n- `firewall_outcome` (free) — after a verdict, report what actually happened (fraud / legit / …) so the firewall learns which signals are predictive and downweights noisy ones (safety signals stay deterministic).\n\nTools — vet the **asset** and the **flow**:\n- `assess_rwa` ($0.02) — RWA risk gate: score a **tokenized asset** (treasury/stock/credit) before buying it. Proxy-aware transfer-restriction scan + behavioral transfer simulation — catches permissioned securities an agent can buy but **not transfer or redeem** (trapped funds), live pause state, issuer identity + issuer sanctions.\n- `compliance_check` ($0.02) — pre-pay compliance screen: OFAC sanctions (hard block), counterparty due-diligence tier, structuring/smurfing detection, FATF Travel-Rule threshold (informational). Not legal advice.\n- `verify_service` ($0.02) — opt-in **402Sentinel Verified** badge: submit your own payTo for a deep settlement-graph audit; pass → signed time-boxed credential + public allow-list. Failures stay private.\n\nIt's a thin client for the hosted service at **https://402sentinel.com** — the\nscoring model and facilitator-identification logic live server-side (closed); this\npackage only forwards the request and pays for it, so it's open source.\n\n## Quickstart — gate a payment in 5 lines\n\nBefore your agent pays **any** x402 counterparty, ask the firewall; if it doesn't say\n`allow`, don't pay. No MCP needed — any standard x402 v2 client works:\n\n```ts\nimport { x402Client, x402HTTPClient } from \"@x402/core/client\";\nimport { registerExactEvmScheme } from \"@x402/evm/exact/client\";\nimport { privateKeyToAccount } from \"viem/accounts\";\n\nconst client = new x402Client();\nregisterExactEvmScheme(client, { signer: privateKeyToAccount(process.env.AGENT_KEY) });\nconst http = new x402HTTPClient(client);\n\nconst body = JSON.stringify({\n  payment: { payto_address: target, amount, resource_url },\n  context: { source: \"web_content\", untrusted_text: pageYouActedOn },   // pass what you scraped\n});\nconst url = \"https://402sentinel.com/api/firewall\";\nconst init = (h = {}) => ({ method: \"POST\", headers: { \"Content-Type\": \"application/json\", ...h }, body });\nconst r1 = await fetch(url, init());\nconst pr = http.getPaymentRequiredResponse((n) => r1.headers.get(n), await r1.json());\nconst payment = http.encodePaymentSignatureHeader(await http.createPaymentPayload(pr));\nconst data = await (await fetch(url, init(payment))).json();\n\nif (data.decision !== \"allow\") throw new Error(`402Sentinel ${data.decision}: ${data.recommended_action}`);\n// …safe to pay `target`.\n```\n\nThat one $0.002 call catches **fraudulent routing** (payTo swapped vs the address you\nusually pay), **prompt-injection payments** (a payTo that appeared in `untrusted_text`),\n**drains**, **overcharges**, and **sanctioned/illicit** counterparties.\n\n**In an MCP framework** (Claude, Cursor, …) instead, just add the server — your agent gets\nall 10 tools by name (see Configure below):\n\n```jsonc\n{ \"mcpServers\": { \"402sentinel\": { \"command\": \"402sentinel-mcp\", \"env\": { \"CLIENT_PRIVATE_KEY\": \"0x…\" } } } }\n```\n\n## Install\n\n```sh\nnpm i -g @kaditang/402sentinel-mcp\n```\n\n## Configure\n\nAdd to your MCP client (Claude Desktop, Cursor, etc.):\n\n```jsonc\n{\n  \"mcpServers\": {\n    \"402sentinel\": {\n      \"command\": \"402sentinel-mcp\",\n      \"env\": {\n        \"CLIENT_PRIVATE_KEY\": \"0x...  // a Base wallet holding USDC on-chain (no ETH/gas needed)\"\n      }\n    }\n  }\n}\n```\n\nPaid calls cost from **$0.002** (shallow) to **$0.02** (deep), paid automatically\nin USDC via standard x402 (`exact` EIP-3009 on Base — the facilitator submits the\ntransfer, so the buyer needs no gas) from the configured wallet. The free tools\nneed no key.\n\n## Use\n\nThe agent calls it before authorizing a payment:\n\n```\nassess_counterparty({\n  target: { payto_address: \"0x...\" },\n  payment_context: { amount: 10, asset: \"USDC\" },\n  policy: { block_at_score: 70, review_at_score: 40 }\n})\n→ { decision: \"review\", risk_score: 52, confidence: 0.41, coverage: {...},\n    dimensions: [...], recommendation: \"...\",\n    recommended_policy: { action: \"limit\", max_payment_usdc: 5, daily_cap_usdc: 15,\n                          add_to_denylist: false, require_human_approval: true } }\n```\n\n- `block` / `deny` → don't pay\n- `review` / `limit` → cap exposure / escrow (use `recommended_policy` for the caps)\n- `allow` → proceed\n\n`recommend_policy(...)` returns just the decision + `recommended_policy` — apply\n`max_payment_usdc` / `daily_cap_usdc` / `add_to_denylist` directly to your agent\nwallet's spending limits. After paying, call `report_outcome({ assessment_id,\noutcome })` to improve future scores.\n\n## Disclaimer\n\nAlgorithmic risk signal, informational only — **not advice, not an endorsement,\nand not an accusation** about any party. Scores are probabilistic estimates from\nlimited public on-chain data and heuristics, and may misclassify. Do your own due\ndiligence; don't rely on it as your sole basis to pay or refuse. See\nhttps://402sentinel.com/terms.\n\nMIT.\n",
  "bytes": 6330,
  "sha": "eb9280f4f14c71c5c5f9ca8f11660092b5eb6c13595812ace259956e1790a8a6",
  "repo_slug": "kaditang/402sentinel-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_kaditang_402sentinel_mcp_39c95879/readme"
}