# dune-analytics-mcp

> MCP Server

This repository provides a mcp server that bridges Dune Analytics data to AI agents, offering tools to fetch latest query results or execute queries by ID, returning data as CSV strings.

## Overview

- **Category:** AI
- **Language:** Python
- **Stars:** 41
- **Forks:** 0
- **Owner:** kukapay
- **GitHub:** https://github.com/kukapay/dune-analytics-mcp
- **Created:** 2025-03-16T03:25:40+00:00
- **Updated:** 2025-03-28T21:59:55+00:00
- **Source:** https://model-context-protocol.com/servers/dune-analytics-data-bridge-for-ai

## Setup

## Setup

1. **Clone the Repository**:
   ```bash
   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:
   ```bash
   export DUNE_API_KEY="your_api_key_here"
   ```

## Tools

## Available Tools

1. `get_latest_result` (Fetch the latest results of a Dune query by ID.)
2. `run_query` (Execute a Dune query by ID and retrieve results.)
3. CSV Output (All results are returned as CSV-formatted strings for easy processing.)
