MGO — Multi-chain Gas Optimizer

io.github.dlrjsdl200-byte由 GitHub 帳號 dlrjsdl200-byte 發布v1.2.0更新於 Oct 24, 2026

Cheapest EVM chain across up to 9 networks with savings %. Free demo tools, paid tools via x402.

發布方自己的服務:Agent.chain.tokyo Address Contracts

已驗證STDIO僅桌面雲端與基礎設施金融

概覽

AI 產生的概覽

比較最多 9 條 EVM 鏈的即時 Gas 價格,並推薦最便宜的鏈,提供免費與按次付費工具。

可以做什麼
  • 比較 Gas 價格並給出 DEX 兌換的最便宜鏈建議,附上相對以太坊的節省比例
  • 取得 ETH、BNB、POL、AVAX、HYPE 等原生代幣的美元價格
  • 在 4 條鏈上執行免費示範查詢,每小時限 10 次
  • 查詢付費的基本版(4 條鏈)與進階版(9 條鏈)Gas 報告,可透過 x402 SDK 自動付款或自行提供付款標頭
適用情境
適合在跨鏈橋、部署或兌換等 EVM 交易之前使用,讓助理把操作導向手續費最低的鏈。也適合快速比較各鏈的 Gas 與原生代幣價格。
執行需求
以 stdio 在本機執行,通常透過 npx 啟動 npm 套件 chain-ops-mgo。免費工具不需金鑰或註冊。付費工具自動付款需要 MGO_PRIVATE_KEY(在 Base 上持有 USDC 的 EVM 私鑰),並安裝 @chain-ops/agent-sdk 與 viem;MGO_MAX_PRICE 為選用,用來限制單次花費。需要能連線至服務商 API 的網路。
安裝前請注意
付費工具會花費真實的 Base 鏈上 USDC,每次呼叫一筆微支付;未提供 MGO_PRIVATE_KEY 時只會回傳付款要求。私鑰是具備支付能力的錢包機密,建議使用專用的低餘額錢包,並把 MGO_MAX_PRICE 設得很低。Gas 與價格資料來自第三方 API,免費示範端點有頻率限制。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 MGO — Multi-chain Gas Optimizer,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

chain-ops-mgo

Multi-chain Gas Optimizer — Compare real-time gas prices across 9 EVM chains and get the cheapest-chain recommendation. Pay-per-call via x402 on Base. No API key, no signup.

When to use: call it before any EVM transaction (bridge, deploy, swap) to route to the lowest-fee chain — e.g. "Use Optimism — saves 97% vs Ethereum". Built for AI agents: one USDC microtransaction per call. Ships as a Node client and a stdio MCP server.

[npm version] [Powered by @chain-ops/agent-sdk] [ClawHub]

MCP server (Claude Desktop, Cursor, any MCP client)

No install needed:

json
{  "mcpServers": {    "mgo-gas": {      "command": "npx",      "args": ["-y", "chain-ops-mgo"],      "env": { "MGO_PRIVATE_KEY": "0x...", "MGO_MAX_PRICE": "10000" }    }  }}

Tools: get_gas_demo, get_cheapest_chain (free), get_gas_basic ($0.001), get_gas_premium ($0.002). Without MGO_PRIVATE_KEY the paid tools return the x402 payment requirements instead of data. With it (plus @chain-ops/agent-sdk and viem installed) they pay automatically, capped at MGO_MAX_PRICE micro-USDC (default 10000 = $0.01). Prefer not to run anything? The same tools are hosted at https://api.mgo.chain-ops.xyz/mcp (official MCP Registry: xyz.chain-ops/mgo).

Install (library)

Free endpoints only:

bash
npm install chain-ops-mgo

Auto-payment (recommended for paid endpoints):

bash
npm install chain-ops-mgo @chain-ops/agent-sdk viem

Quick Start

Free — no payment

javascript
const { getCheapestChain } = require('chain-ops-mgo');
const result = await getCheapestChain();console.log(result);// {//   chain: 'Optimism', chainId: 10, nativeToken: 'ETH',//   gasPriceGwei: '0.0010',//   dexSwapCostNative: '0.00000016',//   dexSwapCostUsdc: 0.00039,        // from the free /prices feed; omitted if unavailable//   savingsVs: 'Ethereum',//   savingsPercent: '97.4%'// }

Paid — auto-payment via SDK (recommended)

javascript
const { getGasBasicWithPayment } = require('chain-ops-mgo');
const data = await getGasBasicWithPayment({  account: process.env.PRIVATE_KEY, // 0x...  network: 'base',});
console.log(data.recommendation.action);// "Use Optimism — saves 97.4% vs Ethereum"

The SDK handles the x402 402-handshake (parse requirements, sign the EIP-3009 USDC authorization, retry). One USDC microtransaction per call ($0.001 basic, $0.002 premium), hard-capped at maxPrice (default $0.01).

Endpoints

FunctionPriceChainsNotes
getGasDemo()Free4Raw gas prices (native units), rate limited 10/hr
getPrices()Free—Native token USD prices (ETH, BNB, POL, AVAX, HYPE), 60s cache
getCheapestChain()Free4Cheapest chain for a DEX swap, USD via getPrices()
getGasBasicWithPayment({ account })$0.001 USDC4Auto-pay via SDK + recommendation
getGasPremiumWithPayment({ account })$0.002 USDC9Auto-pay via SDK + 9 chains incl. BNB, Polygon, Avalanche, zkSync, Hyperliquid
getGasBasic({ paymentHeader })$0.001 USDC4Manual mode — bring your own x402 header
getGasPremium({ paymentHeader })$0.002 USDC9Manual mode — bring your own x402 header

Auto-pay options

javascript
await getGasPremiumWithPayment({  account: '0x...',         // private key OR a viem Account object  network: 'base',          // currently only 'base'  maxPrice: 5_000n,         // optional cap in micro-USDC ($0.005); default 10_000n});

If @chain-ops/agent-sdk is not installed, the auto-pay functions throw a clear error pointing to the install command. Free functions work without it.

Manual mode (advanced)

If you build your own x402 client, you can supply a pre-built header:

javascript
const { getGasBasic } = require('chain-ops-mgo');
const data = await getGasBasic({  paymentHeader: { 'PAYMENT-SIGNATURE': '<base64 x402 v2 payload>' }, // or 'X-PAYMENT' for v1});

Without a payment header, paid functions throw Error: Payment required with err.status === 402 and err.paymentInfo (the decoded PAYMENT-REQUIRED header: accepts[], resource, ...).

Payment

Uses x402 protocol on Base (eip155:8453) with USDC. No API key, no subscription, no account required.

Links

License

MIT

來源:README.md,提交 1539937

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

2
  1. v1.2.0最新Oct 20, 2026
  2. v1.0.0Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Chain 整合