MCP Connector

Access Dune Analytics Blockchain Data

Bridges Dune Analytics blockchain queries to AI agents - fetch cached results or re-run a query by ID, returned as CSV.

Works with dune analytics

Maintainer of this project? Claim this page to edit the listing.


86
Spark score
out of 100
Updated May 2025
Version 1.0.0
Models
universal

Add to Favorites

Why it matters

Integrate AI agents with Dune Analytics to access and analyze blockchain and cryptocurrency data. Leverage powerful Dune queries to extract valuable insights for your AI applications.

Outcomes

What it gets done

01

Retrieve latest results from Dune queries by ID.

02

Execute Dune queries by ID and obtain results.

03

Process query results in CSV format for easy integration.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-dune-analytics-mcp | bash

Capabilities

Tools your agent gets

get_latest_result

Get the latest results of a Dune query by ID

run_query

Execute a Dune query by ID and get results

Overview

dune-analytics-mcp MCP Server

This MCP server bridges Dune Analytics to AI agents, fetching a query's latest cached results or executing it fresh by query ID, returned as CSV. Use it when you already have Dune query IDs and want an AI agent to pull their results conversationally. It runs/fetches existing queries only - it doesn't create or edit them.

What it does

Dune Analytics MCP Server bridges Dune Analytics data to AI agents, letting them retrieve results from existing Dune queries by ID. It offers two tools: fetching the latest already-computed result of a query, or actually re-executing the query and waiting for fresh results - both returned as CSV-formatted strings for easy downstream processing.

When to use - and when NOT to

Use this when you already have Dune query IDs (from Dune Analytics' web dashboard) covering blockchain/crypto data you want an AI agent to pull into a conversation - for example, checking a dashboard's latest cached numbers with get_latest_result, or forcing a fresh execution with run_query when you need current data rather than a cached snapshot. It requires a valid Dune Analytics API key and existing query IDs; it does not create or edit Dune queries itself, only runs/fetches ones that already exist in Dune.

Capabilities

  • get_latest_result(query_id) - retrieves the latest already-computed results of a Dune query as CSV
  • run_query(query_id) - executes a Dune query fresh and returns results as CSV

Example: "Get latest results for dune query 1215383" or "Run dune query 1215383".

How to install

Via Smithery:

npx -y @smithery/cli install @kukapay/dune-analytics-mcp --client claude

Or manually:

git clone https://github.com/kukapay/dune-analytics-mcp.git
cd dune-analytics-mcp

Set DUNE_API_KEY in a .env file or as an environment variable, then install for Claude Desktop:

mcp install main.py --name "Dune Analytics"

Requires Python 3.10+ and a Dune Analytics API key from dune.com/settings/api.

Who it's for

Crypto/blockchain analysts who already maintain Dune Analytics queries and want an AI agent to pull cached or fresh results from those queries directly into a conversation. Licensed MIT.

Source README

Dune Analytics MCP Server

smithery badge

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

Features

  • Tools:
    • 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.

Prerequisites

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

Installation

Installing via Smithery

To install Dune Analytics for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @kukapay/dune-analytics-mcp --client claude

Manual Installation

  1. Clone the Repository:

    git clone https://github.com/kukapay/dune-analytics-mcp.git
    cd dune-analytics-mcp
    
  2. Set Up Environment Variables:
    Create a .env file in the project root:

    DUNE_API_KEY=your_api_key_here
    

    Alternatively, set it as a system environment variable:

    export DUNE_API_KEY="your_api_key_here"
    

Usage

Running the Server

  • Development Mode:

    mcp dev main.py
    

    This starts the server with hot reloading for development.

  • Install for Claude Desktop:

    mcp install main.py --name "Dune Analytics"
    

    Installs the server as a service for use with Claude Desktop.

Tool Usage

  1. get_latest_result(query_id)

    • 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:
      get_latest_result(query_id=4853921)
      
  2. run_query(query_id)

    • Description: Executes a Dune query and returns the results.
    • Input: query_id (int) - The ID of the Dune query to run.
    • Output: CSV-formatted string of the query results.
    • Example:
      run_query(query_id=1215383)
      

Example Commands in Claude Desktop

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

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.