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.

March 2026 8 min read 12 tools included
In this guide
  1. What is an MCP server?
  2. All 12 DeFi tools
  3. Set up with Claude Desktop
  4. Set up with Cursor
  5. Example prompts and responses
  6. Use as a REST API
  7. What to build next

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:

Free and open source
The server runs locally on your machine. No API key required for basic usage. Source code is on GitHub.

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

Install the server

bash
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.

json
{
  "mcpServers": {
    "defi-mcp": {
      "command": "node",
      "args": ["/absolute/path/to/defi-mcp/src/index.js"]
    }
  }
}
Use the absolute path
Replace /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:

  1. Open Cursor Settings → Features → MCP Servers
  2. Click "Add new MCP server"
  3. Set the transport to stdio
  4. Set the command to: node /absolute/path/to/defi-mcp/src/index.js
  5. Save and restart Cursor

Alternatively, add it to your project's .cursor/mcp.json:

json
{
  "mcpServers": {
    "defi-mcp": {
      "command": "node",
      "args": ["/absolute/path/to/defi-mcp/src/index.js"]
    }
  }
}
Works with any MCP host
This server uses the standard stdio transport. It works with any MCP-compatible client: Claude Desktop, Cursor, Windsurf, Cline, Continue, or Claude Code.

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:

Bitcoin: $67,089 (24h: +1.13%) | Market cap: $1.34T Ethereum: $1,962 (24h: +0.77%) | Market cap: $237B

"How much gas does it cost to send a transaction on Ethereum right now?"

Claude calls get_eth_gas:

Ethereum gas prices: Base fee: 0.16 gwei Slow: ~0.16 gwei | Normal: ~0.19 gwei | Fast: ~1.37 gwei At current ETH price, a standard transfer (~21,000 gas) costs about $0.01

"Check vitalik.eth's balance across all EVM chains"

Claude calls get_multichain_balance with Vitalik's address:

Balances for 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045: Ethereum: 1,234.56 ETH (~$2.4M) Polygon: 100.20 MATIC Arbitrum: 45.30 ETH Base: 12.10 ETH BSC: 0.00 BNB Optimism: 0.50 ETH

"What's the best swap rate for 1 SOL to USDC on Solana?"

Claude calls get_dex_quote_sol via Jupiter:

Best route (Jupiter): 1 SOL → 135.42 USDC Route: Raydium (100%) Price impact: 0.01% Slippage tolerance: 0.5%

"Compare gas prices across all supported chains"

Claude calls get_multichain_gas:

Gas prices across chains: Ethereum: 0.14 gwei Base: 0.01 gwei Arbitrum: 0.01 gwei Optimism: 0.01 gwei Polygon: 30.1 gwei BSC: 1.0 gwei Cheapest: Base, Arbitrum, Optimism (<0.01 gwei) Most expensive: Polygon (30.1 gwei)

"Show me the top 5 tokens by market cap"

Claude calls get_top_tokens:

Top 5 by market cap: 1. Bitcoin (BTC) $67,089 +1.13% $1.34T 2. Ethereum (ETH) $1,962 +0.77% $237B 3. Tether (USDT) $1.00 +0.01% $144B 4. XRP (XRP) $2.41 +3.20% $139B 5. Solana (SOL) $135.42 +2.50% $70B

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

bash
# 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

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

javascript
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`);
Higher limits with API key
For more than 100 requests/day, create a free API key via the Getting Started guide. You get 200 free credits and can top up with USDC on Base.

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