home / mcp / spice mcp server

Spice MCP Server

dune analytics mcp built with spellbooks + dune api

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "evan-kim2028-spice-mcp": {
      "command": "spice-mcp",
      "args": [],
      "env": {
        "DUNE_API_KEY": "YOUR_DUNE_API_KEY"
      }
    }
  }
}

Spice MCP Server provides a clean, type-safe interface that lets AI agents query Dune Analytics data, discover verified tables, and manage saved queries. It’s designed to be agent-friendly and to minimize memory usage with a lazy, polars-first data pipeline, making it easy to build AI workflows around blockchain datasets.

How to use

You connect your MCP client to Spice MCP Server to run queries, discover tables, and manage saved queries. Use the standard MCP client workflow to execute a saved query by ID or URL, discover high-quality tables from Dune Spellbook, and browse table schemas. All actions are exposed as typed endpoints with clear parameter and response shapes, so you can build robust AI prompts and tooling around these capabilities.

How to install

Prerequisites you need before installing Spice MCP Server:

- Python 3.13+ to run the server code and install dependencies.

Install the Spice MCP package from PyPI.

pip install spice-mcp

Configuration and environment

Set your Dune API key so Spice MCP Server can access Dune data. You can provide the key via a project environment file or by exporting it in your shell.

echo "DUNE_API_KEY=your-api-key-here" > .env
```

```
export DUNE_API_KEY=your-api-key-here

Run and connect from an MCP client

Add Spice MCP Server to your MCP client configuration. The server runs as a local process and uses the provided API key to authenticate with Dune. Start the server in your environment and connect your MCP client using the following configuration.

{
  "name": "spice-mcp",
  "command": "spice-mcp",
  "env": {
    "DUNE_API_KEY": "your-dune-api-key-here"
  }
}

Notes on usage and logs

Query history logging is enabled by default. Logs are stored in logs/queries.jsonl, or in ~/.spice_mcp/logs/queries.jsonl if you run outside a project directory. You can customize paths by setting SPICE_QUERY_HISTORY and SPICE_ARTIFACT_ROOT environment variables.

Admin actions (create/update/fork/archive/unarchive) are recorded with action_type="admin_action" and include the related query_id for traceability.

Available tools

dune_query

Execute queries by ID, URL, or raw SQL with parameters, limits, and formats (preview, raw, metadata, poll).

dune_query_info

Retrieve metadata for a saved query by ID or URL.

dune_discover

Unified discovery across Dune API and Spellbook to surface verified, production-ready tables, with optional keyword, schema, limit, and source filters.

dune_describe_table

Get column metadata for a specified table, including data types and descriptions.

dune_health_check

Verify API key and server configuration to ensure connectivity.

dune_query_create

Create a new saved query with a name, SQL, description, tags, and parameters.

dune_query_update

Update an existing saved query by ID with new name, SQL, description, tags, and parameters.

dune_query_fork

Fork an existing saved query by source ID to create a new saved query.

dune_query_archive

Archive a saved query by ID.

dune_query_unarchive

Unarchive a saved query by ID.