Ophis MCP

fi.ophis由 ophis.fi 發布官方發布者v0.2.0更新於 Oct 24, 2026

Gasless, MEV-protected onchain token swaps for AI agents on 14 EVM chains, built on CoW Protocol.

已驗證Streamable HTTP可網頁執行金融開發者工具

概覽

AI 產生的概覽

Ophis DEX 的遠端 MCP 伺服器,讓助理解析換幣請求、取得報價、建立並送出 EVM 鏈上免 Gas 的 CoW Protocol 代幣訂單。

可以做什麼
  • 把自然語言換幣請求解析成結構化意圖,並把代幣符號解析為權威合約地址
  • 列出已設定的鏈,取得最佳報價、相對公開聚合器的價格改善幅度以及 Gas 價格
  • 建立有邊界的待簽章 CoW 訂單,並把已簽章訂單轉送到訂單簿
  • 離線預檢外部建立的訂單,檢查 appCode、主機、EIP-712 網域或接收方是否有誤
  • 讀取單一錢包的原生代幣與 ERC-20 餘額、跨鏈投資組合餘額,以及代幣 OHLCV 價格歷史
  • 依 appCode 查詢路由交易量與整合商費用
適用情境
當助理需要協助使用者或代理在 EVM 鏈上透過 Ophis 交易代幣時使用:把一句話的換幣需求變成報價、可簽章訂單並送出,或在交易前查看餘額、價格與費用。
執行需求
遠端 Streamable-HTTP 端點,不需安裝套件。未宣告任何身分驗證、API 金鑰或環境變數。代理需自備錢包私鑰來簽署 build_order 回傳的 EIP-712 訂單,並需能連線 Ophis 端點與公開 RPC。
安裝前請注意
伺服器不持有私鑰也不簽章,但 submit_order 會轉送已簽章訂單並實際轉移資金,簽章前應與使用者確認金額、代幣與滑價。接收方固定為擁有者,但這只是鏈下防護,並非鏈上授權邊界。代幣圖表價格來自單一資金池,可能流動性不足或被操縱。送出後會把擁有者登記進索引與交易獎勵活動,且預設套用推薦碼,除非明確覆寫。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Ophis MCP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/fi.ophis%2Fmcp/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "ophis": {
      "type": "http",
      "url": "https://mcp.ophis.fi/mcp"
    }
  }
}

README

@ophis/mcp-server

Agent-facing MCP server for the Ophis DEX, deployed as a Cloudflare Worker with the Streamable-HTTP transport at https://mcp.ophis.fi/mcp.

Current server release: v0.2.0, with 13 tools across 15 configured EVM chains (14 mainnets plus Sepolia).

It exposes the Ophis trading surface to autonomous agents and MCP clients without making them re-derive the fork's non-obvious, easy-to-get-wrong details (non-canonical settlement contracts on the Ophis-operated chains, the self -hosted Optimism, Unichain, Robinhood Chain, and Arc orderbook hosts, the CIP-75 partner-fee appData shape, and receiver pinning).

Arc (5042) charges the 1 bp base fee and supports routed-volume indexing and referral attribution. Server referral defaults apply; a per-call code overrides the default, and an empty string opts out. After an order is accepted, submit_order enrolls the owner for indexing and the live trade-rewards campaign.

The tools operate on configured EVM orderbooks. list_chains reports configuration, not a live availability probe. The standalone app's externally funded NEAR source flow is separate; these tools do not create or fund those deposits. See network and funding coverage.

Security model

