Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
Your own AI agent, running 24/7 with QwikClaw logoYour own AI agent, running 24/7 with QwikClaw

QwikClaw sets up and runs an always-on OpenClaw agent for you. One click, no config files, no server setup.

Deploy now
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 47,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Enables agents to fetch live Base mainnet gas prices by paying $0.001 USDC per call via the x402 payment standard.

README.md

base-gas-mcp

An MCP server that fetches live Base mainnet gas data by paying per call in USDC over the x402 payment protocol.

The price is set by the endpoint, not by this package, and is published in the endpoint's OpenAPI document at /openapi.json. Every tool result reports the amount that was actually settled on-chain.

Tools

get_base_gas

Fetches live Base mainnet gas data from a paid x402 API. Each call makes a real USDC payment on Base mainnet (eip155:8453), signed as an EIP-3009 transfer authorization by the wallet in BUYER_PRIVATE_KEY. Do not call it in loops or on a schedule: every invocation spends real funds.

Parameters

| Name | Type | Required | Description | |------|------|----------|-------------| | target_url | string (URL) | No | Override the x402 gas API URL. Defaults to https://base-gas-x402-production.up.railway.app/gas. |

Returns a formatted text report with:

  • Base fee
  • Priority fees (low, medium, high)
  • Estimated ETH transfer cost
  • Source URL, payer address, and the amount paid

Example call from an MCP client:

{
  "name": "get_base_gas",
  "arguments": {}
}

The paid data source is a companion project: base-gas-x402.

Installation

Requirements

  • Node.js 18 or newer (built-in fetch is required)
  • A funded Base mainnet wallet: a small USDC balance to pay per call, plus a little ETH for gas
git clone https://github.com/memosr/base-gas-mcp.git
cd base-gas-mcp
npm install
cp .env.example .env
# edit .env and set BUYER_PRIVATE_KEY

Or run the published package directly with npx base-gas-mcp (see the config blocks below).

Getting a buyer key

BUYER_PRIVATE_KEY is the private key of a Base mainnet wallet. Create a fresh wallet (for example in MetaMask, Coinbase Wallet, or with cast wallet new), export its private key, and fund it on Base with a few dollars of USDC and a small amount of ETH.

Warning: this is a real private key that controls real funds. Use a separate, disposable wallet holding only small amounts. Never reuse a key from a wallet with significant funds, never commit it to git (.env is gitignored), and never paste it into chat. The server reads it only to sign payments and never logs or returns it.

Environment variables

| Variable | Required | Description | |----------|----------|-------------| | BUYER_PRIVATE_KEY | Yes | 32-byte hex private key (64 hex chars, 0x prefix optional) of a funded Base mainnet wallet. | | TARGET_URL | No | Override the gas API URL. | | BUILDER_CODE | No | Base Builder Code attached to the payment payload for attribution. Defaults to bc_lhfd8zad. |

Configuration

Claude Desktop

Add to claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json, Windows: %APPDATA%\Claude\claude_desktop_config.json), then restart Claude Desktop:

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

To run from a local clone instead, point command at Node and use the absolute path to the server:

{
  "mcpServers": {
    "base-gas": {
      "command": "node",
      "args": ["/absolute/path/to/base-gas-mcp/src/server.js"],
      "env": {
        "BUYER_PRIVATE_KEY": "0xYOUR_FUNDED_BASE_MAINNET_PRIVATE_KEY"
      }
    }
  }
}

Claude Code

claude mcp add base-gas \
  --env BUYER_PRIVATE_KEY=0xYOUR_FUNDED_BASE_MAINNET_PRIVATE_KEY \
  -- npx -y base-gas-mcp

Or from a local clone:

claude mcp add base-gas -- node /absolute/path/to/base-gas-mcp/src/server.js

With the local form, put BUYER_PRIVATE_KEY in the project's .env file instead of the command line.

Example usage

Once configured, ask Claude:

  • "What is the current gas price on Base?"
  • "How much would a simple ETH transfer cost on Base right now?"
  • "Check Base gas and tell me whether the base fee is high or low at the moment."

Each of these triggers one get_base_gas call and spends real USDC.

Tech stack

  • Node.js (ESM), served over stdio transport
  • @modelcontextprotocol/sdk for the MCP server
  • @x402/fetch, @x402/evm, and @x402/extensions for the payment-wrapped fetch, the EIP-3009 exact payment scheme, and builder-code attribution
  • viem for account handling and signing
  • zod for input validation

License

MIT, copyright (c) 2026 memosr.

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Browser & Scraping servers.