dune-mcp
Dune MCP Server connects your AI assistant to Dune Analytics, the leading platform for blockchain data. Execute SQL queries across Ethereum, Solana, and 20+ chains to analyze DEX trades, token transfers, NFT sales, and wallet activity. Manage saved queries, upload custom datasets, and access curate
README
Dune MCP Server
A comprehensive MCP (Model Context Protocol) server for interacting with Dune Analytics - the leading platform for blockchain data analysis.
Features
Tools
This server exposes all major Dune Analytics API endpoints as MCP tools:
SQL Execution
execute_sql- Execute raw SQL queries against Dune's data engineget_execution_status- Check query execution statusget_execution_results- Retrieve query results (JSON)get_execution_results_csv- Retrieve query results (CSV)cancel_execution- Cancel a running query
Saved Query Management
execute_query- Execute a saved query by IDget_query- Get query detailsget_query_results- Get latest cached results without re-executingget_query_results_csv- Get latest results as CSVcreate_query- Create and save a new queryupdate_query- Update an existing queryarchive_query- Archive a querymake_query_private/make_query_public- Change query visibility
Data Upload
upload_csv- Upload CSV data to create/update a tablecreate_table- Create a new table with schemainsert_table_rows- Insert rows into an existing tableclear_table- Clear all data from a tabledelete_table- Permanently delete a table
Resources
The server exposes comprehensive documentation as MCP resources to help LLMs write valid DuneSQL queries:
| Resource URI | Description |
|---|---|
dune://guide/sql-syntax |
DuneSQL (Trino) syntax reference, data types, functions |
dune://guide/tables |
Available tables: dex.trades, prices.usd, chain-specific tables |
dune://guide/query-patterns |
Common analytics patterns: volume, holders, whales, gas |
dune://guide/parameters |
How to use query parameters |
dune://guide/errors |
Common errors and troubleshooting |
Installation
cd dune-mcp
pip install -e .
Configuration
Set your Dune API key as an environment variable:
export DUNE_API_KEY="your-api-key-here"
Get your API key from Dune Settings.
Usage
Running the Server
# Direct execution
python server.py
# Or via installed script
dune-mcp
Claude Desktop Configuration
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"dune": {
"command": "python",
"args": ["/path/to/dune-mcp/server.py"],
"env": {
"DUNE_API_KEY": "your-api-key-here"
}
}
}
}
Or using uv:
{
"mcpServers": {
"dune": {
"command": "uv",
"args": ["run", "--directory", "/path/to/dune-mcp", "python", "server.py"],
"env": {
"DUNE_API_KEY": "your-api-key-here"
}
}
}
}
Example Queries
Simple DEX Volume Query
# Using execute_sql tool
result = await execute_sql(
sql="""
SELECT
project,
SUM(amount_usd) as volume
FROM dex.trades
WHERE block_time > now() - interval '24' hour
GROUP BY 1
ORDER BY 2 DESC
LIMIT 10
""",
performance="medium"
)
Cross-Chain Analysis
result = await execute_sql(
sql="""
SELECT
blockchain,
COUNT(*) as tx_count,
SUM(amount_usd) as volume_usd
FROM dex.trades
WHERE block_time > now() - interval '7' day
GROUP BY 1
ORDER BY 3 DESC
"""
)
Create Parameterized Query
result = await create_query(
name="Token Volume Analysis",
query_sql="""
SELECT
DATE_TRUNC('day', block_time) as day,
SUM(amount_usd) as volume
FROM dex.trades
WHERE token_bought_symbol = '{{token}}'
AND block_time > now() - interval '{{days}}' day
GROUP BY 1
ORDER BY 1
""",
parameters=[
{"key": "token", "value": "UNI", "type": "text"},
{"key": "days", "value": "30", "type": "number"}
]
)
Available Tables
Curated (Cross-Chain)
dex.trades- DEX trades across all EVM chainsdex_solana.trades- Solana DEX tradesnft.trades- NFT tradesprices.usd- Token pricestokens.erc20- ERC20 token metadata
Chain-Specific
ethereum.transactions,ethereum.logs,ethereum.tracespolygon.transactions,polygon.logs, etc.arbitrum.transactions,optimism.transactions,base.transactions
Decoded Protocol Tables
uniswap_v3_ethereum.Pair_evt_Swapaave_v3_ethereum.Pool_evt_Supply- And many more...
API Reference
See Dune API Documentation for complete API details.
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.