An MCP server that provides real-time gas price predictions across multiple blockchains, powered by Blocknative. - predictgasprice: Fetches gas price predictions for a specified chain (default: Ethereum Mainnet, chainid=1), including base fee and a table with confidence levels, price, max priority fee, and max fee. - estimategascost: Estimates transaction costs based on gas limit, confidence level
Add this skill
npx mdskills install kukapay/blocknative-mcpWell-documented MCP server providing blockchain gas price predictions with clear tools and setup
1# Blocknative MCP Server23An MCP server that provides real-time gas price predictions across multiple blockchains, powered by Blocknative.456789## Features1011- **Tools**:12 - `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.13 - `estimate_gas_cost`: Estimates transaction costs based on gas limit, confidence level, and chain ID, returning costs in Gwei and ETH.14 - `get_supported_chains`: Lists supported blockchains in a table with chain ID, system, and network.15- **Prompt**:16 - `gas_price_query`: A prompt template for querying gas prices at a specific confidence level and chain ID.17- **Asynchronous**: Uses `httpx` for non-blocking HTTP requests to Blocknative's Gas Price and Chains APIs.18- **Optional API Key**: Supports low-frequency access without a Blocknative API key; high-frequency use requires setting `BLOCKNATIVE_API_KEY`.1920## Prerequisites2122- **Python**: Version 3.1023- **uv**: For dependency management and running the project ([installation guide](https://github.com/astral-sh/uv))24- **Blocknative API Key** (optional): Required for high-frequency API access. Sign up at [Blocknative](https://www.blocknative.com/) to obtain a free API key.2526## Installation27281. **Clone the Repository**:29 ```bash30 git clone https://github.com/kukapay/blocknative-mcp.git31 cd blocknative-mcp32 ```33342. **Set Up the Project with `uv`**:35 ```bash36 uv sync37 ```38393. **Set the Blocknative API Key (Optional)**:40 - For high-frequency access, set the environment variable:41 ```bash42 export BLOCKNATIVE_API_KEY="your-api-key-here"43 ```44 - For low-frequency access, skip this step.454647## Usage4849The 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.5051### Running the Server52531. **Development Mode with MCP Inspector**:54 ```bash55 uv run mcp dev blocknative-mcp56 ```57 This opens the MCP Inspector, a web interface for testing tools and prompts interactively.58592. **Direct Execution**:60 ```bash61 uv run blocknative-mcp62 ```63643. **Claude Desktop Integration**:65 ```bash66 uv run mcp install blocknative-mcp --name "Blocknative MCP Server"67 ```68 This installs the server for use with Claude Desktop.6970### Tools7172- **`predict_gas_price(chain_id: int = 1) -> str`**:73 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.74 - Example:75 ```markdown76 Gas Price Predictions for Chain ID 1 (ethereum/main):77 - Base Fee Per Gas: 0.382910791 Gwei7879 | Confidence | Price (Gwei) | Max Priority Fee (Gwei) | Max Fee (Gwei) |80 |------------|--------------|-------------------------|----------------|81 | 99% | 0.52 | 0.14 | 0.9 |82 | 95% | 0.48 | 0.094 | 0.86 |83 | 90% | 0.47 | 0.089 | 0.85 |84 | 80% | 0.46 | 0.079 | 0.84 |85 | 70% | 0.45 | 0.069 | 0.83 |86 ```8788- **`estimate_gas_cost(gas_limit: int, confidence: int = 99, chain_id: int = 1) -> str`**:89 Estimates transaction costs based on gas limit, confidence level, and chain ID. Returns costs in Gwei and ETH.90 - Example:91 ```markdown92 Estimated Gas Cost (Confidence 90%, Chain ID 1):93 - Gas Limit: 2100094 - Max Fee Per Gas: 0.85 Gwei95 - Total Cost: 17850 Gwei (0.00001785 ETH)96 ```9798- **`get_supported_chains(ctx: Optional[Context] = None) -> str`**:99 Lists supported chains in a Markdown table with chain ID, system, and network.100 - Example:101 ```markdown102 Supported Chains:103104 | Chain ID | System | Network |105 |------------|----------|-----------|106 | 1 | ethereum | main |107 | 137 | polygon | mainnet |108 | 8453 | base | mainnet |109 | 11155111 | ethereum | sepolia |110 ```111112### Prompts113114- **`gas_price_query(confidence: int, chain_id: int = 1) -> List[base.Message]`**:115 A prompt template for querying gas prices at a specific confidence level and chain ID.116 - Example:117 ```markdown118 - User: What is the current gas price for chain ID 1 transactions with 90% confidence?119 - Assistant: Let me fetch the gas price predictions for chain ID 1.120 ```121122123## License124125This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.126127
Full transparency — inspect the skill content before installing.