Dune Analytics MCP Server

A mcp server that bridges Dune Analytics data to AI agents.

Local serverstdioPython

What is the Dune Analytics MCP server?

A mcp server that bridges Dune Analytics data to AI agents. The dune analytics mcp server wraps that behind the Model Context Protocol, so an assistant can use it through 4 defined tools rather than through you.

What it actually does

To install Dune Analytics for Claude Desktop automatically via Smithery:

  • get_latest_result: Fetch the latest results of a Dune query by ID
  • run_query: Execute a Dune query by ID and retrieve results
  • CSV Output — All results are returned as CSV-formatted strings for easy processing

Its toolset

Everything the assistant can do here goes through one of these:

  • Description — Retrieves the latest results of a specified Dune query
  • Input — query_id (int) - The ID of the Dune query
  • Output — CSV-formatted string of the query results
  • Example — The Example tool exposed by this server

Adding it to your client

Installation goes through your MCP client rather than a global install: point it at @smithery/cli on npm and it is fetched when the client starts. The copy-paste blocks for Claude Desktop, Claude Code and Cursor are further down this page.

Configuration

You will need one environment variable: DUNE_API_KEY. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

  • Python 3.10+ - A valid Dune Analytics API key (get one from Dune Analytics)

When to reach for it

Plenty of developer tooling servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. Dune Analytics's toolset — Description, Input, Output and 1 more — is a fair guide to whether it matches your workflow. It is maintained by kukapay; worth a glance at recent repository activity before you build anything load-bearing on it.

SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.

Caveats

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the dune analytics mcp server does with a few real requests.

Available tools

ToolWhat it does
DescriptionRetrieves the latest results of a specified Dune query.
Inputquery_id (int) - The ID of the Dune query.
OutputCSV-formatted string of the query results.
ExampleThe Example tool exposed by this server.

How to install the Dune Analytics MCP server

{
  "mcpServers": {
    "dune-analytics": {
      "command": "npx",
      "args": ["-y", "@smithery/cli"],
      "env": {
        "DUNE_API_KEY": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

  • Python 3.10+ - A valid Dune Analytics API key (get one from Dune Analytics)
VariableDescriptionRequired
DUNE_API_KEYCredential the server authenticates with.Yes

Example prompts to try

  • Use Dune Analytics to Description.
  • Use Dune Analytics to Input.
  • Use Dune Analytics to Output.

Frequently asked questions

Obtain a free API key from the Dune Analytics settings page at https://dune.com/settings/api.