Navigation
Dune Analytics MCP Server: AI-Driven Insights, Effortless Integration - MCP Implementation

Dune Analytics MCP Server: AI-Driven Insights, Effortless Integration

The Dune Analytics MCP Server seamlessly bridges your data to AI agents, empowering real-time insights and smarter decisions with effortless integration.

Research And Data
4.9(16 reviews)
24 saves
11 comments

Users create an average of 50 projects per month with this tool

About Dune Analytics MCP Server

What is Dune Analytics MCP Server: AI-Driven Insights, Effortless Integration?

This server acts as a bridge between Dune Analytics data and AI systems, enabling seamless extraction and analysis of insights. Designed for developers and data enthusiasts, it empowers users to fetch real-time query results or trigger executions directly within AI workflows. Its core strength lies in simplifying the process of integrating Dune’s rich datasets into custom applications or AI-driven tools.

Key Features of Dune Analytics MCP Server: AI-Driven Insights, Effortless Integration?

Two core tools power this server: get_latest_result and run_query. The first retrieves the most recent data from a specified Dune query, while the second executes queries on-demand. All outputs are delivered as CSV strings, ensuring compatibility with downstream processes. This structure eliminates manual data formatting, saving hours of repetitive work.

Dune Analytics MCP Server Features

How to Use Dune Analytics MCP Server: AI-Driven Insights, Effortless Integration?

Start by cloning the repository and setting up your Dune API key via a .env file or environment variable. Launch the server in development mode for instant code updates, or install it as a service for Claude Desktop integration. Use simple commands like mcp dev main.py to get started. For AI interactions, phrase requests naturally—such as “Run Dune query 123456”—to trigger automated workflows.

Use Cases of Dune Analytics MCP Server: AI-Driven Insights, Effortless Integration?

Dune Analytics MCP Server FAQ

FAQ from Dune Analytics MCP Server: AI-Driven Insights, Effortless Integration?

Q: Do I need coding skills to use this?
A: Basic Python familiarity helps, but the setup process is streamlined. Even non-developers can deploy it with guided instructions.
Q: How secure is the API key?
A: Best practice is to use environment variables instead of hardcoding keys. The server follows standard security conventions.
Q: Can I use this with non-AI tools?
A: Absolutely! The CSV outputs work with Excel, SQL databases, or any system that accepts structured data.

Content

Dune Analytics MCP Server

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

  1. Clone the Repository :

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

cd dune-analytics-mcp
  1. 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)
    
  1. 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"

License

This project is licensed under the MIT License - see the LICENSE file for details.

Related MCP Servers & Clients