streamable-httpupdated 12d ago
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.
What can you do with OnchainDiligence?
OnchainDiligence โ MCP Server
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.
What it does
An agent connects over Streamable HTTP and finds five tools:
| Tool | Description | Price |
|---|---|---|
screen_wallet |
Screen a wallet address against the Chainalysis on-chain sanctions oracle (US/EU/UN lists). | $0.01 |
screen_name |
Fuzzy-match a person or company against OFAC SDN names and strong aliases. | $0.02 |
verify_uk_company |
Look up a UK company by registration number: status, type, incorporation, registered address, and people with significant control. | $0.05 |
verify_us_company |
Resolve a public US company through SEC EDGAR. | $0.05 |
diligence |
Run wallet and UK-company checks in parallel, without claiming a verified link between them. | $0.05 |
The tools use the same underlying public-data sources as the HTTP API. They are separate deployments, so response-level equivalence must be enforced by contract tests rather than assumed.
How payment works
Payment rides on x402, the open agent-payment standard built on HTTP 402 Payment Required:
- The agent calls a tool with no payment attached.
- The server returns the payment requirements (amount, asset, recipient, network).
- The agent signs a USDC payment authorization from its own wallet.
- The agent retries the call with the payment in the tool-call
_meta. - The server verifies and settles via the Coinbase facilitator, runs the check, and returns the result.
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.
Two payment rails by design
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.
Architecture
agent (MCP client + x402 wallet)
โ Streamable HTTP
โผ
index.ts โโโโโโโโโโโโ Hono app, routes /mcp to the handler
โผ
src/server.ts โโโโโโโ createPaidMcpHandler: 5 paidTools, x402 gating
โ
โโโ src/chainalysis.ts โโโโ sanctions oracle read (viem, Ethereum mainnet)
โโโ src/companiesHouse.ts โ UK Companies House lookup
src/server.tsโ defines the fivepaidTools 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 bysrc/local.ts.test/client.tsโ a low-level test client that performs the full x402 pay-and-retry loop by hand (see Design notes).
Sanctions data
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.
Running locally
Requires Node 22+.
npm install
cp .env.example .env # fill in the values below
npm run dev # serves http://localhost:3000/mcp
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. |
ATTESTATION_SERVICE_TOKEN |
Server-to-server credential for the API's internal attestation service. Required for signed results; never expose it to browser code. |
To exercise the full paid loop against the running server:
# in .env, also set PAYER_PRIVATE_KEY to a wallet funded with testnet USDC + ETH
npm run test:client
Design notes
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-mcppackage 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-mcpships awithPaymenthelper, but it imports an MCP client API (experimental_MCPClient) that theaiSDK removed in v5. Rather than pin an oldaiversion,test/client.tsperforms the x402 loop directly on the MCP SDK plusx402/clientโ calling unpaid to get requirements, building a payment header, and retrying with payment in_meta. The server itself doesn't depend onai, so this is a test-only concern. -
Public-data clients are currently duplicated.
chainalysis.tsandcompaniesHouse.tsbegan as copies of the HTTP API implementations. They can drift, so the remediation roadmap moves them behind a shared service/package and adds contract tests.
Not a compliance program
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.
Security
Found a vulnerability? Please report it to security@onchaindiligence.com. Responsible disclosure is appreciated. See onchaindiligence.com/.well-known/security.txt.
License
MIT โ see LICENSE.
Install
Add OnchainDiligence to your client. Pick the one you use.
claude mcp add --transport http onchaindiligence https://mcp.onchaindiligence.com/mcpcodex mcp add onchaindiligence --url https://mcp.onchaindiligence.com/mcp{
"mcpServers": {
"onchaindiligence": {
"url": "https://mcp.onchaindiligence.com/mcp"
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
{
"servers": {
"onchaindiligence": {
"type": "http",
"url": "https://mcp.onchaindiligence.com/mcp"
}
}
}Add to `.vscode/mcp.json` in your workspace.
{
"mcpServers": {
"onchaindiligence": {
"url": "https://mcp.onchaindiligence.com/mcp"
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"onchaindiligence": {
"serverUrl": "https://mcp.onchaindiligence.com/mcp"
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
Score
39 / 100
Incomplete
- Documentation25/25
- Maintenance19/25
- Trust6/20
- Capability0/15
- Install experience12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 4 days ago
- Has a release history
- Repository is not archived
- No licence detected
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 0 tool(s) documented
- Provides prompt templates
- Provides resources
- 6 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint โ no local install
Version history
| Versions | Published |
|---|---|
| 1.1.0Latest | Jun 27, 2026 |
| 1.0.0 | Jun 21, 2026 |