Model Context Protocol server for Dune Analytics - Execute queries, manage tables, and access blockchain analytics
npm install dune-analytics-mcpA 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.
- 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
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:
1. Sign up or log in to Dune Analytics
2. Navigate to Settings → API
3. Create a new API key
4. Copy the key for use in the installation steps below
``bash`
claude mcp add --transport stdio dune-analytics-tools --env DUNE_API_KEY=your_api_key_here -- npx -y dune-analytics-mcp
Replace your_api_key_here with your actual Dune API key from dune.com/settings/api.
Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
`json`
{
"mcpServers": {
"dune": {
"command": "npx",
"args": ["-y", "dune-analytics-mcp"],
"env": {
"DUNE_API_KEY": "your_api_key_here"
}
}
}
}
`bash`
npm install dune-analytics-mcp
Or install globally:
`bash`
npm install -g dune-analytics-mcp
- 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
- 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
- create_table - Create a custom data tableinsert_table
- - Insert data into a table (CSV/JSON/NDJSON)delete_table
- - Delete a table
- 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
- get_custom_results - Access custom API endpoints by username/slug
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
`bashClone the repository
git clone https://github.com/hajnalben/dune-analytics-mcp.git
cd dune-mcp
- Node.js >= 20.0.0 (LTS)
- Dune Analytics API key
- Dune Analytics
- Dune API Documentation
- Model Context Protocol
MIT License - see LICENSE file for details
Contributions are welcome! Please feel free to submit a Pull Request.
For issues and questions:
- GitHub Issues