Blocknative MCP Server

Blocknative MCP Server

Real-time multi-chain gas price prediction server compliant with Model Context Protocol.

4
Stars
8
Forks
4
Watchers
2
Issues
Blocknative MCP Server provides real-time gas price predictions and transaction cost estimations across multiple blockchains using Blocknative’s APIs. It offers tools for predicting gas prices, estimating gas costs, and listing supported chains, all accessible through MCP-compatible interfaces. The server is asynchronous, supports both authenticated and unauthenticated API usage, and can be integrated with developer tooling such as Claude Desktop and FastMCP. Interactive prompts and a web inspector enhance developer experience for exploring gas price data.

Key Features

Fetches real-time gas price predictions with confidence intervals
Estimates transaction costs in Gwei and ETH
Supports multiple blockchains and chain IDs
Provides a prompt template for querying gas prices
Asynchronous HTTP requests with httpx for efficiency
Optional Blocknative API key support for higher rate limits
Integration with MCP Inspector for interactive testing
Compatible with Claude Desktop and FastMCP framework
Markdown tabular output for gas data
Development tooling with uv for easy setup and management

Use Cases

Dynamically fetching up-to-date gas price predictions for wallet interfaces
Estimating transaction fees before submitting blockchain transactions
Supporting automated trading systems with real-time cost analysis
Enhancing dApp user experience with contextual gas pricing
Integrating with AI assistants for natural language blockchain queries
Monitoring and analyzing network congestion across multiple chains
Educating new blockchain users on transaction costs and fee estimation
Optimizing smart contract gas strategies based on current network conditions
Scripting and automating blockchain interactions in Python environments
Research and analytics on historical and real-time gas trends by chain

README

Blocknative MCP Server

An MCP server that provides real-time gas price predictions across multiple blockchains, powered by Blocknative.

GitHub License Python Version Status

Features

  • Tools:
    • predict_gas_price: Fetches gas price predictions for a specified chain (default: Ethereum Mainnet, chain_id=1), including 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.
  • Prompt:
    • gas_price_query: A prompt template for querying gas prices at a specific confidence level and chain ID.
  • Asynchronous: Uses httpx for non-blocking HTTP requests to Blocknative's Gas Price and Chains APIs.
  • Optional API Key: Supports low-frequency access without a Blocknative API key; high-frequency use requires setting BLOCKNATIVE_API_KEY.

Prerequisites

  • Python: Version 3.10
  • uv: For dependency management and running the project (installation guide)
  • Blocknative API Key (optional): Required for high-frequency API access. Sign up at Blocknative to obtain a free API key.

Installation

  1. Clone the Repository:

    bash
    git clone https://github.com/kukapay/blocknative-mcp.git
    cd blocknative-mcp
    
  2. Set Up the Project with uv:

    bash
    uv sync
    
  3. Set the Blocknative API Key (Optional):

    • For high-frequency access, set the environment variable:
      bash
      export BLOCKNATIVE_API_KEY="your-api-key-here"
      
    • For low-frequency access, skip this step.

Usage

The server provides three tools and one prompt, accessible via the FastMCP framework. You can run the server in development mode, execute it directly, or integrate it with Claude Desktop.

Running the Server

  1. Development Mode with MCP Inspector:

    bash
    uv run mcp dev blocknative-mcp
    

    This opens the MCP Inspector, a web interface for testing tools and prompts interactively.

  2. Direct Execution:

    bash
    uv run blocknative-mcp
    
  3. Claude Desktop Integration:

    bash
    uv run mcp install blocknative-mcp --name "Blocknative MCP Server"
    

    This installs the server for use with Claude Desktop.

Tools

  • predict_gas_price(chain_id: int = 1) -> str: Fetches gas price predictions for a chain (default: Ethereum Mainnet). Returns base fee and a Markdown table with confidence levels, price, max priority fee, and max fee.

    • Example:
      markdown
      Gas Price Predictions for Chain ID 1 (ethereum/main):
      - Base Fee Per Gas: 0.382910791 Gwei
      
      | Confidence | Price (Gwei) | Max Priority Fee (Gwei) | Max Fee (Gwei) |
      |------------|--------------|-------------------------|----------------|
      | 99%        | 0.52         | 0.14                    | 0.9            |
      | 95%        | 0.48         | 0.094                   | 0.86           |
      | 90%        | 0.47         | 0.089                   | 0.85           |
      | 80%        | 0.46         | 0.079                   | 0.84           |
      | 70%        | 0.45         | 0.069                   | 0.83           |
      
  • estimate_gas_cost(gas_limit: int, confidence: int = 99, chain_id: int = 1) -> str: Estimates transaction costs based on gas limit, confidence level, and chain ID. Returns costs in Gwei and ETH.

    • Example:
      markdown
      Estimated Gas Cost (Confidence 90%, Chain ID 1):
      - Gas Limit: 21000
      - Max Fee Per Gas: 0.85 Gwei
      - Total Cost: 17850 Gwei (0.00001785 ETH)
      
  • get_supported_chains(ctx: Optional[Context] = None) -> str: Lists supported chains in a Markdown table with chain ID, system, and network.

    • Example:
      markdown
      Supported Chains:
      
      | Chain ID   | System   | Network   |
      |------------|----------|-----------|
      | 1          | ethereum | main      |
      | 137        | polygon  | mainnet   |
      | 8453       | base     | mainnet   |
      | 11155111   | ethereum | sepolia   |
      

