Ophis MCP

fi.ophisPublished by ophis.fiOfficial publisherv0.2.0Updated Oct 24, 2026

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

VerifiedStreamable HTTPWeb executableFinanceDeveloper Tools

Overview

AI-generated overview

Remote MCP server for the Ophis DEX that lets an assistant parse swap requests, quote, build and relay gasless CoW Protocol token orders on EVM chains.

What you can do
  • Parse plain-English swap requests into structured intents and resolve token symbols to canonical addresses
  • List configured chains and fetch best-execution quotes, expected price improvement and gas prices
  • Build bounded, ready-to-sign CoW orders and relay pre-signed orders to the orderbook
  • Preflight externally built orders offline for wrong appCode, host, domain or receiver
  • Read native and ERC-20 balances for one wallet, across chains, and token OHLCV price history
  • Look up routed volume and integrator fees by appCode
When to use it
Use it when an assistant should help a user or agent trade tokens on EVM chains through Ophis: turning a natural-language swap into a quote, a signable order and a submission, or checking balances, prices and fees before trading.
Requirements
A remote Streamable-HTTP endpoint; no package install. No authentication, API keys or environment variables are declared. The agent needs its own wallet key to sign the EIP-712 order returned by build_order, and network access to the Ophis endpoints and public RPCs.
Before you install
The server holds no keys and never signs, but submit_order relays a signed order that moves funds, so confirm amounts, tokens and slippage with the user before signing. Receiver is pinned to the owner, yet this is an off-chain guard, not an on-chain authorization boundary. Token chart prices come from a single pool that may be thin or manipulated. Submitting enrolls the owner for indexing and trade rewards, and referral defaults apply unless overridden.

Installation

In SourceWeft

  1. Open Ophis MCP in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.

Use with an agent

Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.

Read https://sourceweft.com/mcp/fi.ophis%2Fmcp/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.

Read the install guide the agent follows

Other MCP clients

Add this to your client's mcpServers config.

{
  "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.

Source: apps/mcp-server/README.md at commit 9689d5c

Tools

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.

Parameterstextrequired

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).

ParametersfromrequiredkindrequiredamountrequiredchainIdrequiredbuyTokenrequiredsellTokenrequiredisStablePairvalidForSeconds

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.

ParameterskindrequiredownerrequiredchainIdrequiredbuyTokenrequiredbuyAmountrequiredfeeAmountsellTokenrequiredsellAmountrequiredisStablePairreferrerCodeslippageBipsvalidForSeconds+3 more

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.

ParametersfromrequiredorderrequiredchainIdrequiredsignaturerequiredfullAppDatarequiredsigningScheme

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.

ParametersappCoderequired

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.

Takes no parameters.

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).

ParametersownerrequiredtokenschainIdrequired

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.

ParametersownerrequiredchainIdstokensByChain

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.

ParameterschainIdrequired

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.

ParameterslimittokenrequiredchainIdrequiredaggregatetimeframe

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.

ParametersfromrequiredchainIdrequiredbuyTokenrequiredsellTokenrequiredsellAmountrequired

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.

ParameterssymbolrequiredchainIdrequired

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.

ParametersorderownerchainIdrequiredfullAppDataorderbookUrlsigningDomain

Version history

3
  1. v0.2.0LatestOct 19, 2026
  2. v0.1.2Sep 29, 2026
  3. v0.1.1Sep 16, 2026

Score

100% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 daysRequired25 pts
  • Auth declaredRequired10 pts
  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts