SuperAPI AI Directory

dune-analytics-mcp

Access Dune Analytics data.

Open website

About this tool

dune-analytics-mcp is an MCP (Model Context Protocol) server whose purpose is to bridge Dune Analytics data to AI agents, enabling agents to access and operate on query data on Dune Analytics.

Purpose The server targets scenarios where AI agents need to obtain on-chain or data analysis results from Dune Analytics, exposing Dune query capabilities to AI agents through the MCP protocol.

Main capabilities It provides two tools:

  1. get_latest_result: retrieves the latest result of a Dune query based on the query ID. The input is query_id (integer), i.e., the ID of the Dune query; the output is a query result string in CSV format. Example: get_latest_result(query_id=4853921).
  2. run_query: executes a Dune query based on the query ID and returns the result. The input is query_id (integer), i.e., the ID of the Dune query to run; the output is a query result string in CSV format. Example: run_query(query_id=1215383). All results are returned as CSV format strings for ease of subsequent processing.

How to use A valid Dune Analytics API key is required before use (available from Dune Analytics). Installation method one: automatically install to Claude Desktop via Smithery. Installation method two: manual installation. The steps include:

  • Clone the repository: git clone https://github.com/kukapay/dune-analytics-mcp.git cd dune-analytics-mcp
  • Set environment variables: create a .env file in the project root directory with the content DUNE_API_KEY=your_api_key_here; or set it as a system environment variable: export DUNE_API_KEY="your_api_key_here" Run the server:
  • Development mode: mcp dev main.py, this command starts the server with hot reload, which is convenient for development.
  • Install to Claude Desktop: mcp install main.py --name "Dune Analytics", installs the server as a service that can be used with Claude Desktop.

Example commands in Claude Desktop:

  • "Get latest results for dune query 1215383"
  • "Run dune query 1215383"

Applicable scenarios Applicable to scenarios where an AI agent (such as Claude Desktop) needs to directly obtain the latest results of a Dune query or execute a specified Dune query and read the CSV results, for example, pulling Dune data by query ID in a conversation.

Limitations Details regarding platform compatibility scope, concurrency capability, maximum number of result rows, error handling strategy, or support for non-Claude Desktop clients are not provided in the material and are not yet available. The prerequisite for use is having a valid Dune Analytics API key.

License This project uses the MIT license, see the LICENSE file for details.