base-gas-mcp
The server exposes a single paid tool, get_base_gas, for live Base mainnet gas data.
get_base_gas: Returns live Base mainnet gas data including base fee, low/medium/high priority fees, and an ETH transfer cost estimate.Each call makes a real $0.001 USDC payment on Base mainnet via the x402 protocol.
Requires a funded buyer wallet (
BUYER_PRIVATE_KEY) holding USDC and ETH for gas.Optionally accepts a
target_urlto override the x402 gas API URL (defaults to the live Base gas endpoint).Not intended for repeated or looped calls due to the real cost.
Provides gas cost comparison for Ethereum alongside Base, OP Mainnet, and Arbitrum One, returning transaction cost estimates in USD.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@base-gas-mcpwhat's the current Base gas fee?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
base-gas-mcp
An MCP server for live Base gas data, paid per call in USDC over the x402 payment protocol. No API key and no account: the agent pays a fraction of a cent from a wallet you control.
It answers the questions an RPC call cannot: what a transaction costs in dollars, which chain is cheapest right now, whether gas is high or low, and which hours to avoid.
Tools
Tool | Price | What it returns |
| ~$0.002 | Base fee, low/medium/high priority fees, the cost of a transaction in USD, ETH and gwei, and ready-to-sign |
| ~$0.01 | The same transaction on Base, OP Mainnet, Arbitrum One and Ethereum, in USD, cheapest first. Optional |
| ~$0.01 | Base gas over the last |
| ~$0.02 | From 7 days of history: hours to avoid, cheapest hour (UTC), and the saving in percent and USD. |
| free | Whether the service is up and how much history it has collected. Needs no wallet. |
Prices are set by the endpoint and published in its OpenAPI document. Every paid result includes the settlement transaction hash.
gasLimit guide: 21000 ETH transfer (default), ~65000 ERC-20 transfer, ~85000
NFT mint, ~180000 Uniswap swap, ~1500000 contract deploy.
Related MCP server: gas-estimator
Safety
The server only ever pays one origin, set by you (
BASE_GAS_ORIGIN, defaulting to the live base-gas-x402 API). No tool takes a URL, so text the model reads cannot redirect your wallet to another paid endpoint.Per-payment cap. Any payment above
MAX_USD_PER_CALL(default0.05) is refused before anything is signed.Payments are EIP-3009 authorizations: the wallet needs USDC only, no ETH.
Use a separate wallet holding a few dollars. The key is read from the environment to sign payments and is never logged or returned.
The paid data source is a companion project: base-gas-x402.
Installation
Requirements
Node.js 18 or newer (built-in
fetchis required)A Base mainnet wallet holding a little USDC (no ETH needed)
git clone https://github.com/memosr/base-gas-mcp.git
cd base-gas-mcp
npm installPass BUYER_PRIVATE_KEY through your MCP client's config (see below). The server does not read a .env file.
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.
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, 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 |
| Yes | 32-byte hex private key (64 hex chars, |
| No | Refuse any single payment above this many USD. Default |
| No | The only origin the server pays. Defaults to |
| No | Base Builder Code attached to the payment payload for attribution. Defaults to |
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-mcpOr from a local clone:
claude mcp add base-gas \
--env BUYER_PRIVATE_KEY=0xYOUR_FUNDED_BASE_MAINNET_PRIVATE_KEY \
-- node /absolute/path/to/base-gas-mcp/src/server.jsThe server reads its settings only from the environment the client passes. It does not load a .env file (since 0.3.1), so a .env in whatever folder the client opens cannot change where the wallet pays.
Example usage
Once configured, ask your agent:
"What does a Uniswap swap on Base cost right now, in dollars?" (
get_base_gaswithgasLimit180000)"Is Base or Arbitrum cheaper for a token transfer at the moment?" (
compare_gas_costs)"Is Base gas high right now, or should I wait?" (
get_gas_history)"When should I schedule a batch of transactions on Base?" (
get_cheapest_window)
Each of these is one paid call. Check get_service_status first for free.
Tech stack
Node.js (ESM), served over stdio transport
@modelcontextprotocol/sdkfor the MCP server@x402/fetch,@x402/evm, and@x402/extensionsfor the payment-wrapped fetch, the EIP-3009 exact payment scheme, and builder-code attributionviemfor account handling and signingzodfor input validation
License
MIT, copyright (c) 2026 memosr.
Available Tools
1 toolget_base_gasGet live Base mainnet gasARead-only
Returns live Base mainnet gas data (base fee, low/medium/high priority fees, and an ETH transfer cost estimate). IMPORTANT: every call makes a REAL $0.001 USDC payment on Base mainnet via the x402 protocol and requires a funded buyer wallet (BUYER_PRIVATE_KEY) holding USDC and ETH for gas. Do not call this repeatedly or in loops — each invocation spends real money.
| Name | Required | Description | Default |
|---|---|---|---|
| target_url | No | Optional override for the x402 gas API URL. Defaults to the live Base gas endpoint. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Description states the tool makes a real USDC payment, contradicting the readOnlyHint annotation (true) which implies no state change. Even though the description is transparent, the contradiction with annotations is a serious flaw, warranting score 1.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, front-loaded with key functionality and critical warning. No filler; every part earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Covers return contents, payment cost, prerequisites, and usage restrictions well. Lacks output schema but not critical. Would be 5 if not for annotation contradiction.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema already provides clear description for the sole optional parameter (target_url). The main description adds no further parameter-specific detail, so baseline 3 applies given 100% schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly specifies the tool returns live Base mainnet gas data including base fee, priority fees, and ETH transfer estimate. The verb 'returns' plus resource details make purpose unambiguous, and no sibling tools exist to confuse.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly warns against repeated calls and loops due to real USDC payment, and prerequisites (funded buyer wallet with USDC/ETH) are stated. This provides excellent when-to-use and when-not-to-use guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v1.0.0- First observed
get_base_gas
TDQS
Scored across 1 tool
Only one tool exists, so there is no possibility of confusion or overlap between tools. The agent can clearly identify its single purpose.
The single tool name 'get_base_gas' follows a clear verb_noun pattern using snake_case. With only one tool, there is no inconsistency to evaluate.
One tool is on the lower bound of what is reasonable for a gas data server. While the narrow scope and real-money cost per call justify a minimal surface, it still feels thin.
The tool provides all essential live gas data (base fee, priority fees, transfer cost estimate) for the Base mainnet, fully covering the server's stated purpose without obvious gaps.
Maintenance
Related MCP Connectors
Live Base Mainnet on-chain data (gas, DEX, Aave, token risk, prices). Pay per call in USDC via x402.
Live Base Mainnet on-chain data (gas, DEX, Aave, token risk, prices). Pay per call in USDC via x402.
Pay-per-call tools for autonomous agents, settled in USDC on Base via x402.
Compare live gas across up to 9 EVM chains and get the cheapest one. x402 pay-per-call on Base.
Related MCP Servers
- AlicenseAqualityCmaintenanceProvides AI agents with real-time gas prices and blockchain data from Base, with metered access via x402 payment protocol.4MIT
- AlicenseNot gradedqualityCmaintenanceLets AI agents fetch live gas prices across multiple EVM chains, compare USD transfer costs, and find the cheapest chain in a single call, with pay-per-call billing via x402.MIT
- AlicenseNot gradedqualityBmaintenanceEnables agents to sell or access Ethereum JSON-RPC requests over x402 with per-call USDC payments on Base, no accounts or API keys, including per-method pricing, policy enforcement, and privacy protections.1MIT
- FlicenseNot gradedqualityBmaintenanceExposes Base mainnet chain query tools over MCP, letting clients fetch an address's native balance and current gas fee estimates (slow/standard/fast urgency) from an upstream HTTP API. Paid tools are gated by x402 micropayments settled through the CDP facilitator, with a free health check and a documented free-trial allotment.-