Dune Analytics MCP server

Integrates with Dune API to provide blockchain data analysis for examining wallet balances, transaction histories, token information, NFT collectibles, and holder distributions across EVM and Solana networks.
Back to servers
Setup instructions
Provider
Dennison Bertram
Release date
May 22, 2025
Language
Python
Stats
2 stars

The Dune API MCP Server provides an interface for LLM agents and applications to access blockchain data through the Model Context Protocol, allowing analysis of wallet balances, transactions, token information, and more across EVM and Solana chains.

Installation

Prerequisites

  • Bun (latest version recommended)
  • A Dune API Key from Sim API

From Source

# Clone the repository
git clone https://github.com/crazyrabbitLTC/mcp-web3-stats.git
cd mcp-web3-stats

# Install dependencies
bun install

# Create .env file with your Dune API key
echo "DUNE_API_KEY=your_actual_dune_api_key_here" > .env

# Start the server
bun start

From npm

You can install globally:

# Install globally
npm install -g mcp-web3-stats

# Set your Dune API key as an environment variable
export DUNE_API_KEY=your_actual_dune_api_key_here

# Run the server
mcp-web3-stats

Or run directly with npx:

# Set your Dune API key as an environment variable
export DUNE_API_KEY=your_actual_dune_api_key_here

# Run the server with npx
npx mcp-web3-stats

Testing with MCP Inspector

Once your server is running, test it using the MCP Inspector:

# If running from source
npx @modelcontextprotocol/inspector bun run index.ts

# If installed globally
npx @modelcontextprotocol/inspector mcp-web3-stats

# If using npx
npx @modelcontextprotocol/inspector npx mcp-web3-stats

Integrating with Claude Desktop

To use this server with Claude Desktop, modify the claude_desktop_config.json file:

Using the built JavaScript version (recommended)

{
  "mcpServers": {
    "dune_api_server": {
      "command": "node",
      "args": [
        "/ABSOLUTE/PATH/TO/YOUR/mcp-web3-stats/dist/index.js"
      ],
      "env": {
        "DUNE_API_KEY": "your_actual_dune_api_key_here"
      }
    }
  }
}

Using TypeScript source directly

{
  "mcpServers": {
    "dune_api_server_dev": {
      "command": "/full/path/to/your/bun/executable",
      "args": [
        "run",
        "/ABSOLUTE/PATH/TO/YOUR/mcp-web3-stats/index.ts"
      ],
      "env": {
        "DUNE_API_KEY": "your_actual_dune_api_key_here"
      }
    }
  }
}

Remember to use absolute paths and restart Claude Desktop after making changes.

Usage Examples

Check Wallet Balances

Assistant: Let me check the balances in this wallet for you.

[Uses get_evm_balances with walletAddress=0xYourWalletAddress]

This wallet contains:
- 1.25 ETH (~$3,800)
- 500 USDC ($500)
- Several NFTs including a CryptoPunk and two Bored Apes

Analyze Token Information

Assistant: Let me analyze this token for you.

[Uses get_evm_token_info with chainId=1 and tokenAddress=0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984]

UNI Token Information:
- Current price: $5.32
- Market cap: $2.7B 
- 24h trading volume: $89M

[Uses get_evm_token_holders with chainId=1 and tokenAddress=0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984]

Top UNI Token Holders:
1. 0x47173B170C64d16393a52e6C480b3Ad8c302ba1e: 5.2% of supply
2. 0x1a9C8182C09F50C8318d769245beA52c32BE35BC: 3.8% of supply
...

Review Transactions

Assistant: Here's a summary of recent transactions.

[Uses get_evm_transactions with walletAddress=0xYourWalletAddress]

Recent activity:
- Yesterday: Swapped 2 ETH for 3,500 UNI on Uniswap
- 3 days ago: Withdrew 5 ETH from Binance
- Last week: Minted an NFT for 0.08 ETH

Check Solana Balances

Assistant: Let me check your Solana wallet balances.

[Uses get_svm_balances with walletAddress=YourSolanaAddress]

This wallet contains:
- 12.5 SOL (~$875)
- 2,500 USDC ($2,500)
- Several SPL tokens including 150 BONK

Available Tools

EVM Tools

  • get_evm_balances: Fetches EVM token balances for a wallet
  • get_evm_activity: Fetches EVM account activity
  • get_evm_collectibles: Fetches EVM NFT collectibles
  • get_evm_transactions: Retrieves granular EVM transaction details
  • get_evm_token_info: Fetches metadata and price for EVM tokens
  • get_evm_token_holders: Discovers EVM token holder distributions

SVM Tools

  • get_svm_balances: Fetches SVM token balances
  • get_svm_transactions: Fetches SVM transactions (Solana only)

Resources

  • dune://evm/supported-chains: Provides a list of EVM chains supported by the Dune API

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "dune_api_server" '{"command":"npx","args":["mcp-web3-stats"],"env":{"DUNE_API_KEY":"your_actual_dune_api_key_here"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "dune_api_server": {
            "command": "npx",
            "args": [
                "mcp-web3-stats"
            ],
            "env": {
                "DUNE_API_KEY": "your_actual_dune_api_key_here"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "dune_api_server": {
            "command": "npx",
            "args": [
                "mcp-web3-stats"
            ],
            "env": {
                "DUNE_API_KEY": "your_actual_dune_api_key_here"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later