Dune Query MCP

by olaxbt

Integrations

  • Enables configuration through environment variables for API access and server settings, particularly for storing the Dune Analytics API key.

  • Provides a web interface and REST API endpoints as an alternative to the MCP service, allowing access to Dune Analytics data through HTTP requests.

  • Used for source code management and enables contribution to the project through a structured branching workflow.

沙丘查询 MCP

通过模型控制协议 (MCP) 将 Dune Analytics 数据连接到智能代理的现代桥梁。

概述

dune-query-mcp 可将区块链数据分析无缝集成到您的 AI 应用程序中。通过利用 Dune Analytics 强大的查询功能和模型控制协议,该服务允许 LLM 和其他 AI 系统通过简单的自然语言交互访问链上数据。

核心能力

数据检索工具

工具描述用例
get_latest_result检索预先计算的查询结果快速访问现有数据
run_query按需执行查询实时数据分析

数据格式

所有数据均以 CSV 格式返回,提供:

  • 通用兼容性
  • 大多数数据分析工具都可以轻松解析
  • 人类可读的输出

入门

系统要求

  • Python 3.10 或更高版本
  • 有效的 Dune Analytics API 密钥(在此获取

快速设置

  1. 克隆和导航
    git clone https://github.com/olaxbt/dune-query-mcp-mcp.git cd dune-query-mcp
  2. 环境设置
    # Create virtual environment python -m venv .venv # Activate it source .venv/bin/activate # Linux/Mac # or .venv\Scripts\activate # Windows # Install dependencies pip install -r requirements.txt
  3. 配置 API 访问
    # Copy example config cp .env.example .env # Edit with your API key echo "DUNE_API_KEY=your_key_here" > .env

用法

运行服务

dune-query-mcp 提供两种运行方式:

作为 MCP 服务
python run.py

这将在默认端口 8000 上启动 MCP 服务。

作为 Web 服务器
python flask_app.py

这提供了对 Web 界面和 REST API 端点的访问。

与应用程序集成

MCP 客户端集成
from mcp.client import Client # Connect to Dune-query-mcp client = Client("http://localhost:8000") # Get latest results for a query csv_data = client.call("get_latest_result", query_id=1234567) # Execute a query query_results = client.call("run_query", query_id=1234567)
REST API
端点方法描述
/dune/health得到服务健康检查
/dune/query/{query_id}/latest得到检索最新结果
/dune/query/{query_id}/execute邮政运行查询

REST 调用示例:

curl -X GET http://localhost:5000/dune/query/1234567/latest

建筑学

dune-query-mcp/ ├── app/ # Application core │ ├── __init__.py # Flask & MCP setup │ ├── routes/ # API endpoint definitions │ │ └── dune_routes/ # Dune Analytics routes │ │ └── templates/ # Web interface │ └── templates/ # Web interface ├── config/ # Configuration files ├── logs/ # Runtime logs ├── flask_app.py # Web server entry point ├── run.py # MCP server entry point └── requirements.txt # Dependencies

高级配置

环境变量

多变的目的默认
DUNE_API_密钥Dune API 的身份验证无(必填)
港口服务器端口8000

性能调优

对于大容量查询执行:

# Set a higher timeout for long-running queries export DUNE_QUERY_TIMEOUT=600 # 10 minutes in seconds

故障排除

常见问题及解决方案:

问题解决方案
API 密钥错误确保.env文件存在且密钥有效
超时错误增加复杂查询的超时时间
CSV解析问题检查查询返回正确的表格数据

贡献

欢迎贡献!请按以下步骤操作:

  1. 分叉存储库
  2. 创建功能分支: git checkout -b feature/amazing-feature
  3. 提交您的更改: git commit -am 'Add some amazing feature'
  4. 推送到分支: git push origin feature/amazing-feature
  5. 打开拉取请求

执照

本项目遵循 MIT 许可证。详情请参阅LICENSE文件。

致谢

-
security - not tested
F
license - not found
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

通过模型控制协议将 Dune Analytics 区块链数据连接到 AI 应用程序的桥梁,允许 LLM 通过自然语言交互访问链上数据。

  1. 概述
    1. 核心能力
      1. 数据检索工具
      2. 数据格式
    2. 入门
      1. 系统要求
      2. 快速设置
    3. 用法
      1. 运行服务
      2. 与应用程序集成
    4. 建筑学
      1. 高级配置
        1. 环境变量
        2. 性能调优
      2. 故障排除
        1. 贡献
          1. 执照
            1. 致谢

              Related MCP Servers

              • -
                security
                F
                license
                -
                quality
                A Model Context Protocol server that enables AI assistants to access Flow blockchain data and perform operations such as checking balances, resolving domains, executing scripts, and submitting transactions.
                Last updated -
                JavaScript
                • Linux
                • Apple
              • A
                security
                F
                license
                A
                quality
                Implements the Model Context Protocol to allow AI models to access and interact with blockchain data, including reading contract states, retrieving events, and accessing transaction information across various networks.
                Last updated -
                10
                45
                30
                TypeScript
              • -
                security
                -
                license
                -
                quality
                A Model Context Protocol server that provides onchain tools for AI applications to interact with the Hashkey Network, enabling cryptocurrency transfers, smart contract deployment, and blockchain interactions.
                Last updated -
                TypeScript
                MIT License
              • -
                security
                F
                license
                -
                quality
                A Solana blockchain interaction server that allows AI tools to query blockchain data using natural language, access structured token information, and generate human-readable explanations of complex blockchain concepts.
                Last updated -
                7
                Python
                • Linux
                • Apple

              View all related MCP servers

              ID: ada80zl0zr