cryo.com
cryo.com logo

Cryo

Provides a powerful Ethereum blockchain data extraction and analysis interface using Cryo and DuckDB, enabling efficient...

Created byApr 22, 2025

Cryo MCP

A Model Completion Protocol (MCP) server for the Cryo blockchain data extraction tool.
Cryo MCP allows you to access Cryo's powerful blockchain data extraction capabilities via an API server that implements the MCP protocol, making it easy to query blockchain data from any MCP-compatible client.

For LLM Users: SQL Query Workflow Guide

When using this MCP server to run SQL queries on blockchain data, follow this workflow:
  1. Download data with query_dataset:
  1. Explore schema with get_sql_table_schema:
  1. Run SQL with query_sql:
Alternatively, use the combined approach with query_blockchain_sql:
For a complete working example, see examples/sql_workflow_example.py.

Features

  • Full Cryo Dataset Access: Query any Cryo dataset through an API server
  • MCP Integration: Works seamlessly with MCP clients
  • Flexible Query Options: Support for all major Cryo filtering and output options
  • Block Range Options: Query specific blocks, latest block, or relative ranges
  • Contract Filtering: Filter data by contract address
  • Latest Block Access: Easy access to the latest Ethereum block data
  • Multiple Output Formats: JSON, CSV, and Parquet support
  • Schema Information: Get detailed dataset schemas and sample data
  • SQL Queries: Run SQL queries directly against downloaded blockchain data

Installation (Optional)

This is not required if you will run the tool with uvx directly.

Requirements

  • Python 3.8+
  • uv
  • A working installation of Cryo
  • Access to an Ethereum RPC endpoint
  • DuckDB (for SQL query functionality)

Quick Start

Usage with Claude Code

  1. Run claude mcp add for an interactive prompt.
  1. Enter uvx as the command to run.
  1. Enter cryo-mcp --rpc-url <ETH_RPC_URL> [--data-dir <DATA_DIR>] as the args
  1. Alternatively, provide ETH_RPC_URL and CRYO_DATA_DIR as environment variables instead.
New instances of claude will now have access to cryo as configured to hit your RPC endpoint and store data in the specified directory.

Available Tools

Cryo MCP exposes the following MCP tools:

`list_datasets()`

Returns a list of all available Cryo datasets.
Example:

`query_dataset()`

Query a Cryo dataset with various filtering options.
Parameters:
  • dataset (str): The name of the dataset to query (e.g., 'blocks', 'transactions', 'logs')
  • blocks (str, optional): Block range specification (e.g., '1000:1010')
  • start_block (int, optional): Start block number (alternative to blocks)
  • end_block (int, optional): End block number (alternative to blocks)
  • use_latest (bool, optional): If True, query the latest block
  • blocks_from_latest (int, optional): Number of blocks from latest to include
  • contract (str, optional): Contract address to filter by
  • output_format (str, optional): Output format ('json', 'csv', 'parquet')
  • include_columns (list, optional): Columns to include alongside defaults
  • exclude_columns (list, optional): Columns to exclude from defaults
Example:

`lookup_dataset()`

Get detailed information about a specific dataset, including schema and sample data.
Parameters:
  • name (str): The name of the dataset to look up
  • sample_start_block (int, optional): Start block for sample data
  • sample_end_block (int, optional): End block for sample data
  • use_latest_sample (bool, optional): Use latest block for sample
  • sample_blocks_from_latest (int, optional): Number of blocks from latest for sample
Example:

`get_latest_ethereum_block()`

Returns information about the latest Ethereum block.
Example:

SQL Query Tools

Cryo MCP includes several tools for running SQL queries against blockchain data:

`query_sql()`

Run a SQL query against downloaded blockchain data.
Parameters:
  • query (str): SQL query to execute
  • files (list, optional): List of parquet file paths to query. If None, will use all files in the data directory.
  • include_schema (bool, optional): Whether to include schema information in the result
Example:

`query_blockchain_sql()`

