dune-data-connector-mcp
Facilitates access to Dune Analytics datasets for autonomous agents by executing SQL queries and delivering outputs formatted as delimited text strings for straightforward integration.
Author

yuri-xyz
Quick Info
Actions
Tags
Dune Analytics Data Access MCP Server
A dedicated MCP service engineered to interface Dune Analytics query outputs with AI computational entities.
Core Capabilities
- Tooling Suite:
fetch_current_snapshot: Pulls the most recent execution output for a given Dune query identifier.execute_query_and_fetch: Triggers a specified Dune query and retrieves its resulting dataset.- Data Serialization: All retrieved query results are uniformly presented as standard Comma Separated Values (CSV) strings, optimizing them for subsequent agent processing.
Prerequisites for Deployment
- Runtime environment requires Python version 3.10 or newer.
- A valid, authenticated API credential for Dune Analytics is mandatory (obtainable via Dune Analytics settings).
Deployment Instructions
-
Source Retrieval: bash git clone https://github.com/kukapay/dune-analytics-mcp.git cd dune-analytics-mcp
-
Credential Configuration: Establish a
.envfile within the primary directory:
DUNE_API_KEY=your_secret_key_here
Alternatively, inject this key into the operational shell environment: bash export DUNE_API_KEY="your_secret_key_here"
Operational Guidelines
Starting the Service
- Development/Testing Mode: bash mcp dev main.py
Initiates the server with capabilities for automated code updates upon modification.
- Integration with Claude Desktop: bash mcp install main.py --name "Dune Data Bridge"
Registers the service as a persistent tool for use within the Claude environment.
Tool Invocation Details
fetch_current_snapshot(query_id)- Purpose: Obtains the previously computed data set associated with the provided Dune query identifier.
- Input:
query_id(integer) - The unique numerical identifier for the target Dune query. - Output: A string containing the tabular data rendered in CSV format.
-
Invocation Example:
fetch_current_snapshot(query_id=4853921)
-
execute_query_and_fetch(query_id) - Purpose: Forces a fresh execution of the specified Dune query and immediately returns the resulting dataset.
- Input:
query_id(integer) - The numerical handle of the Dune query intended for execution. - Output: A string representing the newly generated query results in CSV format.
-
Invocation Example:
execute_query_and_fetch(query_id=1215383)
Example Agent Prompts (for Claude Desktop)
- "Retrieve the most recent output for dune query identifier 1215383"
- "Initiate and fetch results from dune query 1215383"
Legal Status
This software is distributed under the terms of the MIT License (refer to the accompanying [LICENSE] file for specifics).
