How to Add a DeFi MCP Server to Claude and Cursor
Give your AI assistant real-time crypto superpowers. Token prices, gas fees, wallet balances, and DEX swap quotes — all accessible through natural language. Connect in under 2 minutes.
1 What is an MCP server?
Model Context Protocol (MCP) is an open standard that lets AI assistants like Claude and Cursor call external tools. Instead of the AI guessing or hallucinating data, it can fetch real information from live APIs.
A DeFi MCP server gives your AI access to real-time blockchain data. Ask Claude "What's the current ETH gas price?" and instead of making up a number, it queries the Ethereum network and gives you the actual value.
This server provides 12 tools covering the most common DeFi data needs:
- Token prices and market data from CoinGecko
- Gas prices across 6 EVM chains
- Wallet balances (single chain and multi-chain)
- DEX swap quotes from 1inch (EVM) and Jupiter (Solana)
2 All 12 DeFi tools
Here's everything your AI gains access to:
Price data
get_token_price
Live prices, 24h change, market cap, and volume for any token
search_tokens
Find tokens by name or symbol. Returns CoinGecko IDs and market cap rank
get_token_info
Full metadata: description, contract addresses, ATH/ATL, supply, links
get_top_tokens
Top N tokens by market cap with prices and 24h change
Gas prices
get_eth_gas
Ethereum gas: base fee + slow/normal/fast priority fees (EIP-1559)
get_multichain_gas
Gas prices across Ethereum, BSC, Polygon, Arbitrum, Optimism, and Base
Wallet balances
get_eth_balance
Native ETH balance for any wallet address
get_token_balance
ERC-20 token balance for a specific wallet and token contract
get_wallet_holdings
All tokens a wallet has interacted with (historical activity)
get_multichain_balance
Native balance across 6 chains simultaneously
DEX quotes
get_dex_quote_eth
Swap quotes from 1inch on any EVM chain (ETH, BSC, Polygon, etc.)
get_dex_quote_sol
Swap quotes from Jupiter for Solana tokens
3 Set up with Claude Desktop
Prerequisites
- Claude Desktop installed
- Node.js 18+ (
node --versionto check)
Install the server
git clone https://github.com/OzorOwn/defi-mcp.git
cd defi-mcp
npm install
Add to Claude Desktop config
Open Claude Desktop settings and edit the MCP configuration file. On macOS it's at ~/Library/Application Support/Claude/claude_desktop_config.json. On Windows: %APPDATA%\Claude\claude_desktop_config.json.
{
"mcpServers": {
"defi-mcp": {
"command": "node",
"args": ["/absolute/path/to/defi-mcp/src/index.js"]
}
}
}
/absolute/path/to/defi-mcp with the actual path where you cloned the repo. On Windows, use forward slashes: C:/Users/you/defi-mcp/src/index.js.
Restart Claude Desktop. You should see a hammer icon indicating MCP tools are available.
4 Set up with Cursor
Cursor supports MCP servers through its settings. After cloning and installing (same steps as above), add the server:
- Open Cursor Settings → Features → MCP Servers
- Click "Add new MCP server"
- Set the transport to stdio
- Set the command to:
node /absolute/path/to/defi-mcp/src/index.js - Save and restart Cursor
Alternatively, add it to your project's .cursor/mcp.json:
{
"mcpServers": {
"defi-mcp": {
"command": "node",
"args": ["/absolute/path/to/defi-mcp/src/index.js"]
}
}
}
5 Example prompts and responses
Once connected, you can ask questions in natural language. Here are examples that work right now:
"What's the current price of Bitcoin and Ethereum?"
Claude calls get_token_price and returns:
"How much gas does it cost to send a transaction on Ethereum right now?"
Claude calls get_eth_gas:
"Check vitalik.eth's balance across all EVM chains"
Claude calls get_multichain_balance with Vitalik's address:
"What's the best swap rate for 1 SOL to USDC on Solana?"
Claude calls get_dex_quote_sol via Jupiter:
"Compare gas prices across all supported chains"
Claude calls get_multichain_gas:
"Show me the top 5 tokens by market cap"
Claude calls get_top_tokens:
6 Use as a REST API
Don't need MCP? The same 12 tools are available as a REST API. No API key required for up to 100 requests/day.
Quick examples with curl
# Get Bitcoin and Ethereum prices
curl "https://agent-gateway-kappa.vercel.app/v1/defi-mcp/api/prices?ids=bitcoin,ethereum"
# Get Ethereum gas prices
curl "https://agent-gateway-kappa.vercel.app/v1/defi-mcp/api/gas"
# Check a wallet balance on all EVM chains
curl "https://agent-gateway-kappa.vercel.app/v1/defi-mcp/api/balance/0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045/multi"
# Get a Solana DEX quote (1 SOL to USDC)
curl "https://agent-gateway-kappa.vercel.app/v1/defi-mcp/api/quote/solana?input_mint=So11111111111111111111111111111111111111112&output_mint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amount=1000000000"
# Search for a token
curl "https://agent-gateway-kappa.vercel.app/v1/defi-mcp/api/search/uniswap"
# Top 10 tokens by market cap
curl "https://agent-gateway-kappa.vercel.app/v1/defi-mcp/api/top?limit=10"
Use from Python
import requests
BASE = "https://agent-gateway-kappa.vercel.app/v1/defi-mcp"
# Get top 5 tokens
top = requests.get(f"{BASE}/api/top?limit=5").json()
for t in top:
print(f"{t['rank']}. {t['name']} ({t['symbol']}) ${{t['price_usd']}:,.2f}")
# Check gas across chains
gas = requests.get(f"{BASE}/api/gas/all").json()
for chain, data in gas.items():
if isinstance(data, dict) and 'gwei' in data:
print(f"{chain}: {data['gwei']} gwei")
Use from Node.js
const BASE = "https://agent-gateway-kappa.vercel.app/v1/defi-mcp";
// Get prices
const prices = await fetch(`${BASE}/api/prices?ids=bitcoin,ethereum,solana`)
.then(r => r.json());
console.log("BTC:", prices.bitcoin.usd);
console.log("ETH:", prices.ethereum.usd);
console.log("SOL:", prices.solana.usd);
// Check wallet balance
const balance = await fetch(
`${BASE}/api/balance/0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045`
).then(r => r.json());
console.log(`Balance: ${balance.balance_eth} ETH`);
7 What to build next
Now that your AI has access to live DeFi data, here are some things you can build:
- Portfolio tracker — Ask Claude to monitor specific wallets and report balances daily
- Gas optimizer — Have your AI compare gas across chains before recommending where to transact
- Price alert bot — Build a script that uses the REST API to watch prices and notify you
- DeFi research assistant — Ask Claude to analyze token fundamentals, compare DEX quotes, and explain gas trends
- Multi-chain dashboard — Use the multichain balance tool to build a dashboard showing assets across all 6 chains
Combine this with our crypto wallet tutorial to build an agent that can both read blockchain data and manage wallets.
The full Agent Gateway gives your agent access to 39 services beyond DeFi — including memory storage, code execution, image processing, scheduling, and more. Browse all services.
Try it now — takes 2 minutes
Clone the repo, add to your MCP config, restart your AI. That's it.
View on GitHub Browse All APIs