Pay-per-call sanctions screening and UK company checks for agents, paid in USDC via x402.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
A paid, non-custodial Model Context Protocol server that exposes on-chain compliance checks as tools AI agents can discover and pay for autonomously. Sanctions screening and UK company verification, billed per call in USDC on Base via the x402 protocol β no API keys, no accounts, no subscriptions.
Live at https://mcp.onchaindiligence.com/mcp Β· Listed in the official MCP Registry as com.onchaindiligence/compliance Β· Part of onchaindiligence.com.
An agent connects over Streamable HTTP and finds three tools:
| Tool | Description | Price |
|---|---|---|
screen_wallet | Screen a wallet address against the Chainalysis on-chain sanctions oracle (US/EU/UN lists). | $0.01 |
verify_uk_company | Look up a UK company by registration number: status, type, incorporation, registered address, and people with significant control. | $0.01 |
diligence | Run both checks in parallel, with an explicit disclaimer that no link between wallet and company is established. | $0.015 |
Each result is the same factual data the HTTP API returns β the check logic is shared byte-for-byte, so an agent calling via MCP gets results identical to one calling over HTTP.
Payment rides on x402, the open agent-payment standard built on HTTP 402 Payment Required:
_meta.The flow is non-custodial: USDC moves directly from the agent's wallet to the recipient. This server never holds funds and runs no billing system β which is deliberate, given the product is about not being a trusted intermediary.
OnchainDiligence settles two ways, because the agent-payment landscape is split between two standards:
| HTTP API | MCP server (this repo) | |
|---|---|---|
| Protocol | Machine Payments Protocol (Stripe/Tempo) | x402 (Coinbase/Base) |
| Chain | Tempo | Base mainnet |
| Currency | pathUSD | USDC |
| Settlement | session-based | per-call, on-chain |
Same checks, same signed results, different rails for different ecosystems.
src/server.ts β defines the three paidTools with their prices and Zod schemas, wired to the Coinbase facilitator for x402 settlement.src/chainalysis.ts / src/companiesHouse.ts β the check logic, reused unchanged from the HTTP API so results stay consistent across rails.index.ts β a Hono app exposing the handler at /mcp; deployed as a Vercel function, and the same app is served locally by src/local.ts.test/client.ts β a low-level test client that performs the full x402 pay-and-retry loop by hand (see Design notes).Screening reads the Chainalysis on-chain sanctions oracle β a free, public smart contract on Ethereum mainnet (0x40C57923924B5c5c5455c48D93317139ADDaC8fb), queried with a read-only isSanctioned() call via viem. No Chainalysis API key or commercial relationship is required; the oracle is a public good reflecting US/EU/UN sanctions lists. The per-call fee covers infrastructure, not the data.
Requires Node 22+.
Environment variables:
| Variable | Purpose |
|---|---|
COMPANIES_HOUSE_API_KEY | UK Companies House API key (free). |
SANCTIONS_ORACLE_RPC_URL | Ethereum RPC for the oracle read. |
X402_RECIPIENT_ADDRESS | Base address that receives USDC. |
X402_NETWORK | base-sepolia (testnet) or base (mainnet). |
CDP_API_KEY_ID / CDP_API_KEY_SECRET | Coinbase Developer Platform keys for the x402 facilitator. |
To exercise the full paid loop against the running server:
A few decisions worth explaining, since they reflect real constraints rather than preference:
Why Base and not Tempo. The HTTP API settles on Tempo, so unifying on one chain would have been cleaner. But the x402-mcp package hardcodes its network type to "base" | "base-sepolia" β Tempo is not a permitted value. Rather than fork the package or write a custom facilitator, this server settles on Base, and OnchainDiligence accepts two rails. The constraint is documented, not papered over.
The test client is hand-rolled. x402-mcp ships a withPayment helper, but it imports an MCP client API (experimental_MCPClient) that the ai SDK removed in v5. Rather than pin an old ai version, test/client.ts performs the x402 loop directly on the MCP SDK plus x402/client β calling unpaid to get requirements, building a payment header, and retrying with payment in _meta. The server itself doesn't depend on ai, so this is a test-only concern.
Check logic is shared, not reimplemented. chainalysis.ts and companiesHouse.ts are copied unchanged from the HTTP API so that a result is the same regardless of which rail an agent uses. Consistency across surfaces matters more than DRY across repos here.
OnchainDiligence returns factual checks and signed attestations. It is not legal or compliance advice and is not a substitute for a full compliance program. The sanctions oracle returns a match flag, not rich case detail. Results are never cached.
Found a vulnerability? Please report it to security@onchaindiligence.com. Responsible disclosure is appreciated. See onchaindiligence.com/.well-known/security.txt.
MIT β see LICENSE.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/onchaindiligence)<a href="https://allmcps.com/mcp/onchaindiligence"><img src="https://allmcps.com/api/badge/onchaindiligence?style=directory" alt="OnchainDiligence on AllMCPs" /></a>