The server holds no private keys and never signs. build_order returns a bounded, ready-to-sign EIP-712 payload with the order receiver pinned to the owner (the #1 autonomous-agent drain vector); the agent signs with its own key and submits. This is the V1 "bounded capability" pattern, an off-chain misuse guard, not an on-chain authorization boundary. It is public and unauthenticated: every backing endpoint is already public, and the tools are read/build-only.

Tools

ToolPurpose
parse_intentPlain-English swap request → structured intent (LibertAI Qwen via swap.ophis.fi/api/intent).
resolve_tokenResolve a token symbol to its canonical address from the trusted Ophis list; fails closed (anti-spoof).
list_chainsSupported chains, orderbook hosts, settlement contracts, partner-fee config.
get_quoteBest-execution quote from the chain's Ophis orderbook (/api/v1/quote).
expected_surplusEstimate price improvement versus a public aggregator (KyberSwap), in basis points.
build_orderA bounded, ready-to-sign CoW order: correct per-chain settlement + orderbook, CIP-75 partner fee in appData, receiver pinned to owner.
submit_orderRelay a pre-signed order to the orderbook (/api/v1/orders). No keys held here.
get_integrator_earningsRouted volume, the Ophis base fee, and the integrator's own fee on CoW-hosted chains, by appCode (rebates.ophis.fi/earnings/:appCode).
get_balancesNative + ERC-20 balances for an address on one chain.
get_portfolioNative + ERC-20 balances across multiple chains.
get_gasCurrent gas price for a chain (informational; offchain order signatures are gasless, approvals and other wallet transactions are not).
get_token_chartOHLCV price history for a token.
validate_orderOffline preflight for an externally-built order (no network, no keys): catches wrong appCode, orderbook host, EIP-712 domain, appData hash mismatch, unpinned receiver, and expired or non-zero-fee orders.

Typical agent flow

parse_intent("swap 100 USDC for WETH on Optimism")  → resolve_token({ chainId, symbol }) for BOTH the sell and buy symbols   // canonical addresses, fails closed (anti-spoof); for a native-coin request like ETH, resolve the wrapped symbol (WETH)  → get_quote({ chainId, sellToken, buyToken, kind:'sell', amount, from })  → build_order({ chainId, owner, sellToken, buyToken, sellAmount, buyAmount /* slippage-adjusted */, kind })  → (agent confirms with the user, then signs `order` as EIP-712 using `signing`)  → submit_order({ chainId, order, signature, from, fullAppData })

Develop

bash
pnpm --filter @ophis/mcp-server test         # unit tests (pure logic)pnpm --filter @ophis/mcp-server typecheckpnpm --filter @ophis/mcp-server dev          # wrangler dev (local Streamable HTTP)npx @modelcontextprotocol/inspector@latest   # point at http://localhost:8787/mcp

dev / deploy / dry-run auto-build the workspace SDK first (pre* scripts), so a clean checkout works without a manual @ophis/sdk build.

Deploy

Auto-deploys on push to main via .github/workflows/mcp-deploy.yml, using the least-privilege CLOUDFLARE_WORKERS_TOKEN secret (Workers Scripts + Routes only). Manual:

bash
pnpm --filter @ophis/mcp-server deploy        # builds the SDK, then wrangler deploy → mcp.ophis.fi

Custom domain mcp.ophis.fi is provisioned from wrangler.jsonc (routes).

After the main deployment succeeds, an organization admin creates the matching mcp-v<x.y.z> tag. .github/workflows/mcp-registry-release.yml verifies that the live /health version matches, then publishes server.json to the official MCP Registry. See the release runbook.

來源:apps/mcp-server/README.md,提交 9689d5c

工具

13

parse_intent

Parse swap intent

Parse a plain-English swap request (e.g. "swap 100 USDC for ETH on Optimism") into a structured intent: { intent: "swap"|"unknown", entities: [{type: sellToken|buyToken|amount|chain, value, raw}] }. Backed by the live Ophis parser.

輸入參數text必填

get_quote

Get swap quote

Fetch a best-execution quote from the chain's Ophis orderbook (use a chainId from list_chains' `tradeable`). Amounts are in atoms (smallest unit, uint256 decimal string). For kind='sell' the amount is the sell amount before fee; for kind='buy' it is the desired buy amount. Returns the orderbook quote (sellAmount/buyAmount/feeAmount/validTo). Before build_order, apply slippage to the limit side by kind: kind='sell' -> lower buyAmount (min out); kind='buy' -> raise sellAmount (max in).

輸入參數from必填kind必填amount必填chainId必填buyToken必填sellToken必填isStablePairvalidForSeconds

build_order

Build signable order

Build a bounded, ready-to-sign CoW order on Ophis. Returns { order, signing:{domain,types,primaryType}, fullAppData, appDataHash, partnerFee, next }. The receiver is ALWAYS PINNED to the owner (proceeds cannot leave the account); this public endpoint exposes no custom-receiver option. Uses the correct per-chain settlement contract (Optimism, Unichain, Robinhood Chain, and Arc are non-canonical) and applies the canonical Ophis fee policy. Apply slippage to the LIMIT side by kind: for kind 'sell' lower buyAmount (your minimum out); for kind 'buy' raise sellAmount (your maximum in). slippageBips is capped at 5000 (50%); when omitted, the enforced backstop defaults to 100 bps (1%). ENFORCED: build_order fetches a live quote and REJECTS the call if the limit is worse than slippageBips vs that quote (or if a quote cannot be fetched; retry). Sign `order` as EIP-712 with `signing`, then call submit_order.

輸入參數kind必填owner必填chainId必填buyToken必填buyAmount必填feeAmountsellToken必填sellAmount必填isStablePairreferrerCodeslippageBipsvalidForSeconds另有 3 個

submit_order

Submit signed order

Relay a pre-signed order to the chain's Ophis orderbook. Pass the exact `order` object and `fullAppData` from build_order, plus your EIP-712 `signature` and `from` (owner). Returns the order UID on success and enrolls the owner for indexing, referral attribution, and trade rewards.

輸入參數from必填order必填chainId必填signature必填fullAppData必填signingScheme

get_integrator_earnings

Get integrator earnings

Look up routed volume, the Ophis base fee, and the integrator's own fee on CoW-hosted chains, by appCode (your widget appCode or SDK ophisReferrer code). Routed volume is reported in USD, split by chain and by Ophis-operated versus CoW-hosted chains. Read-only, keyless, cumulative.

