DeFi MCP
MCP server for DeFi data — real-time crypto prices, token analytics, wallet balances, and on-chain data across multiple chains.
defi-mcp
MCP server for DeFi & crypto — 12 tools for token prices, wallet balances, gas fees, and DEX quotes.
Give any MCP-compatible AI (Claude, Cursor, Windsurf, Claude Code) direct access to live on-chain data. No API key required.
Tutorial: How to set up with Claude & Cursor · REST API docs
Try it now (no setup)
The server is also hosted as a free REST API. Try these right now:
# Bitcoin & Ethereum prices
curl "http://defi-mcp.your-server.example.com/api/prices?ids=bitcoin,ethereum"
# Ethereum gas prices (EIP-1559)
curl "http://defi-mcp.your-server.example.com/api/gas"
# Wallet balance across 6 EVM chains
curl "http://defi-mcp.your-server.example.com/api/balance/0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045/multi"
# Top 10 tokens by market cap
curl "http://defi-mcp.your-server.example.com/api/top?limit=10"
# Solana DEX quote: 1 SOL → USDC via Jupiter
curl "http://defi-mcp.your-server.example.com/api/quote/solana?input_mint=So11111111111111111111111111111111111111112&output_mint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amount=1000000000"
100 free requests/day, no API key needed.
Tools
| Tool | Description | Data Source |
|---|---|---|
get_token_price | Price, 24h change %, market cap for 1+ tokens | CoinGecko |
search_tokens | Search by name/symbol → CoinGecko IDs | CoinGecko |
get_token_info | Full metadata: contract addresses, ATH, supply, links | CoinGecko |
get_top_tokens | Top N tokens by market cap | CoinGecko |
get_eth_balance | Native ETH balance for any wallet | Public RPC |
get_token_balance | ERC-20 balance for wallet + contract pair | Etherscan / RPC |
get_wallet_holdings | All tokens a wallet has interacted with | Etherscan |
get_multichain_balance | Native balance across 6 EVM chains at once | Public RPCs |
get_eth_gas | Base fee + EIP-1559 priority fee suggestions | Public RPC |
get_multichain_gas | Gas prices on 6 chains simultaneously | Public RPCs |
get_dex_quote_eth | Best swap quote via 1inch (any EVM chain) | 1inch API |
get_dex_quote_sol | Best swap quote via Jupiter (Solana) | Jupiter API |
Supported chains: Ethereum, BSC, Polygon, Arbitrum, Optimism, Base + Solana (DEX)
Setup: Claude Desktop
git clone https://github.com/OzorOwn/defi-mcp
cd defi-mcp
npm install
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"defi-mcp": {
"command": "node",
"args": ["/absolute/path/to/defi-mcp/src/index.js"]
}
}
}
Restart Claude Desktop. You'll see the hammer icon indicating MCP tools are available.
Setup: Cursor
Add to your project's .cursor/mcp.json:
{
"mcpServers": {
"defi-mcp": {
"command": "node",
"args": ["/absolute/path/to/defi-mcp/src/index.js"]
}
}
}
Or: Cursor Settings → Features → MCP Servers → Add new → stdio → node /path/to/defi-mcp/src/index.js
Setup: Claude Code
Add to .mcp.json in your project root:
{
"mcpServers": {
"defi-mcp": {
"command": "node",
"args": ["/absolute/path/to/defi-mcp/src/index.js"]
}
}
}
Works with any MCP host — Windsurf, Continue.dev, Cline, or any stdio-based MCP client.
Example Prompts
Once connected, ask your AI naturally:
"What's the current price of ETH and BTC?"
→ calls get_token_price(["ethereum", "bitcoin"])
"How much ETH does vitalik.eth hold?"
→ calls get_eth_balance("0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045")
"Compare gas prices across all supported chains"
→ calls get_multichain_gas()
"How much USDC would I get for 1 SOL on Jupiter?"
→ calls get_dex_quote_sol("So11...", "EPjF...", 1000000000)
"Show me the top 20 tokens by market cap"
→ calls get_top_tokens(20)
"What tokens has this wallet interacted with? 0xABC..."
→ calls get_wallet_holdings("0xABC...")
REST API
All 12 tools are also available as a REST API at http://defi-mcp.your-server.example.com.
| Endpoint | Tool |
|---|---|
GET /api/prices?ids=bitcoin,ethereum&vs=usd | get_token_price |
GET /api/search/:query | search_tokens |
GET /api/token/:id | get_token_info |
GET /api/top?limit=20 | get_top_tokens |
GET /api/balance/:address | get_eth_balance |
GET /api/balance/:address/token/:token | get_token_balance |
GET /api/holdings/:address | get_wallet_holdings |
GET /api/balance/:address/multi | get_multichain_balance |
GET /api/gas | get_eth_gas |
GET /api/gas/all | get_multichain_gas |
GET /api/quote/evm?chain_id=1&from=...&to=...&amount=... | get_dex_quote_eth |
GET /api/quote/solana?input_mint=...&output_mint=...&amount=... | get_dex_quote_sol |
POST /api/call | Universal tool invocation: {"tool": "...", "args": {...}} |
Free tier: 100 requests/day per IP, no key required.
API key (higher limits): POST /api/keys/create → get a key with 200 free credits. See the Getting Started guide.
Environment Variables
| Variable | Required | Description |
|---|---|---|
COINGECKO_API_KEY | No | Pro key for higher rate limits |
ETHERSCAN_API_KEY | No | Needed for get_wallet_holdings; balance falls back to RPC |
ONEINCH_API_KEY | No | Required for get_dex_quote_eth (free at portal.1inch.dev) |
ETH_RPC_URL | No | Override default public Ethereum RPC |
BSC_RPC_URL | No | Override default public BSC RPC |
All tools work without API keys using public endpoints (rate limits apply).
Architecture
src/
├── index.js — MCP stdio server (12 tools via @modelcontextprotocol/sdk)
├── http.js — Fastify REST API (same tools, production server)
├── tools/
│ ├── prices.js — CoinGecko: prices, search, metadata, rankings
│ ├── gas.js — EVM RPC: gas prices, multi-chain
│ ├── wallets.js — EVM RPC + Etherscan: balances, holdings
│ └── dex.js — 1inch (EVM) + Jupiter (Solana): swap quotes
└── utils/
└── http.js — fetch wrapper with retry + exponential backoff
Part of Agent Gateway
This MCP server is one of 39 services available through Agent Gateway — a unified API for AI agent infrastructure including wallet management, code execution, memory storage, scheduling, image processing, and more.
- Full API Catalog — Browse all 39 services
- Getting Started Guide — Create an API key and start building
- Tutorial: DeFi MCP Server Setup — Step-by-step guide with examples
- Tutorial: AI Agent + Crypto Wallet — Build an autonomous portfolio agent
License
MIT
関連サーバー
Zomato MCP
An mcp server for your food ordering needs.
Lightning Enable
MCP server enabling AI agents to make Bitcoin Lightning payments, check balances, access L402 APIs, and manage payment budgets. Supports Strike, OpenNode, NWC, and LND wallets.
ROT Trading Intelligence
The first financial intelligence MCP server. Live AI-scored trading signals from Reddit, SEC filings, FDA approvals, Congressional trades, and 15+ sources. 7 tools, 2 resources, hosted remotely, free, no API key required.
KSeF
MCP server for Poland's national e-invoicing system KSeF (Krajowy System e-Faktur). Provides 12 tools for complete KSeF API integration including session management, invoice querying/submission, export generation, and system monitoring. Built with Rust for reliability and performance. Perfect for Polish businesses automating e-invoicing processes and developers building KSeF compliance tools.
Wordle MCP
Fetches daily Wordle solutions for a specific date via the Wordle API.
Cred Protocol
On-chain credit scoring, financial reporting, and identity verification for Ethereum addresses. Get credit scores (300-1000), portfolio values, and identity attestations.
Skillbase/spm
npm for AI skills. Create, share, and discover reusable AI instructions for any model via MCP.
Bitcoin MCP Server
MCP server dedicated to the Bitcoin ecosystem for traders, analysts, developers, and more.
httpay-mcp
121 pay-per-call API tools for AI agents — crypto, weather, finance data via x402 micropayments (USDC on Base). Each call costs $0.001-$0.05.
Memory Bank MCP
A production-ready Model Context Protocol (MCP) server that provides a powerful, vector-native memory bank for AI agents. Built with the Protocol-Lattice Go Agent Framework, this server offers persistent, searchable, and shareable memory with multiple database backends.