Integrations
Fetches real-time gas price predictions for Ethereum Mainnet, estimates transaction costs, and provides information on base fees and priority fees.
Allows installation and usage of the MCP server from a GitHub repository, with license and version information displayed.
Provides real-time gas price predictions for Polygon network, allowing users to estimate transaction costs and optimize gas fees with different confidence levels.
Blocknative MCP Server
An MCP server that provides real-time gas price predictions across multiple blockchains, powered by Blocknative.
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
- Clone the Repository:Copy
- Set Up the Project with
uv
:Copy - Set the Blocknative API Key (Optional):
- For high-frequency access, set the environment variable:Copy
- For low-frequency access, skip this step.
- For high-frequency access, set the environment variable:
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
- Development Mode with MCP Inspector:This opens the MCP Inspector, a web interface for testing tools and prompts interactively.Copy
- Direct Execution:Copy
- Claude Desktop Integration:This installs the server for use with Claude Desktop.Copy
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:Copy
- Example:
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:Copy
- Example:
get_supported_chains(ctx: Optional[Context] = None) -> str
: Lists supported chains in a Markdown table with chain ID, system, and network.- Example:Copy
- Example:
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:Copy
- Example:
License
This project is licensed under the MIT License. See the LICENSE file for details.
You must be authenticated.
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
blocknative-mcp
Related MCP Servers
- JavaScriptMIT License
- Gozlib License
- GoMIT License
- PythonApache 2.0