輸入參數appCode必填

list_chains

List Ophis chains

List configured EVM orderbook chains, split into `tradeable` (orderbook URL configured; only route get_quote/build_order to these) and `paused` (no configured orderbook URL, so those tools reject the chain). This is configuration, not a live health or liquidity check. The standalone app's externally funded NEAR networks are not orderbook chains. Each tradeable chain includes its orderbook host, GPv2Settlement contract (Optimism, Unichain, Robinhood Chain, and Arc are non-canonical), and canonical Ophis fee config. No input.

無需輸入參數。

get_balances

Get wallet balances

Read a wallet's native-token balance plus ERC-20 balances for the given token addresses on one chain, via a public RPC (one multicall). Returns each token's symbol, decimals, raw atoms, and human-readable amount. A token address that is not an ERC-20 is reported with an `error` and does not fail the batch. Read-only; holds no keys. Supported chains are those with a public RPC (most Ophis chains).

輸入參數owner必填tokenschainId必填

get_portfolio

Get cross-chain balances

Read a wallet's native and (optionally) ERC-20 balances across multiple chains at once. Pass tokensByChain (chainId -> token addresses) to include token balances; omit chainIds to scan every chain with a public RPC (max 13 chains, and at most 100 token reads total across all chains). Per-chain RPC failures are returned inline so one dead endpoint does not sink the result. Read-only; holds no keys.

輸入參數owner必填chainIdstokensByChain

get_gas

Get chain gas price

Read a chain's current gas price (EIP-1559 maxFee/maxPriority suggestion when supported, plus an effective gasPrice in wei and gwei). Ophis trades are gasless for the trader, so this mainly bounds the cost of a one-time ERC-20 approval to the VaultRelayer. Read-only.

輸入參數chainId必填

get_token_chart

Get token OHLCV chart

Fetch OHLCV price history for a token from the keyless GeckoTerminal market API (resolves the token's deepest pool, then returns candles). Use for an agent to reason about recent price action before quoting. Prices come from a single pool that may be thin or manipulated, so treat them as advisory, not a sole execution signal. The keyless tier is a shared ~30 req/min quota, so cache and do not poll tightly. Read-only.

輸入參數limittoken必填chainId必填aggregatetimeframe

expected_surplus

Estimate beat-the-market surplus

Estimate how much better Ophis quotes than the open market for a sell: fetches the Ophis orderbook sell-quote and a public all-DEX aggregator (KyberSwap) quote for the same input, and returns `beatBps` (+ = Ophis returns more of the buy token). Use before build_order to show the expected edge. The reference can reflect thin or manipulated liquidity, so treat beatBps as advisory, not a sole execution signal. Sell-side (exact-in) only. Read-only.

輸入參數from必填chainId必填buyToken必填sellToken必填sellAmount必填

resolve_token

Resolve token symbol to canonical address

Resolve an ERC-20 token SYMBOL to its CANONICAL on-chain address from the trusted Ophis token list (the same curated list the swap UI uses). Use this BEFORE quoting or building so you never trade an address taken from chat, the web, or memory: a token can spoof the symbol "USDC" at a scam address, and this fails closed. Returns { found, ambiguous, canonical: {address, decimals, name} | null, matches: [...] }. found=false means no trusted match (do NOT guess: confirm any candidate with get_balances and the user). ambiguous=true means several trusted tokens share the symbol (e.g. native vs bridged); confirm which the user means. Native coins are not returned; resolve the wrapped symbol (e.g. WETH). Read-only.

輸入參數symbol必填chainId必填

validate_order

Validate order preflight

Offline preflight for an order you built OUTSIDE build_order (no network call, no keys). Catches the documented silent-failure modes before you sign or submit: wrong appCode (prevents Ophis referral attribution), wrong orderbook host (api.cow.fi silently bypasses the Ophis stack on Ophis-operated chains), wrong EIP-712 domain (signing against CoW's canonical settlement on an Ophis-operated chain yields a domain the deployed contract rejects), appData hash mismatch (order.appData must equal keccak256 of the exact fullAppData string), an unpinned receiver (proceeds leaving the owner), an expired or non-zero-fee order, and malformed partnerFee entries. Pass whatever you have (chainId is required; owner, order, fullAppData, signingDomain, orderbookUrl are all optional and each is checked if present). Returns { valid, errors, warnings, expected } where `expected` echoes the correct per-chain orderbook host, settlement, EIP-712 domain, appCode, and partnerFee. Prefer build_order to construct orders; use this to verify externally-built ones.

輸入參數orderownerchainId必填fullAppDataorderbookUrlsigningDomain

版本歷史

3
  1. v0.2.0最新Oct 19, 2026
  2. v0.1.2Sep 29, 2026
  3. v0.1.1Sep 16, 2026

評分

已滿足適用檢查項的 100%

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

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分