Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"x402-api": {
"args": [
"@x402-api/mcp-server"
],
"command": "npx"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
MCP server that gives Claude, ChatGPT, and any MCP-compatible AI agent access to pay-per-call crypto/DeFi data via the x402 protocol.
Run this in your terminal to verify the server starts. Then let us know if it worked — your result helps other developers.
npx -y '@x402-api/mcp-server' 2>&1 | head -1 && echo "✓ Server started successfully"
After testing, let us know if it worked:
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
Checked @x402-api/mcp-server against OSV.dev.
Click any tool to inspect its schema.
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in finance
Let AI agents create, discover, and track tokens across chains via Printr.
Real-time financial market data: stocks, forex, crypto, commodities, and economic indicators
Swiss accounting integration for Bexio. 310 tools for invoices, contacts, projects.
Brazilian public procurement (PNCP) and Federal Revenue CNPJ data — 16 tools, 4 prompts.
MCP Security Weekly
Get CVE alerts and security updates for io.github.fernsugi/x402-api and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
MCP server that gives Claude, ChatGPT, and any MCP-compatible AI agent access to pay-per-call crypto/DeFi data via the x402 protocol.
8 tools. No API keys. AI agents pay USDC micropayments on Base, per request.
██╗ ██╗██╗ ██╗ ██████╗ ██████╗
╚██╗██╔╝██║ ██║██╔═══██╗╚════██╗
╚███╔╝ ███████║██║ ██║ █████╔╝
██╔██╗ ╚════██║██║ ██║██╔═══╝
██╔╝ ██╗ ██║╚██████╔╝███████╗
╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝
| Tool | API Endpoint | Cost | Description |
|---|---|---|---|
get_crypto_prices | GET /api/price-feed | 0.001 USDC | BTC/ETH/SOL + top 24h movers |
get_gas_prices | GET /api/gas-tracker | 0.001 USDC | Multi-chain gas (ETH, Base, Polygon, Arbitrum) |
get_dex_quotes | GET /api/dex-quotes | 0.002 USDC | Swap quotes: Uniswap, SushiSwap, 1inch |
scan_token | GET /api/token-scanner | 0.003 USDC | Token security scan + rug-pull detection |
track_whales | GET /api/whale-tracker | 0.005 USDC | Holder concentration + whale alerts |
scan_yields | GET /api/yield-scanner | 0.005 USDC | DeFi yields: Aave, Compound, Morpho, Lido, Pendle |
get_funding_rates | GET /api/funding-rates | 0.008 USDC | Perp funding rates across 6 venues |
profile_wallet | GET /api/wallet-profiler | 0.008 USDC | Full wallet portfolio + risk profile |
Just run it — any 402 responses will return human-readable payment instructions:
npx @x402-api/mcp-server
Claude will tell you what's needed when a tool requires payment.
Install optional payment deps and set your wallet key:
npm install -g @x402-api/mcp-server
npm install -g x402-fetch viem
export X402_WALLET_PRIVATE_KEY=0x<your_private_key>
x402-api-mcp
The server will auto-pay 402 responses using USDC on Base. Make sure your wallet has USDC on Base mainnet.
Add to your claude_desktop_config.json:
{
"mcpServers": {
"x402-api": {
"command": "npx",
"args": ["@x402-api/mcp-server"]
}
}
}
{
"mcpServers": {
"x402-api": {
"command": "npx",
"args": ["@x402-api/mcp-server"],
"env": {
"X402_WALLET_PRIVATE_KEY": "0x<your_private_key>"
}
}
}
}
Config file location:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.json| Variable | Required | Description |
|---|---|---|
X402_WALLET_PRIVATE_KEY | Optional | Private key for auto-pay (e.g. 0x...). If set, x402-fetch handles payments automatically. |
X402_API_BASE_URL | Optional | Override API URL (default: https://x402-api.fly.dev) |
This API uses the x402 protocol — HTTP 402 Payment Required:
Payment details:
0x60264c480b67adb557efEd22Cf0e7ceA792DefB7get_crypto_pricesNo parameters. Returns current prices for BTC, ETH, SOL + top 24h movers.
Cost: 0.00
... [View full README on GitHub](https://github.com/fernsugi/x402-api-mcp-server#readme)