Query blockchain data using SQL, automatically downloading any required data.
Parameters:
  • sql_query (str): SQL query to execute
  • dataset (str, optional): The dataset to query (e.g., 'blocks', 'transactions')
  • blocks (str, optional): Block range specification
  • start_block (int, optional): Start block number
  • end_block (int, optional): End block number
  • use_latest (bool, optional): If True, query the latest block
  • blocks_from_latest (int, optional): Number of blocks before the latest to include
  • contract (str, optional): Contract address to filter by
  • force_refresh (bool, optional): Force download of new data even if it exists
  • include_schema (bool, optional): Include schema information in the result
Example:

`list_available_sql_tables()`

List all available tables that can be queried with SQL.
Example:

`get_sql_table_schema()`

Get the schema for a specific parquet file.
Parameters:
  • file_path (str): Path to the parquet file
Example:

`get_sql_examples()`

Get example SQL queries for different blockchain datasets.
Example:

Configuration Options

When starting the Cryo MCP server, you can use these command-line options:
  • --rpc-url URL: Ethereum RPC URL (overrides ETH_RPC_URL environment variable)
  • --data-dir PATH: Directory to store downloaded data (overrides CRYO_DATA_DIR environment variable, defaults to ~/.cryo-mcp/data/)

Environment Variables

  • ETH_RPC_URL: Default Ethereum RPC URL to use when not specified via command line
  • CRYO_DATA_DIR: Default directory to store downloaded data when not specified via command line

Advanced Usage

SQL Queries Against Blockchain Data

Cryo MCP allows you to run powerful SQL queries against blockchain data, combining the flexibility of SQL with Cryo's data extraction capabilities:

Two-Step SQL Query Flow

You can split data extraction and querying into two separate steps:

Combined SQL Query Flow

For convenience, you can also use the combined function that handles both steps:
Note: For SQL queries, always use output_format="parquet" when downloading data to ensure optimal performance with DuckDB. When using query_blockchain_sql, you should refer to the file paths directly in your SQL using the read_parquet() function.

Querying with Block Ranges

Cryo MCP supports the full range of Cryo's block specification syntax:

Contract Filtering

Filter logs and other data by contract address:

Column Selection

Include only the columns you need:

Development

Project Structure

Run Tests

uv run pytest

License

MIT

Credits

  • Built on top of the amazing Cryo tool by Paradigm

Cryo MCP

A Model Completion Protocol (MCP) server for the Cryo blockchain data extraction tool.
Cryo MCP allows you to access Cryo's powerful blockchain data extraction capabilities via an API server that implements the MCP protocol, making it easy to query blockchain data from any MCP-compatible client.

For LLM Users: SQL Query Workflow Guide

When using this MCP server to run SQL queries on blockchain data, follow this workflow:
  1. Download data with query_dataset:
  1. Explore schema with get_sql_table_schema:
  1. Run SQL with query_sql:
Alternatively, use the combined approach with query_blockchain_sql:
For a complete working example, see examples/sql_workflow_example.py.

Features

  • Full Cryo Dataset Access: Query any Cryo dataset through an API server
  • MCP Integration: Works seamlessly with MCP clients
  • Flexible Query Options: Support for all major Cryo filtering and output options
  • Block Range Options: Query specific blocks, latest block, or relative ranges
  • Contract Filtering: Filter data by contract address
  • Latest Block Access: Easy access to the latest Ethereum block data
  • Multiple Output Formats: JSON, CSV, and Parquet support
  • Schema Information: Get detailed dataset schemas and sample data
  • SQL Queries: Run SQL queries directly against downloaded blockchain data

Installation (Optional)

This is not required if you will run the tool with uvx directly.

Requirements

  • Python 3.8+
  • uv
  • A working installation of Cryo
  • Access to an Ethereum RPC endpoint
  • DuckDB (for SQL query functionality)

Quick Start

Usage with Claude Code

  1. Run claude mcp add for an interactive prompt.
  1. Enter uvx as the command to run.
  1. Enter cryo-mcp --rpc-url <ETH_RPC_URL> [--data-dir <DATA_DIR>] as the args
  1. Alternatively, provide ETH_RPC_URL and CRYO_DATA_DIR as environment variables instead.
New instances of claude will now have access to cryo as configured to hit your RPC endpoint and store data in the specified directory.

Available Tools