Prompts

  • gas_price_query(confidence: int, chain_id: int = 1) -> List[base.Message]: A prompt template for querying gas prices at a specific confidence level and chain ID.
    • Example:
      markdown
      - User: What is the current gas price for chain ID 1 transactions with 90% confidence?
      - Assistant: Let me fetch the gas price predictions for chain ID 1.
      

License

This project is licensed under the MIT License. See the LICENSE file for details.

Star History

Star History Chart

Repository Owner

kukapay
kukapay

User

Repository Details

Language Python
Default Branch main
Size 18 KB
Contributors 1
License MIT License
MCP Verified Nov 12, 2025

Programming Languages

Python
100%

Tags

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • Web3 MCP

    Web3 MCP

    A Model Context Protocol server for unified blockchain data access.

    Web3 MCP is a Model Context Protocol server that provides access to blockchain data through Ankr's Advanced API. It allows large language models to interact seamlessly with multiple blockchain networks such as Ethereum, BSC, Polygon, and Avalanche. With support for NFT, token, and blockchain query APIs, it enables users and AI agents to retrieve on-chain data, statistics, and analytics efficiently within an MCP context.

    • 3
    • MCP
    • tumf/web3-mcp
  • NyxDocs

    NyxDocs

    MCP server for real-time cryptocurrency project documentation and insights.

    NyxDocs is a Model Context Protocol (MCP) compatible server built in Python for managing and serving up-to-date documentation for cryptocurrency projects. It aggregates information from multiple sources such as CoinGecko, GitHub, GitBook, Notion, and official websites, providing real-time data and updates on blockchain ecosystems. Featuring tools for searching projects, retrieving detailed info, extracting documentation, and monitoring changes, it is tailored for developers and AI contexts needing access to accurate crypto documentation. The architecture leverages a FastMCP-based server core, automated document scrapers, and supports multi-blockchain environments.

    • 3
    • MCP
    • nyxn-ai/NyxDocs
  • Chainlink Feeds MCP Server

    Chainlink Feeds MCP Server

    Real-time Chainlink price feeds via the Model Context Protocol.

    Provides an MCP server that enables real-time access to Chainlink’s decentralized on-chain price feeds, designed for seamless integration with AI agents and autonomous systems. Supports multiple blockchain networks and hundreds of price feeds, allowing querying of latest prices, historical data (by round ID), and discovery of supported feeds and chains. Allows configuration of custom feeds and endpoints via a JSON file, and is optimized for integration into agents using standardized MCP tools and workflows. Features tight integration with tools like Claude Desktop and MCP Inspector for both natural language and programmatic querying.

    • 5
    • MCP
    • kukapay/chainlink-feeds-mcp
  • Blockchain MCP powered by Tatum

    Blockchain MCP powered by Tatum

    MCP server for universal blockchain data access across 130+ networks.

    Blockchain MCP powered by Tatum is a Model Context Protocol (MCP) server that enables large language models (LLMs) to read and write blockchain data across more than 130 networks. It provides unified access to both the Tatum Blockchain Data API and direct RPC gateways, supporting tools for retrieving balances, portfolios, transactions, and more. The platform is designed for seamless integration via API key and configurable MCP client setups, making it easier to build blockchain-aware AI solutions. Comprehensive documentation and extensive network compatibility facilitate robust development and scalability.

    • 12
    • MCP
    • tatumio/blockchain-mcp
  • Chainlist MCP Server

    Chainlist MCP Server

    Fast, structured EVM chain info for AI agents via the Model Context Protocol

    Chainlist MCP Server enables AI agents and MCP-compatible clients to quickly access and search verified EVM blockchain data. It sources data from Chainlist.org and provides efficient REST-like tools for retrieving details by chain ID or searching by keyword. The server outputs structured Markdown responses, supporting AI context integration with tabulated RPC endpoints and explorers for clarity.

    • 2
    • MCP
    • kukapay/chainlist-mcp
  • EVM MCP Server

    EVM MCP Server

    Unified Model Context Protocol server for multi-chain EVM blockchain access

    EVM MCP Server provides a comprehensive Model Context Protocol-compliant interface for blockchain services across 30+ EVM-compatible networks. It enables AI agents and other clients to interact programmatically with Ethereum, Optimism, Arbitrum, Base, Polygon, and more via standardized tools and resources. Features include blockchain data access, smart contract interactions, token transfers (including NFTs), ENS name resolution, and multi-network support. The server ensures a consistent and context-aware interface for AI and software agents to discover and leverage on-chain functionality.

    • 340
    • MCP
    • mcpdotdirect/evm-mcp-server
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results