Spice MCP
Spice MCP is an MCP server that provides AI agents with direct access to Dune Analytics blockchain data through a type-safe interface optimized for AI workflows.
Core Capabilities:
Query Execution: Run Dune queries by ID, URL, or raw SQL with support for parameters, limits, offsets, and multiple output formats (preview, raw, metadata, poll)
Query Management: Create, update, fork, archive, and unarchive saved queries with full metadata management (name, parameters, tags, SQL)
Schema Discovery: Search and discover verified tables across Dune schemas using keywords, with filtering by schema and source (Dune API, Spellbook, or both)
Table Analysis: Get detailed column metadata and descriptions for specific tables to understand data structure
Sui Blockchain Analysis: Get compact overviews of Sui package activity with customizable time windows
Health Monitoring: Validate API key configuration and server health status
Key Features:
High-Quality Data: Leverages Dune Spellbook's curated dbt models to surface verified, production-ready tables with rich metadata
Efficient Processing: Uses Polars-first pipeline for lazy data loading and reduced memory usage
Reproducibility: Automatic query history logging and SQL artifact storage (accessible via SHA-256 hash) for traceability
Blockchain Coverage: Access to Ethereum, Solana, Polygon, and other blockchain datasets
Provides tools for exploring Sui blockchain packages, including querying events, transactions, and objects, with package overview and activity analysis capabilities through Dune Analytics.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Spice MCP show me the top 10 NFT collections by volume this week"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
spice-mcp
An MCP server that provides AI agents with direct access to Dune Analytics data. Execute queries, discover schemas and tables, and manage saved queries—all through a clean, type-safe interface optimized for AI workflows.
Discover High-Quality Tables: Leverages Dune Spellbook, Dune's official GitHub repository of curated dbt models, to surface verified, production-ready tables with rich metadata.
Why spice-mcp?
Agent-friendly: Designed for AI agents using the Model Context Protocol (MCP)
High-Quality Discovery: Leverages Dune Spellbook's GitHub repository to find verified, production-ready tables with rich metadata
Efficient: Polars-first pipeline keeps data lazy until needed, reducing memory usage
Discovery: Built-in tools to explore Dune's extensive blockchain datasets from both Dune API and Spellbook
Type-safe: Fully typed parameters and responses with FastMCP
Reproducible: Automatic query history logging and SQL artifact storage
Related MCP server: dune-mcp
Quick Start
Install:
uv pip install spice-mcpSet API key (choose one method):
Option A: Create a
.envfile in your project root:echo "DUNE_API_KEY=your-api-key-here" > .envOption B: Export in your shell:
export DUNE_API_KEY=your-api-key-here
Use with Cursor IDE: Add to Cursor Settings → MCP Servers:
{ "name": "spice-mcp", "command": "spice-mcp", "env": { "DUNE_API_KEY": "your-dune-api-key-here" } }
Note: Query history logging is enabled by default. Logs are saved to logs/queries.jsonl (or ~/.spice_mcp/logs/queries.jsonl if not in a project directory). To customize paths, set SPICE_QUERY_HISTORY and SPICE_ARTIFACT_ROOT environment variables.
Admin operations (create/update/fork/archive/unarchive) are logged with action_type="admin_action" and include query_id for traceability.
Core Tools
Tool | Description | Key Parameters |
| Execute queries by ID, URL, or raw SQL |
|
| Get metadata for a saved query |
|
| Unified discovery across Dune API and Spellbook (returns verified tables only). Leverages Dune Spellbook GitHub repository for high-quality, curated tables. |
|
| Get column metadata for a table |
|
| Verify API key and configuration | (no parameters) |
| Create a new saved query |
|
| Update an existing saved query |
|
| Fork an existing saved query |
|
| Archive a saved query |
|
| Unarchive a saved query |
|
Resources
spice:history/tail/{n}— View last N lines of query history (1-1000)spice:artifact/{sha}— Retrieve stored SQL by SHA-256 hash
What is Dune?
Dune is a crypto data platform providing curated blockchain datasets and a public API. It aggregates on-chain data from Ethereum, Solana, Polygon, and other chains into queryable SQL tables. See the Dune Docs for more information.
What is Dune Spellbook?
Dune Spellbook is Dune's official GitHub repository containing thousands of curated dbt models. These models represent high-quality, production-ready tables that are:
Verified: All tables are verified to exist in Dune before being returned
Well-documented: Rich metadata including column descriptions and types
Maintained: Regularly updated by the Dune community and team
Production-ready: Used by analysts and dashboards across the ecosystem
spice-mcp automatically clones and parses the Spellbook repository to discover these high-quality tables, parsing dbt config blocks to resolve actual Dune table names and verifying their existence before returning them to you.
Installation
From PyPI (recommended):
uv pip install spice-mcpFrom source:
git clone https://github.com/Evan-Kim2028/spice-mcp.git
cd spice-mcp
uv sync
uv pip install -e .Requirements: Python 3.13+
Documentation
Tool Reference — Complete tool documentation with parameters
Architecture — Code structure and design patterns
Discovery Guide — How to explore Dune schemas and tables
Dune API Guide — Understanding Dune's data structure
Configuration — Environment variables and settings
License
See LICENSE file for details.
Available Tools
10 toolsdune_describe_tableDescribe TableC
Describe columns for a schema.table on Dune.
Inputs: schema (required), table (required). Returns: object
dune_discoverDiscover TablesA
Unified tool to discover tables/models from Dune API and/or Spellbook repository. Search by keyword(s) or list tables in a schema.
Inputs: keyword, schema, limit, source, +1 more. Returns: object
dune_health_checkHealth CheckA
Validate Dune API key presence and logging setup.
Inputs: no named parameters. Returns: object
dune_queryRun Dune QueryC
Execute Dune queries and return agent-optimized preview.
Inputs: query (required), parameters, refresh, max_age, +8 more. Returns: object
dune_query_archiveArchive Saved QueryC
Archive a saved Dune query.
Inputs: query_id (required). Returns: object
dune_query_createCreate Saved QueryB
Create a new saved Dune query (name + SQL). Requires SPICE_DUNE_ALLOW_SAVES=true.
Inputs: name (required), query_sql (required), description, tags, +1 more. Returns: object
dune_query_forkFork Saved QueryC
Fork an existing saved Dune query. Requires SPICE_DUNE_ALLOW_SAVES=true.
Inputs: source_query_id (required), name. Returns: object
dune_query_infoQuery InfoC
Fetch Dune query metadata (name, parameters, tags, SQL).
Inputs: query (required). Returns: object
dune_query_unarchiveUnarchive Saved QueryC
Unarchive a saved Dune query.
Inputs: query_id (required). Returns: object
dune_query_updateUpdate Saved QueryC
Update fields of a saved Dune query (name/SQL/description/tags/parameters). Requires SPICE_DUNE_ALLOW_SAVES=true.
Inputs: query_id (required), name, query_sql, description, +2 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool has a clear, distinct purpose: describe table columns, discover tables/models, health check, execute query, and manage saved queries (create, info, update, archive, unarchive, fork). No overlap.
All tools follow the 'dune_' prefix with a verb_noun pattern (e.g., dune_describe_table, dune_query_create). The naming is uniform and predictable.
10 tools is well-scoped for a Dune analytics server, covering core table inspection, query execution, and saved query lifecycle without unnecessary bloat.
Covers essential operations: describing/discovering tables, health, query execution, and saved query CRUD (except delete). Missing a list saved queries tool and explicit deletion, but core workflows are supported.
Maintenance
Related MCP Connectors
Sui blockchain data in plain English: transactions, wallets, coins, balances, fund flows and SQL.
Blockchain analytics API for AI agents. Smart Money signals, wallet profiling, token analytics.
Blockchain analytics API for AI agents. Smart Money signals, wallet profiling, token analytics.
Query cryptocurrency on-chain data, OHLCV prices, market data, and Research & QuickTake insights.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAllows LLM agents and MCP clients to analyze blockchain data including wallet balances, token information, and transaction history across EVM and Solana chains through the Dune API.31 npm4MIT
- AlicenseBqualityCmaintenanceSecurely query Dune Analytics with LLMs. Features budget protection, query reuse, and optimized data summaries172MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to query and analyze blockchain data from Dune Analytics, supporting execution of saved queries, ad-hoc DuneSQL queries, and access to cached results with parameter support.MIT
- AlicenseAqualityDmaintenanceDune MCP Server connects your AI assistant to Dune Analytics, the leading platform for blockchain data. Execute SQL queries across Ethereum, Solana, and 20+ chains to analyze DEX trades, token transfers, NFT sales, and wallet activity. Manage saved queries, upload custom datasets, and access curate19MIT