o1-mcp

o1-mcp

Provides access to live swap quotes and routing on the Base network via the o1.exchange DEX aggregator. Read-only and safe by default, it returns routing data and unsigned calldata for you to sign in your own wallet.

Category
访问服务器

README

o1-mcp

CI License: MIT

An MCP server that exposes the o1.exchange DEX aggregator — live swap quotes and routing on Base — to any MCP client (Claude Desktop, Claude Code, …). Read-only and safe by default: no private keys, no signing, no broadcasting. It returns routing data and, optionally, unsigned calldata you sign in your own wallet.

Tools

Tool Endpoint What it does
o1_health GET /health Liveness check. No auth.
o1_get_quote POST /quote Primary. Quote a swap → compact route summary + raw.
o1_list_supported_dexes — The DEX venues the router can use on Base.
o1_build_swap_transaction POST /submit Gated. Turn a quoteId into unsigned calldata.
o1_execute_swap POST /execute Gated. One-shot quote + unsigned calldata.

The two gated tools register only when O1_ENABLE_BUILD_TX=true. They never sign or broadcast — you do, in your own wallet.

o1_get_quote takes tokenIn, tokenOut (an EVM address or "ETH"), and amountIn (base units / wei, as a string > 0). Optional: slippageBps (default 100, capped at 2000 unless O1_ALLOW_HIGH_SLIPPAGE=true), chainId, maxHops, splitEnabled, allowedDexes, feeBps, timeBudgetMs. It returns:

{
  "quoteId": "…", "expiresAt": 1782700000000,
  "expectedAmountOut": "…", "minAmountOut": "…",
  "feeBps": 5, "gasUnits": "210000",
  "venues": ["AERODROME_V2LIKE", "UNIV3"],
  "routesCount": 2,
  "note": "quote expires ~10s",
  "raw": { /* full /quote response */ }
}

Selling ETH? Set useNativeIn: true on the gated tools, or the calldata's value comes back 0. Quotes expire in ~10s and are never cached.

Demo

Verified live in Claude Code — the read-only tools load and respond against production:

o1 tools registered in Claude Code

o1_health returns ok:true and o1_list_supported_dexes lists 21 venues on Base

o1_health → ✅ /health returned { ok: true } · o1_list_supported_dexes → 21 DEX venues on Base (chain ID 8453). The gated o1_build_swap_transaction and o1_execute_swap tools appear once O1_ENABLE_BUILD_TX=true.

<details> <summary>Text version</summary>

Tools for o1 — 3 tools
  1. o1_health                read-only, open-world
  2. o1_get_quote             read-only, open-world
  3. o1_list_supported_dexes  read-only

o1_list_supported_dexes → UNIV2, UNIV3, UNIV4, AERODROME_V2LIKE, AERODROME_CL, PANCAKE_V2, PANCAKE_V3, PANCAKE_INFINITY_CL, HYDREX, QUICKSWAP_V4, ALIEN_BASE_V3, CURVE, PROPSWAP, TESSERA, ELFOMOFI, LUNARBASE, FELTIR, DODO_V2, WOOFI, GYROSCOPE_ECLP, MAVERICK_V2.

</details>

Quick start

Requires Node 20+.

npm install
npm run build
cp .env.example .env   # set O1_API_KEY and O1_API_BASE_URL

Add it to your MCP client (stdio):

{
  "mcpServers": {
    "o1": {
      "command": "node",
      "args": ["/absolute/path/to/o1-mcp/dist/index.js"],
      "env": {
        "O1_API_BASE_URL": "https://quiet-bloodhound-531.convex.site",
        "O1_API_KEY": "your-key-here"
      }
    }
  }
}

Claude Code: claude mcp add o1 -- node /absolute/path/to/o1-mcp/dist/index.js.

Environment

Var Required Default Notes
O1_API_BASE_URL ✅ — Aggregator base URL, no trailing slash. Prod: https://quiet-bloodhound-531.convex.site.
O1_API_KEY for non-health — Sent as x-api-key (issued by o1). Redacted from all output.
O1_DEFAULT_SLIPPAGE_BPS 100 Default slippage (bps) when a quote omits it.
O1_ALLOWED_CHAIN_IDS 8453 Chain allowlist. Base only (phase 1).
O1_ENABLE_BUILD_TX false Register the gated /submit + /execute tools.
O1_HTTP_TIMEOUT_MS 8000 Per-request timeout (ms).
O1_MAX_RETRIES 2 Retries for /health & /quote on 429/5xx.
O1_ALLOW_HIGH_SLIPPAGE false Allow slippage above the 2000 bps cap.
O1_LOG_LEVEL info debug/info/warn/error. Logs go to stderr only.

Safety

  • Read-only by default — swap-building tools are opt-in via O1_ENABLE_BUILD_TX.
  • No private keys, ever — no tool accepts one, and output is always unsigned.
  • Inputs validated before any network call — address format, amountIn > 0, slippage cap, chain allowlist.
  • Secrets redacted from every log and error; logs go to stderr only (stdout carries only the MCP stream).
  • Errors mapped — 400 invalid input · 401 auth · 429 rate-limited (with backoff) · 5xx upstream. Reads (/health, /quote) retry with backoff + jitter; writes (/submit, /execute) never do.

Development

npm run typecheck   # strict tsc
npm run lint        # eslint
npm test            # vitest (mocked fetch — no live network)
npm run dev         # run from source via tsx

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选