home / mcp / blocknative mcp server

Blocknative MCP Server

Provides real-time gas price predictions and cost estimates across multiple blockchains via an MCP server.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "kukapay-blocknative-mcp": {
      "command": "uv",
      "args": [
        "run",
        "blocknative-mcp"
      ],
      "env": {
        "BLOCKNATIVE_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

You run a Blocknative MCP Server that provides real-time gas price predictions across multiple blockchains. It’s useful for applications that need up-to-date fee guidance and cost estimates to optimize transactions and user experience.

How to use

Connect to the Blocknative MCP Server from your MCP client to access three tools and one prompt for gas price data. You can run in development mode to test interactively, execute it directly, or integrate it with Claude Desktop.

Use the tools to fetch gas price predictions, estimate costs, and view supported chains. The server operates asynchronously to keep your application responsive.

How to install

Prerequisites: you need Python (version 3.10) and the uv tool for dependency management and running the project.

Install and run the MCP server using the following steps.

# Step 1: Install and sync dependencies using uv
uv sync

# Step 2: Start the MCP server in development mode (interactive inspector)
uv run mcp dev blocknative-mcp

# Alternative: run the server directly without the inspector
uv run blocknative-mcp

# Claude Desktop integration (for use within Claude Desktop)
uv run mcp install blocknative-mcp --name "Blocknative MCP Server"

Additional notes

Environment variable for API access: high-frequency usage requires a Blocknative API key. Set BLOCKNATIVE_API_KEY to enable higher rate access. Use a placeholder value when configuring in examples.

The server supports low-frequency access without an API key while high-frequency access requires the key. You can leave the API key unset for development or testing with limited requests.

Available tools

predict_gas_price

Fetches gas price predictions for a specified chain, returning a base fee and a table with confidence levels, price, max priority fee, and max fee.

estimate_gas_cost

Estimates transaction costs based on gas limit, confidence level, and chain ID, returning costs in Gwei and ETH.

get_supported_chains

Lists supported blockchains in a table with chain ID, system, and network.

gas_price_query

A prompt template for querying gas prices at a specific confidence level and chain ID.