NullClear Protocol MCP
Autonomous deferred schema escrow, ERC-8004 reputation scoring, and KYA corporate liability mandate verifier for x402 AI agent payments on Base.
Hosted MCP Server
npx add-mcp 'https://nullclear.dev/mcp'Installs into Claude Code, Codex, Cursor and more
Documentation
NullClear (nullclear.com / nullclear.dev)
Non-Custodial Pre-Sign Firewall & EIP-712 Policy Co-Signer (
Check → Enforce → Monitor) — Powering Policy-Guarded Polymarket Execution (nullclear.com)
Flagship Live Consumer Vertical: Policy-Guarded Polymarket Execution (nullclear.com)
NullClear's Pre-Sign Firewall & EIP-712 Policy Co-Signer powers nullclear.com — a zero-custody Polymarket CLOB V2 execution and whale Copy-Tax audit terminal:
- 2026 Real Fee & Copy-Tax Calculator (
/calculator): Exact late-2026 category taker fee math (shares * feeRate * price * (1 - price)), fill-delay slippage, and Taker vs.postOnlyMaker (0% fee) comparison. - Indexable Whale Reality & Copyability Auditor (
/whale/[address]): Audits any wallet viadata-api.polymarket.com/v2+clob.polymarket.com/book, computing Naive PnL vs. Simulated Copier PnL (0.5¢,1.0¢,2.0¢slip), flagging 5m/15m crypto taker traps, and issuing Copyability Grades (A–F). - Copyable Whale Leaderboard (
/leaderboard): Ranked by Net Copier PnL (not deceptive raw PnL), filterable by category (Geopolitics 0% Fee,Politics,Sports,Economics,Crypto). - Non-Custodial Guarded Execution Terminal (
/terminal): Paper Mode (default ON, zero wallet setup) + Live CLOB V2 (@polymarket/client,pUSDon Polygon137,builderbytes32attribution viaNULLCLEAR_BUILDER_CODE,POLY_1271Deposit Wallet session key scaffold). Every allowed or blocked trade emits a verifiable public receipt athttps://nullclear.dev/receipt/[id]. - Live Whale Feed & BYO Webhooks (
/live): Cloudflare Worker cron polling watched whales viadata-api.polymarket.com/v2/trades, checking live CLOB best asks, persisting Copy-Tax verdicts (COPYABLEvsPASS - SLIPPAGE TOO HIGH) to D1, and pushing JSON or Discord Embed payloads to any user-supplied HTTPS webhook stored inpoly_policies(plus email watchlist capture on/whale/[address]and/leaderboard).
Core Protocol Engine (nullclear.dev)
Underneath nullclear.com, nullclear.dev runs the 7-chain Pre-Sign Security Firewall, Drop-In Guarded JSON-RPC, EIP-712 Policy Co-Signer (POST /v1/policy/cosign, POST /v1/policy/polymarket/cosign), 30-Day Watchtower, MCP server, and optional non-custodial x402 schema-escrow clearinghouse (/v1/clear, /v1/bazaar/*).
Architecture Overview
┌──────────────────────────────────────────┐
│ BUYER AGENT │
│ (@nullclear/x402-arbiter client/fetch) │
└─────────────────────┬────────────────────┘
│
1. Target request │ (Intercepted 402)
2. EIP-3009 signed│ & Schema defined
▼
┌──────────────────────────────────────────┐
│ NULLCLEAR ARBITER │
│ (Cloudflare Worker + Hono) │
│ - Sybil & Wash-Trade Engine │
│ - Deterministic JSON Schema Validator │
│ - EIP-712 Receipt Attestation │
└─────────────┬──────────────┬─────────────┘
│ │
3. Proxy Request │ │ 4. If Valid: Settle
with Escrow │ │ If Invalid: VOID ($0)
▼ ▼
┌──────────────────┐ ┌───────────────────┐
│ SELLER AGENT │ │ EIP-3009 SETTLE │
│ (HTTP 402 API) │ │ (USDC on Base) │
└──────────────────┘ └───────────────────┘
Monorepo Packages
| Package | Path | Description |
|---|---|---|
@nullclear/shared | packages/shared | Core constants (Base Mainnet 8453, Sepolia 84532), ERC-8004 ABIs, x402 V2 types, EIP-3009 & KYA EIP-712 schemas. |
@nullclear/worker-arbiter | packages/worker-arbiter | Cloudflare Worker Hono app handling deferred escrow clearing (/v1/clear), Sybil-resistant trust scores (/v1/score), KYA mandates (/v1/kya), and machine discovery honeypots (/llms.txt, /.well-known/*, /openapi.json). |
@nullclear/x402-arbiter | packages/x402-arbiter | Agent SDK (v1.7.0) providing createNullClearRpcUrl, createNullClearPassClient, NullClearClient (7-chain guard, dueDiligence, cosign, buyPass), and createNullClearFetch deferred x402 escrow. |
@nullclear/agentkit | packages/agentkit | Coinbase AgentKit ActionProvider (nullclearActionProvider v1.1.0), nullclear_preflight_guard, createNullClearWalletGuard, and Guarded JSON-RPC across 7 EVM/Solana chains. |
@nullclear/plugin-eliza | packages/plugin-eliza | ElizaOS 7-chain firewall plugin (v1.1.0: NULLCLEAR_SCAN_TOKEN, NULLCLEAR_SCAN_BATCH, NULLCLEAR_GUARD_CALLDATA, NULLCLEAR_API_KEY + real-time context provider). |
@nullclear/mcp | packages/mcp-server | Model Context Protocol server (v1.6.0, STDIO + Streamable HTTP at https://api.nullclear.dev/mcp) exposing 14 tools (nullclear_preflight_guard, 7-chain forensics, ERC-8004 reputation, KYA mandate, and x402 escrow). |
@nullclear/e2e-simulator | packages/e2e-simulator | Self-contained local simulator validating honest sellers, hallucination voids, 500 crash voids, and Sybil wash-trade detection. |
Protocol Guarantees
- Non-Custodial Deferred Settlement: Buyer authorizations are held in escrow by the arbiter and only executed via EIP-3009 if the seller fulfills the schema contract. If the seller returns invalid schema or error codes, settlement is discarded.
- Sybil & Wash-Trade Detection: Analyzes counterparty concentration graph. If $>60%$ of transaction volume comes from a single buyer address across $\ge 3$ transactions, a wash-trading penalty is applied and the
HIGH_COUNTERPARTY_CONCENTRATION_WASH_RISKflag is raised. - KYA (Know Your Agent) Corporate Liability Mandates: Cryptographically ties an on-chain agent wallet to a legally registered corporate entity with defined liability coverage and per-transaction limits.
- Machine Discovery & Self-Describing Agents: Complete
llms.txt,/.well-known/agent.json,/.well-known/x402.json,/.well-known/mcp.json, and OpenAPI 3.1.0 specifications.
What's New in v1.7.0 (Autonomous Pre-Execution Firewall Pro Suite)
- Self-Serve x402 Prepaid Passes (
POST /v1/pass/buy,$5 / $25 / $100 USDC) &<5msEdge KV Auth: Autonomous agents and teams can mintnc_live_...Bearer API keys with 2,000–100,000 credits via EIP-3009 USDC settlement, eliminating 1.5s per-call settlement overhead. - Drop-In Guarded JSON-RPC Safety Rail (
POST /rpc/:chain/:apiKey): Built for Autonomous AI Agents (AgentKit,ElizaOS,Virtuals,Rig) and Safe/DAO treasuries. Swap oneRPC_URLenv var across 7 chains — reads pass through via edge KV (0credits); every broadcast is pre-screened viaguardTransactionPreflightwith configurablefailMode=closed|openandtimeoutMsrace budgets. - Cryptographic EIP-712 Policy Co-Signer (
POST /v1/policy/register,/v1/policy/cosign): Evaluates programmable spend/tax/drainer policies and emits on-chain-verifiable EIP-712PolicyApprovalco-signatures only when all invariants pass. - 30-Day Continuous Cron Watchtower (
POST /v1/monitors) & Institutional Due-Diligence (POST /v1/bazaar/due-diligence,$0.10): Scheduled diffs on proxy slots, sell taxes, LP drops, and Solana mint/freeze authorities firing signed webhooks + signed clearance certificates. - 7-Chain 1-Call Pre-Sign Firewall (
POST /v1/guard&/v1/bazaar/guard) & Package Upgrades: Addedarbitrum,optimism,polygon,bscalongsidebase,eth,solana, recursive Multicall3/UniversalRouter/Safe unwrapping, EIP-712 Permit2/Seaport audits, Solana Token-2022 checks, statefuleth_simulateV1asset diffs, and published SDK updates (@nullclear/x402-arbiter@1.7.0,@nullclear/mcp@1.6.0,@nullclear/agentkit@1.1.0,@nullclear/plugin-eliza@1.1.0).
What's New in v1.6.0
- Dual-Facilitator Discovery (Coinbase CDP Bazaar + PayAI + 402index.io): Added Coinbase CDP EdDSA/ES256 JWT auth (
?facilitator=cdp/X-NullClear-Facilitator: cdp) and402index.iodomain verification (/.well-known/402index-verify.txt), getting all 7 / 7/v1/bazaar/*endpoints indexed live across Coinbase CDP Bazaar, 402index.io, and PayAI Discovery. - Multi-Chain Batch Firewall (
POST /v1/bazaar/scan-batch,$0.025 USDC) & D1 Param Telemetry: Scans up to15unique Base, Ethereum, and Solana tokens per request (D1 cache-first lookup + bounded parallel chunking engineered for Cloudflare Workers Paid), aggregatesEXECUTE_SAFE/CAUTION_HIGH_RISK/ABORT_CRITICAL_TRAPverdicts, logs sanitizedtarget_address/target_chain/query_typeinclearings, aligns/v1/bazaar/market-oracle&/v1/bazaar/auditto$0.005 USDC, and upgrades/v1/bazaar/token-securityto full multi-chain forensics (Base,ETH,Solana). - Interactive Security Wedge (
/firewall) & Agent Framework SDKs (@nullclear/x402-arbiter@1.6.0,@nullclear/agentkit@1.0.0,@nullclear/plugin-eliza@1.0.0): Plug-and-play pre-flight token & drainer-calldata firewalls for Coinbase AgentKit (nullclearActionProvider) and ElizaOS (nullclearPlugin).
What's New in v1.5.0
\$0.005Micro-Tier Pricing & Standard/.well-known/x402Resources: Aligned high-frequency Bazaar intelligence routes (/v1/bazaar/token-security,/v1/bazaar/wallet-risk,/v1/bazaar/verified-fetch) to\$0.005 USDC(5000atomic), added KV-cached top-level"resources": [...]+ machine-readable"guarantee"blocks on/.well-known/x402and/.well-known/agent.json, served RFC 9728/.well-known/oauth-protected-resource*and/.well-known/agent-registration.json, and prevented/llms.txtdocumentation false-positives in the Canary Auditor.- SDK & Shared v1.5.0 (
@nullclear/shared,@nullclear/x402-arbiter): AddedNullClearClientmethods for x402 directory discovery (discoverEndpoints) and zero-key forensics (scanToken,inspectContract,decodeCalldata,simulateTx), Bazaar/Guarantee TypeScript schemas, and Base RPC failover constants.
What's New in v1.4.0
- 13-Tool MCP Server & Streamable HTTP Endpoint (
https://api.nullclear.dev/mcp): Uniformnullclear_<verb>_<noun>tool suite (nullclear_scan_token,nullclear_inspect_contract,nullclear_decode_calldata,nullclear_simulate_transaction,nullclear_read_markdown,nullclear_discover_apis,nullclear_audit_paid_token,nullclear_score_wallet,nullclear_fetch_spot_price,nullclear_fetch_guarded,nullclear_execute_escrow,nullclear_check_reputation,nullclear_verify_mandate, with full legacy name compatibility) plus live/.well-known/glama.json,/.well-known/mcp.json, and/.well-known/mcp/server-card.jsonmetadata. - PayAI
settlement_pending& On-Chain EIP-3009 Recovery: Polls PayAI/settlepending settlements and verifiesAuthorizationUsed/ transaction receipts on Base Mainnet so confirmed payments returnHTTP 200and record clearings deterministically. - Bazaar Discovery & Paid Forensics: Emits
resource+serverExtensions.bazaarmetadata during facilitator settlement for PayAI/CDP Bazaar indexing, and enables$0.005(5000atomic USDC) EIP-3009 paid access on forensic endpoints alongside the 100 req/day free tier.
What's New in v1.1.0
- 🛡️ Deep Deterministic Value Invariants: Extend basic JSON schema validation with field-level semantic invariants (
gt,gte,lt,lte,eq,neq,minLength,maxLength,pattern,notContains, andmaxStalenessSeconds). Stale data or numeric drift triggers instant authorization voiding ($0 charged). - 🛑 Canonical LLM Refusal Guard: Automatically inspects text and JSON responses for common LLM refusal boilerplate (
"as an ai language model","i cannot fulfill this request","i am unable to assist", rate limits, and server error strings), treating refusal as non-delivery. - 🔀 Autonomous Multi-Seller Failover Routing: Callers can provide ordered fallback candidates (
fallbacks: [{ targetUrl, sellerAgentId, paymentSignatureHeader }]). If the primary seller crashes or fails validation, the Arbiter voids the primary authorization and automatically routes to the secondary candidate without roundtripping back to the client agent. - 🔒 Outbound Spend Firewall & Anti-Abuse Guards: Protect buyer agent wallets with per-call caps (
maxPerCallAtomic) and daily rolling spend policies (maxDailyWalletAtomic). Rejects self-clearing wash-loops (buyer address === seller address) and enforces minimum on-chain settlement floors.
Quickstart
Prerequisites
- Node.js $\ge 20$
- pnpm $\ge 9$
Install Dependencies
pnpm install
Build All Packages
pnpm build
Typecheck
pnpm typecheck
Run Tests
pnpm test
Run Live Autonomous E2E Simulator
pnpm demo