{
  "markdown": "# @x402-api/mcp-server\n\n<a href=\"https://glama.ai/mcp/servers/@fernsugi/x402-api\">\n  <img width=\"380\" height=\"200\" src=\"https://glama.ai/mcp/servers/@fernsugi/x402-api/badge\" alt=\"x402-api MCP server\" />\n</a>\n\n> MCP server that gives Claude, ChatGPT, and any MCP-compatible AI agent access to pay-per-call crypto/DeFi data via the [x402 protocol](https://github.com/coinbase/x402).\n\n**8 tools. No API keys. AI agents pay USDC micropayments on Base, per request.**\n\n```\n  ██╗  ██╗██╗  ██╗ ██████╗ ██████╗\n   ╚██╗██╔╝██║  ██║██╔═══██╗╚════██╗\n    ╚███╔╝ ███████║██║   ██║ █████╔╝\n    ██╔██╗ ╚════██║██║   ██║██╔═══╝\n   ██╔╝ ██╗     ██║╚██████╔╝███████╗\n   ╚═╝  ╚═╝     ╚═╝ ╚═════╝ ╚══════╝\n```\n\n## Tools\n\n| Tool | API Endpoint | Cost | Description |\n|------|-------------|------|-------------|\n| `get_crypto_prices` | `GET /api/price-feed` | 0.001 USDC | BTC/ETH/SOL + top 24h movers |\n| `get_gas_prices` | `GET /api/gas-tracker` | 0.001 USDC | Multi-chain gas (ETH, Base, Polygon, Arbitrum) |\n| `get_dex_quotes` | `GET /api/dex-quotes` | 0.002 USDC | Swap quotes: Uniswap, SushiSwap, 1inch |\n| `scan_token` | `GET /api/token-scanner` | 0.003 USDC | Token security scan + rug-pull detection |\n| `track_whales` | `GET /api/whale-tracker` | 0.005 USDC | Holder concentration + whale alerts |\n| `scan_yields` | `GET /api/yield-scanner` | 0.005 USDC | DeFi yields: Aave, Compound, Morpho, Lido, Pendle |\n| `get_funding_rates` | `GET /api/funding-rates` | 0.008 USDC | Perp funding rates across 6 venues |\n| `profile_wallet` | `GET /api/wallet-profiler` | 0.008 USDC | Full wallet portfolio + risk profile |\n\n---\n\n## Quick Start\n\n### Option A: Inspect mode (no payment needed)\n\nJust run it — any 402 responses will return human-readable payment instructions:\n\n```bash\nnpx @x402-api/mcp-server\n```\n\nClaude will tell you what's needed when a tool requires payment.\n\n### Option B: Auto-pay mode (fully autonomous)\n\nInstall optional payment deps and set your wallet key:\n\n```bash\nnpm install -g @x402-api/mcp-server\nnpm install -g x402-fetch viem\nexport X402_WALLET_PRIVATE_KEY=0x<your_private_key>\nx402-api-mcp\n```\n\nThe server will auto-pay 402 responses using USDC on Base. **Make sure your wallet has USDC on Base mainnet.**\n\n---\n\n## Claude Desktop Integration\n\nAdd to your `claude_desktop_config.json`:\n\n### Without auto-pay (inspect mode)\n\n```json\n{\n  \"mcpServers\": {\n    \"x402-api\": {\n      \"command\": \"npx\",\n      \"args\": [\"@x402-api/mcp-server\"]\n    }\n  }\n}\n```\n\n### With auto-pay\n\n```json\n{\n  \"mcpServers\": {\n    \"x402-api\": {\n      \"command\": \"npx\",\n      \"args\": [\"@x402-api/mcp-server\"],\n      \"env\": {\n        \"X402_WALLET_PRIVATE_KEY\": \"0x<your_private_key>\"\n      }\n    }\n  }\n}\n```\n\n**Config file location:**\n- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`\n- Windows: `%APPDATA%\\Claude\\claude_desktop_config.json`\n- Linux: `~/.config/Claude/claude_desktop_config.json`\n\n---\n\n## Environment Variables\n\n| Variable | Required | Description |\n|----------|----------|-------------|\n| `X402_WALLET_PRIVATE_KEY` | Optional | Private key for auto-pay (e.g. `0x...`). If set, x402-fetch handles payments automatically. |\n| `X402_API_BASE_URL` | Optional | Override API URL (default: `https://x402-api.fly.dev`) |\n\n---\n\n## How x402 Payments Work\n\nThis API uses the [x402 protocol](https://github.com/coinbase/x402) — HTTP 402 Payment Required:\n\n1. **Agent calls tool** → MCP server makes API request\n2. **Server returns 402** with payment details (amount, USDC address, Base network)\n3. **Auto-pay mode:** x402-fetch signs and submits payment, retries request automatically\n4. **Manual mode:** MCP returns 402 details so user/agent can arrange payment\n\n**Payment details:**\n- Token: USDC on Base mainnet\n- Address: `0x60264c480b67adb557efEd22Cf0e7ceA792DefB7`\n- Chain: Base (chain ID 8453)\n- Amount: 0.001–0.008 USDC per call (< 1 cent USD)\n\n---\n\n## Tool Reference\n\n### `get_crypto_prices`\nNo parameters. Returns current prices for BTC, ETH, SOL + top 24h movers.\n\n```\nCost: 0.001 USDC\n```\n\n### `get_gas_prices`\nNo parameters. Returns gas prices for Ethereum, Base, Polygon, Arbitrum — slow/standard/fast tiers.\n\n```\nCost: 0.001 USDC\n```\n\n### `get_dex_quotes`\nCompare swap quotes across DEXes.\n\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `from` | string | ✅ | Input token (e.g. `\"ETH\"`, `\"0x...\"`) |\n| `to` | string | ✅ | Output token (e.g. `\"USDC\"`) |\n| `amount` | string | ✅ | Amount to swap (e.g. `\"1.5\"`) |\n\n```\nCost: 0.002 USDC\n```\n\n### `scan_token`\nToken security scan — detects rug-pull flags, honeypot patterns, mint authority, etc.\n\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `token` | string | ✅ | Contract address or symbol (e.g. `\"PEPE\"`) |\n\n```\nCost: 0.003 USDC\n```\n\n### `track_whales`\nWhale tracking — holder concentration, Gini coefficient, recent large moves.\n\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `token` | string | ✅ | Contract address or symbol |\n\n```\nCost: 0.005 USDC\n```\n\n### `scan_yields`\nTop DeFi yield opportunities across Aave, Compound, Morpho, Lido, Pendle, etc.\n\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `chain` | string | ❌ | Filter by chain: `\"ethereum\"`, `\"base\"`, `\"arbitrum\"`, `\"polygon\"` |\n| `min_tvl` | number | ❌ | Minimum TVL in USD (e.g. `1000000`) |\n\n```\nCost: 0.005 USDC\n```\n\n### `get_funding_rates`\nPerpetual funding rates across Binance, OKX, Bybit, dYdX, GMX, Hyperliquid.\n\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `asset` | string | ❌ | Asset symbol (e.g. `\"BTC\"`, `\"ETH\"`). All assets if omitted. |\n\n```\nCost: 0.008 USDC\n```\n\n### `profile_wallet`\nFull wallet portfolio analysis — holdings, DeFi positions, activity, PnL, risk score.\n\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `address` | string | ✅ | Ethereum/Base wallet address (`0x...`) |\n\n```\nCost: 0.008 USDC\n```\n\n---\n\n## Development\n\n```bash\ngit clone https://github.com/fernsugi/x402-api-mcp-server\ncd x402-api-mcp-server\n\nnpm install\nnpm run build\nnpm start\n```\n\nTo test without a payment wallet, simply run and see the 402 responses:\n\n```bash\nnode dist/index.js\n```\n\n---\n\n## Links\n\n- [x402 API Landing Page](https://x402-api.fly.dev)\n- [x402 Protocol](https://github.com/coinbase/x402)\n- [Base Chain](https://base.org)\n- [ERC-8004 Agent Identity](https://eips.ethereum.org/EIPS/eip-8004)\n- [Agent #18763 on BaseScan](https://basescan.org/address/0x8004A169FB4a3325136EB29fA0ceB6D2e539a432)\n\n---\n\n## License\n\nMIT\n",
  "bytes": 6654,
  "sha": "3e49cc530de67d5bcdeeea56822d3b94460a433deae4e1b1dc85c4bd7f33aa85",
  "repo_slug": "fernsugi/x402-api-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_fernsugi_x402_api_74f228c3/readme"
}