Cryo MCP exposes the following MCP tools:

`list_datasets()`

Returns a list of all available Cryo datasets.
Example:

`query_dataset()`

Query a Cryo dataset with various filtering options.
Parameters:
  • dataset (str): The name of the dataset to query (e.g., 'blocks', 'transactions', 'logs')
  • blocks (str, optional): Block range specification (e.g., '1000:1010')
  • start_block (int, optional): Start block number (alternative to blocks)
  • end_block (int, optional): End block number (alternative to blocks)
  • use_latest (bool, optional): If True, query the latest block
  • blocks_from_latest (int, optional): Number of blocks from latest to include
  • contract (str, optional): Contract address to filter by
  • output_format (str, optional): Output format ('json', 'csv', 'parquet')
  • include_columns (list, optional): Columns to include alongside defaults
  • exclude_columns (list, optional): Columns to exclude from defaults
Example:

`lookup_dataset()`

Get detailed information about a specific dataset, including schema and sample data.
Parameters:
  • name (str): The name of the dataset to look up
  • sample_start_block (int, optional): Start block for sample data
  • sample_end_block (int, optional): End block for sample data
  • use_latest_sample (bool, optional): Use latest block for sample
  • sample_blocks_from_latest (int, optional): Number of blocks from latest for sample
Example:

`get_latest_ethereum_block()`

Returns information about the latest Ethereum block.
Example:

SQL Query Tools

Cryo MCP includes several tools for running SQL queries against blockchain data:

`query_sql()`

Run a SQL query against downloaded blockchain data.
Parameters:
  • query (str): SQL query to execute
  • files (list, optional): List of parquet file paths to query. If None, will use all files in the data directory.
  • include_schema (bool, optional): Whether to include schema information in the result
Example:

`query_blockchain_sql()`

Query blockchain data using SQL, automatically downloading any required data.
Parameters:
  • sql_query (str): SQL query to execute
  • dataset (str, optional): The dataset to query (e.g., 'blocks', 'transactions')
  • blocks (str, optional): Block range specification
  • start_block (int, optional): Start block number
  • end_block (int, optional): End block number
  • use_latest (bool, optional): If True, query the latest block
  • blocks_from_latest (int, optional): Number of blocks before the latest to include
  • contract (str, optional): Contract address to filter by
  • force_refresh (bool, optional): Force download of new data even if it exists
  • include_schema (bool, optional): Include schema information in the result
Example:

`list_available_sql_tables()`

List all available tables that can be queried with SQL.
Example:

`get_sql_table_schema()`

Get the schema for a specific parquet file.
Parameters:
  • file_path (str): Path to the parquet file
Example:

`get_sql_examples()`

Get example SQL queries for different blockchain datasets.
Example:

Configuration Options

When starting the Cryo MCP server, you can use these command-line options:
  • --rpc-url URL: Ethereum RPC URL (overrides ETH_RPC_URL environment variable)
  • --data-dir PATH: Directory to store downloaded data (overrides CRYO_DATA_DIR environment variable, defaults to ~/.cryo-mcp/data/)

Environment Variables

  • ETH_RPC_URL: Default Ethereum RPC URL to use when not specified via command line
  • CRYO_DATA_DIR: Default directory to store downloaded data when not specified via command line

Advanced Usage

SQL Queries Against Blockchain Data

Cryo MCP allows you to run powerful SQL queries against blockchain data, combining the flexibility of SQL with Cryo's data extraction capabilities:

Two-Step SQL Query Flow

You can split data extraction and querying into two separate steps:

Combined SQL Query Flow

For convenience, you can also use the combined function that handles both steps:
Note: For SQL queries, always use output_format="parquet" when downloading data to ensure optimal performance with DuckDB. When using query_blockchain_sql, you should refer to the file paths directly in your SQL using the read_parquet() function.

Querying with Block Ranges

Cryo MCP supports the full range of Cryo's block specification syntax:

Contract Filtering

Filter logs and other data by contract address:

Column Selection

Include only the columns you need:

Development

Project Structure

Run Tests

uv run pytest

License

MIT

Credits

  • Built on top of the amazing Cryo tool by Paradigm