anchor-x402-mcp
9-tool MCP server for the anchor-x402 commodity services: dual-chain hash anchoring (Base + Solana), OFAC sanctions screening, signed decision attestation, mainnet tx decode, ENS/SNS name resolution, USD spot price, EVM calldata decode, datetime parser, and bundled wallet intelligence. Agents pay $0.001–$0.010 USDC per call directly from a Base wallet via x402 — no API keys, no accounts.
README
anchor-x402-mcp
MCP server exposing all 9 anchor-x402 services as tools any Claude Desktop / Cursor / Codex / Continue agent can call. Pay-per-use USDC via x402 on Base mainnet — no API keys, no subscriptions.
What an agent gets
Nine tools, $0.001–$0.010 per call:
| Tool | Price | What it does |
|---|---|---|
anchor_hash |
$0.005 | Anchor any 32-byte hash to Base + Solana mainnet in parallel; returns both tx URLs |
screen_wallet |
$0.001 | OFAC SDN sanctions screening for any EVM or Solana wallet |
attest_decision |
$0.010 | Verify a wallet signature over (input_hash, output_hash, decision); dual-chain anchor the result |
decode_tx |
$0.001 | Structured decode of any mainnet tx (Base / Ethereum / Solana) |
resolve_name |
$0.001 | Cross-chain name resolution (ENS, Bonfida SNS) |
token_price |
$0.001 | USD spot price for any token by symbol or chain+contract |
decode_calldata |
$0.001 | 4byte selector + ABI param decode for raw EVM calldata |
parse_datetime |
$0.001 | Freeform datetime string → structured ISO 8601 |
intel_wallet |
$0.005 | Bundled wallet intelligence: balances + activity + identity + sanctions in one call |
The MCP server pays for itself — your wallet gets debited automatically for each call. No prepay, no API key, no account.
Install
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"anchor-x402": {
"command": "npx",
"args": ["-y", "anchor-x402-mcp"],
"env": {
"ANCHOR_WALLET_PRIVATE_KEY": "0xYOUR_BASE_WALLET_PRIVATE_KEY"
}
}
}
}
Restart Claude Desktop. Ask: "Anchor the hash 7646dda1564bde0ef3f3971f4c002962df64246da4aa1d8c47247e7632494710 on mainnet" — it'll call anchor_hash and pay $0.005 USDC from your wallet.
Claude Code
Add to your project's .mcp.json:
{
"anchor-x402": {
"command": "npx",
"args": ["-y", "anchor-x402-mcp"],
"env": {
"ANCHOR_WALLET_PRIVATE_KEY": "0xYOUR_BASE_WALLET_PRIVATE_KEY"
}
}
}
Codex CLI (OpenAI)
Edit ~/.codex/config.toml:
[mcp_servers.anchor-x402]
command = "npx"
args = ["-y", "anchor-x402-mcp"]
[mcp_servers.anchor-x402.env]
ANCHOR_WALLET_PRIVATE_KEY = "0xYOUR_BASE_WALLET_PRIVATE_KEY"
Restart codex. Type /mcp to confirm anchor-x402 shows in the loaded servers list.
ChatGPT Desktop
Settings → Integrations → MCP servers → Add server. Paste:
{
"command": "npx",
"args": ["-y", "anchor-x402-mcp"],
"env": {
"ANCHOR_WALLET_PRIVATE_KEY": "0xYOUR_BASE_WALLET_PRIVATE_KEY"
}
}
Save, restart, the 9 tools appear in any chat with tool-use enabled.
Cursor
Edit ~/.cursor/mcp.json (global) or <project>/.cursor/mcp.json (project-scoped):
{
"mcpServers": {
"anchor-x402": {
"command": "npx",
"args": ["-y", "anchor-x402-mcp"],
"env": {
"ANCHOR_WALLET_PRIVATE_KEY": "0xYOUR_BASE_WALLET_PRIVATE_KEY"
}
}
}
}
OpenAI Agents SDK (programmatic)
from openai_agents import Agent, MCPServerStdio
mcp = MCPServerStdio(
command="npx",
args=["-y", "anchor-x402-mcp"],
env={"ANCHOR_WALLET_PRIVATE_KEY": "0xYOUR_BASE_WALLET_PRIVATE_KEY"},
)
agent = Agent(name="researcher", model="gpt-4o", mcp_servers=[mcp])
Same package, same env, programmatic instead of config-driven.
Continue / Smithery / generic MCP client
Same shape — command: npx, args: [-y, anchor-x402-mcp], env carries your wallet key. The MCP SDK handles transport.
Or install via Smithery one-liner:
npx -y @smithery/cli install anchor-x402-mcp --client claude
(replace --client claude with cursor, codex, windsurf, etc.)
Run standalone
ANCHOR_WALLET_PRIVATE_KEY=0xYOUR_KEY npx anchor-x402-mcp
Speaks MCP over stdio. Pipe into any MCP-compatible client.
Funding your wallet
The wallet you set as ANCHOR_WALLET_PRIVATE_KEY needs USDC on Base mainnet. Any amount works — even $1 buys 100 anchor calls or 1000 commodity-tier calls. Send USDC to your wallet's Base address:
- USDC contract on Base:
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 - Bridge from Ethereum mainnet via bridge.base.org
- Buy directly on Coinbase and withdraw to Base
The MCP server signs payments via x402 — Coinbase's open HTTP-native micropayments protocol. Each request:
- Hits an
anchor-x402endpoint - Gets a 402 with payment requirements
- Server signs a USDC transfer authorization with your private key
- Retries the request with the signed payment — the API settles via Coinbase's facilitator
You see the response, your wallet's USDC balance ticks down by the call price. Sub-second, no ledger, no account.
Environment variables
| Variable | Required? | Purpose |
|---|---|---|
ANCHOR_WALLET_PRIVATE_KEY |
Yes for paid calls | EVM private key. The wallet pays for x402 calls. |
ANCHOR_API_URL |
No | Override the API base URL. Default: https://api.anchor-x402.com. Useful for development against a self-hosted fork. |
If ANCHOR_WALLET_PRIVATE_KEY is unset, paid tool calls return a friendly 402 message explaining how to set it. /health and /openapi.json (not exposed as tools, but reachable via direct curl) work without payment.
Security notes
- The private key lives in your MCP client's config file. Treat it like a hot wallet — only fund what you're willing to spend autonomously.
- Recommended: generate a fresh wallet specifically for agent use. Top up periodically; don't reuse a wallet that holds significant funds.
- The MCP server only signs USDC payment authorizations to anchor-x402's known treasury addresses (visible in the 402 response). It cannot drain your wallet to arbitrary addresses.
- Source code is fully open at github.com/hypeprinter007-stack/anchor-x402-mcp. Audit before installing.
Verifying anchor receipts
Every anchor_hash and attest_decision call returns Base + Solana tx URLs. These are independently verifiable on the public block explorers — agents can confirm an anchor exists without re-paying:
- Base:
https://basescan.org/tx/<base.tx>— Input Data field contains the merkle root - Solana:
https://solscan.io/tx/<solana.tx>— Memo program data contains the same hex
The on-chain bytes are the receipt; the API response is just a convenience wrapper around them. See the on-chain verifiability primer for the full verification recipe.
Troubleshooting
"Payment required (402). Set ANCHOR_WALLET_PRIVATE_KEY..." You haven't configured a wallet. Add the env var to your MCP config and restart Claude Desktop.
"Payment failed (402). The wallet may be out of USDC..."
Your wallet ran out. Send USDC on Base to the wallet address shown in the server's startup log (it logs payer=0x… to stderr).
"anchor-x402 request failed: ..."
Network or DNS issue. Check https://api.anchor-x402.com/health returns 200; if not, see the status page.
Links
- Live API: https://api.anchor-x402.com
- Site / trust portal: https://anchor-x402.com
- Status: https://anchor-x402.betteruptime.com
- Server source: https://github.com/hypeprinter007-stack/anchor-x402
- MCP server source (this repo): https://github.com/hypeprinter007-stack/anchor-x402-mcp
- x402 protocol: https://github.com/coinbase/x402
- MCP spec: https://modelcontextprotocol.io
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。