Dune

Exposes Dune Analytics API endpoints as MCP tools for SQL execution, saved queries, and data uploads.
  • python

0

GitHub Stars

python

Language

6 months ago

First Indexed

3 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "mwamedacen-dune-mcp": {
      "command": "python",
      "args": [
        "/path/to/dune-mcp/server.py"
      ],
      "env": {
        "DUNE_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

You run a Dune MCP Server to access Dune Analytics data through a programmable MCP interface. It exposes core Dune endpoints as reusable tools, letting you run SQL, manage saved queries, and upload data, all from your preferred MCP client. This makes it easy to automate analytics, build repeatable workflows, and combine Dune data with your own analytics stack.

How to use

Use a compatible MCP client to connect to the Dune MCP Server and invoke the available tools. You can run ad-hoc SQL against Dune’s data engine, execute saved queries, fetch results in JSON or CSV, and manage tables and queries. The server also provides comprehensive documentation resources to help you craft valid DuneSQL queries and understand available tables and patterns.

How to install

Prerequisites: make sure you have Python installed and access to install Python packages.

Install the server package in editable mode from your local workspace.

cd dune-mcp
pip install -e .

Configuration

Set your Dune API key as an environment variable before starting the server.

Example (bash):

export DUNE_API_KEY="your-api-key-here"

Usage examples

Run the server locally using Python directly, or via a CLI script if you installed an entry point.

# Direct execution
python server.py

# Or via installed script
dune-mcp

Configuration for Claude Desktop integration

To use the server with Claude Desktop, include a standard MCP server entry that points to how you start the server and passes the API key.

{
  "mcpServers": {
    "dune": {
      "command": "python",
      "args": ["/path/to/dune-mcp/server.py"],
      "env": {
        "DUNE_API_KEY": "your-api-key-here"
      }
    }
  }
}

Notes on running with uv

You can run the server using uv as a supervisor, if you prefer. The command preserves the same environment variable for authentication.

{
  "mcpServers": {
    "dune": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/dune-mcp", "python", "server.py"],
      "env": {
        "DUNE_API_KEY": "your-api-key-here"
      }
    }
  }
}

Troubleshooting

If you encounter authentication issues, verify that DUNE_API_KEY is set correctly in the environment where the server runs.

Ensure that the server process can reach Dune’s API endpoints and that network/firewall rules allow outbound connections to Dune.

Available tools

execute_sql

Executes raw DuneSQL queries against Dune's data engine via the MCP tool API.

get_execution_status

Checks the status of an in-progress SQL execution.

get_execution_results

Retrieves the results of a completed SQL query in JSON format.

get_execution_results_csv

Retrieves the results of a completed SQL query in CSV format.

cancel_execution

Cancels a running SQL execution.

execute_query

Executes a saved query by its ID.

get_query

Fetches details for a saved query.

get_query_results

Gets the latest cached results for a saved query without re-executing.

get_query_results_csv

Gets the latest saved query results as CSV.

create_query

Creates and saves a new query.

update_query

Updates an existing saved query.

archive_query

Archives a saved query.

make_query_private

Sets a saved query to private visibility.

make_query_public

Sets a saved query to public visibility.

upload_csv

Uploads CSV data to create or update a table.

create_table

Creates a new table with a defined schema.

insert_table_rows

Inserts rows into an existing table.

clear_table

Clears all data from a specified table.

delete_table

Permanently deletes a table.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational