base-gas-mcp
This server provides a single tool (get_base_gas) to fetch live Base mainnet gas data by making real micropayments via the x402 protocol.
Fetch live Base gas data: Retrieve the current base fee, low/medium/high priority fees, and estimated cost for a simple ETH transfer on Base mainnet.
Automatic payment handling: Each call automatically signs and submits a real $0.001 USDC payment on Base mainnet (chain ID
eip155:8453) using EIP-3009 — no manual payment steps required.Configurable API endpoint: Optionally override the default gas API URL via the
target_urlparameter.Attribution support: Payments can include a
BUILDER_CODEfor attribution.
⚠️ Important: Every invocation spends real funds ($0.001 USDC per call). Requires a funded wallet with USDC and ETH for gas. Do not call in loops or on a schedule.
Click on "Install 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 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 |
| string (URL) | No | Override the x402 gas API URL. Defaults to |
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.
Related MCP server: valorem-mev-mcp
Installation
Requirements
Node.js 18 or newer (built-in
fetchis 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_KEYOr 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 (
.envis 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 |
| Yes | 32-byte hex private key (64 hex chars, |
| No | Override the gas API URL. |
| 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 -- node /absolute/path/to/base-gas-mcp/src/server.jsWith 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/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.
TDQS
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
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Market data and web intelligence for AI agents, paid per call in USDC on Base via x402.
Pay-per-call crypto market intelligence for AI agents. USDC on Base via x402.
Pay-per-call agent tools via x402 (USDC on Base): chat, prices, funding, RNG. No account or keys.
Pay-per-call NLP & embeddings APIs on Base via x402. No keys/signup; agents pay per call in USDC.
Related MCP Servers
- FlicenseAqualityCmaintenanceProvides AI agents with real-time gas prices and blockchain data from Base, with metered access via x402 payment protocol.4

valorem-mev-mcpofficial
AlicenseAqualityDmaintenanceGives MCP-compatible LLM agents direct access to real-time MEV and DeFi data via Valorem's x402-paid API endpoints, with payments in USDC on Base mainnet.910MIT- AlicenseAqualityCmaintenanceCompare real-time gas prices across up to 9 EVM chains and get the cheapest-chain recommendation. Pay-per-call via x402 (USDC on Base). No API key.4MIT
- AlicenseNot gradedqualityBmaintenanceLets 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
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/memosr/base-gas-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server