# base-gas-mcp [Health: Active]

**Category:** 💰 Finance & Fintech  
**Repository:** https://github.com/memosr/base-gas-mcp  
**GitHub Stars:** 0  
**npm Downloads (last month):** 724  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/base-gas-mcp

## Description
MCP server for live Base gas, transaction costs in USD, cross-chain comparison and gas history, paid per call in USDC via x402.

## Tools
Capabilities this server exposes over MCP:

- **get_base_gas** — Live Base mainnet gas: EIP-1559 base fee, low/medium/high priority fees in gwei, the cost of a transaction in USD, ETH and gwei, and ready-to-sign maxFeePerGas / maxPriorityFeePerGas. Costs about $0.002. Each call makes a real USDC micropayment on Base mainnet via x402 from BUYER_PRIVATE_KEY; payments above MAX_USD_PER_CALL are refused. Do not call it in loops.
- **compare_gas_costs** — Live cost of the same transaction on Base, OP Mainnet, Arbitrum One and Ethereum, in USD and ETH, ranked cheapest first. Costs about $0.01. Each call makes a real USDC micropayment on Base mainnet via x402 from BUYER_PRIVATE_KEY; payments above MAX_USD_PER_CALL are refused. Do not call it in loops.
- **get_gas_history** — Base gas sampled every 5 minutes over a lookback window (default 24h): min/max/average/median and whether gas is cheap, normal, expensive or flat right now. Costs about $0.01. Each call makes a real USDC micropayment on Base mainnet via x402 from BUYER_PRIVATE_KEY; payments above MAX_USD_PER_CALL are refused. Do not call it in loops.
- **get_cheapest_window** — From 7 days of Base gas history: the hours of day to avoid, the cheapest hour (UTC), and the saving versus the average hour in percent and USD. Says so plainly when timing saves nothing. Costs about $0.02. Each call makes a real USDC micropayment on Base mainnet via x402 from BUYER_PRIVATE_KEY; payments above MAX_USD_PER_CALL are refused. Do not call it in loops.
- **get_service_status** — Free, no wallet needed. Reports whether the gas service is up and how much gas history it has collected, so you can decide whether the history tools are worth paying for.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "base-gas-mcp": {
    "command": "npx",
    "args": ["-y","base-gas-mcp"],
    "env": {
      "BUYER_PRIVATE_KEY": ""
    }
  }
}
```

**Requires environment variables:** `BUYER_PRIVATE_KEY` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What base-gas-mcp does

base-gas-mcp exposes gas analysis for Base through the Model Context Protocol. Its tools turn fee data into transaction estimates in USD, ETH, and gwei, including signing parameters that can be passed to an EVM transaction. The server also compares equivalent transactions across Base, OP Mainnet, Arbitrum One, and Ethereum, then orders the results from least to most expensive.

Historical tools cover both short-term conditions and scheduling decisions. Recent Base gas data includes minimum, maximum, average, and median values, plus a current classification of cheap, normal, expensive, or flat. A seven-day analysis identifies hours to avoid, the cheapest UTC hour, and the estimated percentage and dollar savings from waiting.

## How it works

The server runs over stdio and uses a companion x402 service as its paid data source. Each paid result includes the settlement transaction hash. Calls are charged by the endpoint; the listed examples are approximately $0.002 for `get_base_gas`, $0.01 for cross-chain comparison or recent history, and $0.02 for the cheapest-window analysis. `get_service_status` is free and reports service availability and collected history.

Payments use EIP-3009 authorizations. The payment wallet needs USDC on Base, but does not need ETH. The server pays only the origin configured by `BASE_GAS_ORIGIN`, and tools do not accept arbitrary URLs. `MAX_USD_PER_CALL` can reject a payment before signing if the endpoint price exceeds the configured limit.

## Setup and configuration

Node.js 18 or newer is required. Install the dependencies from a clone with `npm install`, or launch the published package with `npx base-gas-mcp`. Configure the process in an MCP client and provide `BUYER_PRIVATE_KEY` through that client's environment settings.

The key must belong to a Base mainnet wallet funded with a small amount of USDC. A separate, disposable wallet is appropriate because the key authorizes real payments. The server reads the key for signing and does not log or return it. It does not load a `.env` file, so environment values must be supplied by the client or process launcher.

Optional settings include `MAX_USD_PER_CALL`, `BASE_GAS_ORIGIN`, and `BUILDER_CODE`. The origin defaults to the live Base gas API, and the payment cap defaults to $0.05 per call. Claude Desktop can launch the package with `npx`, while Claude Code can register it with `claude mcp add`; both configurations pass the buyer key through the client environment.

## Tools and capabilities

- `get_base_gas` returns Base fee data, low/medium/high priority fees, transaction costs, and ready-to-sign `maxFeePerGas` and `maxPriorityFeePerGas` values in wei. An optional `gasLimit` changes the estimate.
- `compare_gas_costs` estimates the same transaction on Base, OP Mainnet, Arbitrum One, and Ethereum. It also accepts `gasLimit`.
- `get_gas_history` summarizes a selectable number of recent hours, defaulting to 24.
- `get_cheapest_window` uses seven days of history to recommend a cheaper UTC hour.
- `get_service_status` checks availability without requiring a payment wallet.

For rough estimates, the documented gas limits are 21,000 for an ETH transfer, 65,000 for an ERC-20 transfer, 85,000 for an NFT mint, 180,000 for a Uniswap swap, and 1,500,000 for a contract deployment.

## Limitations and notes

The estimates depend on the selected gas limit and the live endpoint data. Paid use requires USDC and signs real payment authorizations, so wallet isolation and a per-call spending cap are important operational safeguards. The server is intended for fee analysis and payment of data requests; it does not submit the transaction being estimated.

_Full upstream README: https://allmcps.com/mcp/base-gas-mcp/readme_

