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 分