
How to add Dune Analytics MCP Server to Cursor
Bridge Dune Analytics on-chain query results to AI agents as CSV. Paste the config into ~/.cursor/mcp.json and restart Cursor.
Last updated June 14, 2026 · 40★ · stdio · apikey
Cursor config for Dune Analytics MCP Server
npx -y @smithery/cli install @kukapay/dune-analytics-mcp --client claude{
"mcpServers": {
"dune-analytics-mcp-server": {
"command": "mcp",
"args": [
"install",
"main.py",
"--name",
"Dune Analytics"
],
"env": {
"DUNE_API_KEY": "your_api_key_here"
}
}
}
}Setup steps
- 1Open Cursor → Settings → MCP → Add new MCP server (or edit ~/.cursor/mcp.json directly).
- 2Paste the Dune Analytics MCP Server config below into the "mcpServers" object.
- 3Fill in placeholder secrets, then save.
- 4Cursor reloads MCP servers automatically — check Settings → MCP for a green status dot.
- 5Ask Cursor to use one of Dune Analytics MCP Server's tools to confirm it's connected.
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
What Dune Analytics MCP Server can do in Cursor
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.
Security
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 + Cursor FAQ
Where is the Cursor config file?
Cursor reads MCP servers from ~/.cursor/mcp.json. Paste the Dune Analytics MCP Server config there under the "mcpServers" key and restart the client.
Is Dune Analytics MCP Server safe to use with Cursor?
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.
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.