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.
# 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
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
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
To use this server with Claude Desktop, modify the claude_desktop_config.json
file:
{
"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"
}
}
}
}
{
"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.
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
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
...
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
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
get_evm_balances
: Fetches EVM token balances for a walletget_evm_activity
: Fetches EVM account activityget_evm_collectibles
: Fetches EVM NFT collectiblesget_evm_transactions
: Retrieves granular EVM transaction detailsget_evm_token_info
: Fetches metadata and price for EVM tokensget_evm_token_holders
: Discovers EVM token holder distributionsget_svm_balances
: Fetches SVM token balancesget_svm_transactions
: Fetches SVM transactions (Solana only)dune://evm/supported-chains
: Provides a list of EVM chains supported by the Dune APITo 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.
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.
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"
}
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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