
Dune Analytics MCP Server
Bridge Dune Analytics on-chain query results to AI agents as CSV.
Add to your client
Copy the config for your MCP client and paste it into its config file.
npx -y @smithery/cli install @kukapay/dune-analytics-mcp --client claudePaste into ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"dune-analytics-mcp-server": {
"command": "mcp",
"args": [
"install",
"main.py",
"--name",
"Dune Analytics"
],
"env": {
"DUNE_API_KEY": "your_api_key_here"
}
}
}
}Step-by-step guides: Add to Claude Desktop · Add to Cursor · Add to Windsurf
Before you start
- Python 3.10+
- A valid Dune Analytics API key (get one from https://dune.com/settings/api)
- The mcp CLI / MCP-capable client such as Claude Desktop
About Dune Analytics MCP Server
An MCP server that bridges Dune Analytics data to AI agents. It provides two tools for fetching the latest results of a Dune query and for executing a Dune query by ID, returning all results as CSV-formatted strings. Built in Python and intended to run locally over stdio with a Dune Analytics API key.
Tools & capabilities (2)
get_latest_resultFetch the latest (cached) results of a Dune query by ID. Input: query_id (int). Output: CSV-formatted string of the query results.
run_queryExecute a Dune query by ID and retrieve the results. Input: query_id (int). Output: CSV-formatted string of the query results.
When to use it
- Pulling the latest results of an existing Dune dashboard query into an AI assistant for summarization or analysis.
- Triggering a fresh run of a Dune query and feeding the on-chain metrics into an agent workflow.
- Exporting blockchain/DeFi query results as CSV for downstream processing by a model.
Security notes
Requires a Dune Analytics API key supplied via the DUNE_API_KEY environment variable. Treat the key as a secret; do not commit the .env file. The run_query tool executes Dune queries against your account, which may consume Dune API credits.
Dune Analytics MCP Server FAQ
What do I need to run this server?
Python 3.10+ and a valid Dune Analytics API key set via the DUNE_API_KEY environment variable. You can get an API key from https://dune.com/settings/api.
How do I install it for Claude Desktop?
Use the Smithery CLI: 'npx -y @smithery/cli install @kukapay/dune-analytics-mcp --client claude'. Alternatively, clone the repo, set DUNE_API_KEY, and run 'mcp install main.py --name "Dune Analytics"'.
What format are results returned in?
Both tools return results as CSV-formatted strings, which makes them easy for AI models and downstream tooling to parse.
What is the difference between get_latest_result and run_query?
get_latest_result fetches the most recent cached results of a query without re-executing it, while run_query triggers a fresh execution of the query before returning the results.
Alternatives to Dune Analytics MCP Server
Compare all alternatives →Official MCP server providing persistent, file-backed knowledge-graph memory across sessions.
Structured step-by-step reasoning tool for breaking problems into revisable thought sequences.
Fully managed remote server for AWS docs, blogs, What's-New and Well-Architected guidance — no key.
Compare Dune Analytics MCP Server with: