dune-analytics-mcp
v1.0.1
Published
Model Context Protocol server for Dune Analytics - Execute queries, manage tables, and access blockchain analytics
Downloads
13
Maintainers
Readme
Dune Analytics MCP Server
A Model Context Protocol (MCP) server that provides seamless integration with Dune Analytics. Execute queries, manage tables, work with materialized views, and access blockchain analytics data directly through the MCP protocol.
Features
- Query Execution: Execute Dune queries with parameters, get results in JSON or CSV format
- Query Management: Create, update, archive, and manage Dune queries programmatically
- Custom Tables: Create and manage custom data tables in your Dune namespace
- Materialized Views: Set up and manage materialized views with automatic refresh schedules
- Custom Endpoints: Access custom API endpoints for specialized data retrieval
- Full API Coverage: Comprehensive support for the Dune Analytics API
Prerequisites
You need a Dune Analytics API key to use this MCP server.
Get your API key from dune.com/settings/api. You'll need to:
- Sign up or log in to Dune Analytics
- Navigate to Settings → API
- Create a new API key
- Copy the key for use in the installation steps below
Installation
Quick Start with Claude Code
claude mcp add --transport stdio dune-analytics-tools --env DUNE_API_KEY=your_api_key_here -- npx -y dune-analytics-mcpReplace your_api_key_here with your actual Dune API key from dune.com/settings/api.
Using with Claude Desktop
Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"dune": {
"command": "npx",
"args": ["-y", "dune-analytics-mcp"],
"env": {
"DUNE_API_KEY": "your_api_key_here"
}
}
}
}Package Installation
npm install dune-analytics-mcpOr install globally:
npm install -g dune-analytics-mcpAvailable Tools
Query Execution
execute_query- Start a query execution (returns execution_id)get_execution_status- Check status of a running queryget_execution_results- Get results of a completed query (JSON)get_execution_results_csv- Get results in CSV formatcancel_execution- Cancel a running queryrun_query- Execute query and wait for results (convenience method)get_latest_results- Get cached results without using creditsget_latest_results_csv- Get cached results in CSV format
Query Management
create_query- Create a new Dune queryupdate_query- Update an existing queryread_query- Read query metadata and SQLarchive_query- Archive a queryunarchive_query- Restore an archived querymake_query_private- Make a query privatemake_query_public- Make a query public
Table Management
create_table- Create a custom data tableinsert_table- Insert data into a table (CSV/JSON/NDJSON)delete_table- Delete a table
Materialized Views
list_materialized_views- List all materialized viewsupsert_materialized_view- Create or update a materialized viewdelete_materialized_view- Delete a materialized viewrefresh_materialized_view- Manually trigger a refresh
Custom Endpoints
get_custom_results- Access custom API endpoints by username/slug
API Coverage
This MCP server provides complete coverage of the Dune Analytics API:
- ✅ Query Execution API
- ✅ Query Management API
- ✅ Table Management API
- ✅ Materialized Views API
- ✅ Custom Endpoints API
Development
# Clone the repository
git clone https://github.com/hajnalben/dune-analytics-mcp.git
cd dune-mcp
# Install dependencies
npm install
# Build
npm run build
# Run locally
DUNE_API_KEY=your_key node dist/index.jsRequirements
- Node.js >= 20.0.0 (LTS)
- Dune Analytics API key
Links
License
MIT License - see LICENSE file for details
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Support
For issues and questions:
