关于 Gas Fee Predictor
Gas Fee Predictor 是面向 AI Agent 的只读 MCP 服务,提供 Ethereum 和 Layer-2 的实时交易数据。它支持托管 HTTP 端点和 npm stdio 接入,回答均附来源引用。
主要功能
- 01查询 Ethereum 当前 Gas 费和 ETH 价格
- 02查看四个 Layer-2 网络的实时费用
- 03获取交易时机与节省金额估算
- 04估算常见交易的成本
- 05查看每小时预测和历史 Gas 数据
- 06回答附带来源链接
适用场景
- 01交易前比较 Ethereum 与 Layer-2 费用
- 02估算转账、兑换或 NFT 铸造成本
- 03判断现在交易还是等待更合适
MCP 相关
通过托管的 Streamable HTTP 端点向 MCP 客户端提供七种 Gas 数据工具,npm stdio 包提供五种。服务只读且无需 API 密钥。
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
https://api.gasfeepredictor.com/api/mcpclaude mcp add --transport http higherbeing-gasfeepredictor https://api.gasfeepredictor.com/api/mcp{"mcpServers":{"higherbeing-gasfeepredictor":{"type":"http","url":"https://api.gasfeepredictor.com/api/mcp"}}}在 Cursor 中打开{"servers":{"higherbeing-gasfeepredictor":{"type":"http","url":"https://api.gasfeepredictor.com/api/mcp"}}}在 VS Code 中打开{"mcpServers":{"higherbeing-gasfeepredictor":{"type":"http","url":"https://api.gasfeepredictor.com/api/mcp"}}}{"mcpServers":{"higherbeing-gasfeepredictor":{"serverUrl":"https://api.gasfeepredictor.com/api/mcp"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
工具
5此工具无需参数。
详细介绍
Gas Fee Predictor — MCP 服务
通过 Model Context Protocol,为 AI Agent 提供 Ethereum 和 Layer-2 的实时 Gas 费数据。只读,无需 API 密钥,无需账户。每个回答都附有指向 gasfeepredictor.com 的引用。
有两种连接方式。建议优先使用托管版本——无需安装任何内容。
1. 托管端点(推荐)
如果你的客户端支持远程 MCP 服务(ChatGPT 和 Claude 连接器、Cursor、 VS Code 以及大多数当前客户端都支持),粘贴此 URL 即可:
https://api.gasfeepredictor.com/api/mcp
Streamable HTTP,无需身份验证、无需安装、无需配置文件,也无需持续更新。
它提供 7 个工具,比 npm 包多两个(get_gas_forecast 和
get_gas_history)。
客户端配置(如果你的客户端需要 JSON,而不是 URL 输入框)
{
"mcpServers": {
"gasfeepredictor": {
"type": "streamable-http",
"url": "https://api.gasfeepredictor.com/api/mcp"
}
}
}
自行验证:
curl -s -X POST https://api.gasfeepredictor.com/api/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
2. npm 包(stdio)
适用于仅支持 stdio 的客户端。需要 Node ≥ 18。
{
"mcpServers": {
"gasfeepredictor": {
"command": "npx",
"args": ["-y", "gasfeepredictor-mcp"]
}
}
}
在 macOS 上,Claude Desktop 将该文件保存在
~/Library/Application Support/Claude/claude_desktop_config.json。
重启客户端,然后询问:“现在 Ethereum 的 Gas 费是多少?在 L2 上是否更便宜?”
| 环境变量 | 默认值 | 用途 |
|---|---|---|
GASFEE_API_BASE | https://api.gasfeepredictor.com | 覆盖 API 基础地址(例如用于自托管)。 |
工具
| 工具 | 回答内容 | 托管版本 | npm |
|---|---|---|---|
get_current_gas | “现在 Ethereum 的 Gas 费是多少?”——低/平均/高 Gwei、ETH 价格,以及立即发送还是等待。 | ✅ | ✅ |
get_l2_gas | “现在最便宜的 L2 是哪个?”——Arbitrum / Base / Optimism / Polygon 的实时费用。 | ✅ | ✅ |
get_eth_price | 当前 ETH/USD 价格及 24 小时变化。 | ✅ | ✅ |
best_time_to_transact | 现在发送还是等待?下一个更便宜的时间段及预期节省金额。 | ✅ | ✅ |
estimate_transaction_cost | ETH 转账 / USDC 转账 / Uniswap 兑换 / NFT 铸造(或自定义 Gas)的美元成本,按费用档位列出。 | ✅ | ✅ |
get_gas_forecast | 面向未来的每小时 Gas 费用预测,最多提前 24 小时。 | ✅ | — |
get_gas_history | 指定时间范围内近期的主网历史 Gas 数据,包括最低值/最高值/平均值。 | ✅ | — |
说明
- 只读且无需身份验证——仅读取公开的 Gas 数据。
- 上游数据每隔约 30–60 秒刷新一次。
- 服务由
api.gasfeepredictor.com提供,而非顶级域名,因此自动化客户端不会受到 CDN 机器人防护的质询。 - 采用 MIT 许可证。
更新日志
1.1.0 — 当仪表板负载返回 ethPrice: null(上游价格冷却期间)时,get_current_gas 和 estimate_transaction_cost 现在会回退到
/api/eth-price。此前,价格端点正常提供服务时,它们仍会显示 ETH ≈ $undefined 或直接失败。
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。