
Base Gas Mcp
io.github.memosr由 GitHub 账号 memosr 发布v0.3.2更新于 Oct 26, 2026
Live Base gas, tx cost in USD, 4-chain comparison and gas history. Paid per call in USDC via x402.
概览
本地 MCP 服务器,让助手获取 Base 实时 gas、以美元计的交易成本、四链 gas 对比与历史数据,每次调用通过 x402 用 USDC 付费。
- 可以做什么
- 获取 Base 当前 gas:基础费、低/中/高优先费、以美元、ETH 和 gwei 表示的交易成本,以及可直接签名的 maxFeePerGas 数值
- 对比同一笔交易在 Base、OP Mainnet、Arbitrum One 和以太坊上的成本,按从低到高排序
- 查看指定小时数内的 Base gas 历史,含最小值、最大值、平均值、中位数以及当前偏高或偏低的判断
- 找出过去一周内最便宜的小时和应避开的小时,并给出节省的百分比与美元金额
- 免费查询服务状态与已收集的历史数据,无需钱包
- 适用场景
- 适合需要助手回答 Base 交易美元成本、判断当下哪条链更便宜,或挑选低 gas 时段来安排批量交易的场景。
- 运行要求
- 需要 Node.js 18 或更高版本,以 stdio 方式在本地运行(npx 或克隆仓库)。需要一个持有少量 USDC 的 Base 主网钱包(无需 ETH),通过客户端配置以 BUYER_PRIVATE_KEY 传入;服务器不读取 .env 文件。可选 MAX_USD_PER_CALL、BASE_GAS_ORIGIN 和 BUILDER_CODE。需要能访问付费端点的网络。
安装
在 SourceWeft 中
- 打开 控制台中的 Base Gas Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
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
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.
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)
Pass 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
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:
To run from a local clone instead, point command at Node and use the absolute path to the server:
Claude Code
Or from a local clone:
The 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.
来源:README.md,提交 ef01ef1
工具
0版本历史
2- v0.3.2最新Oct 18, 2026
- v0.3.1Oct 18, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分