o2 Exchange MCP Server
Enables AI agents to interact with the o2 Exchange on the Fuel Network to perform on-chain trading, manage accounts, and access real-time market data. It provides tools for executing various order types and calculating over 16 technical indicators for comprehensive market analysis.
README
o2-mcp-server
MCP (Model Context Protocol) server for the o2 Exchange - A fully on-chain DEX on the Fuel Network. Provides AI agents with trading capabilities, market data access, and technical analysis tools.
Features
- Account Management - Create trading sessions, check balances, manage sessions
- Trading Operations - Place, cancel orders with session-based authentication
- Market Data - Real-time tickers, order books, trade history, and candlestick data
- Technical Analysis - 16+ indicators (RSI, MACD, ADX, BBands, VWAP, etc.) with snapshot/window modes
Available Tools
| Tool | Description |
|---|---|
o2_markets_list |
List all available trading markets |
o2_market_ticker |
Get real-time market ticker data |
o2_depth |
Fetch order book depth (bids/asks) |
o2_trades |
Get recent trade history |
o2_indicators |
Calculate technical indicators (RSI, MACD, ADX, BBands, VWAP, etc.) |
o2_account_create |
Create a new trading account |
o2_balance |
Check asset balance in trading account |
o2_session_create |
Create trading session with owner key |
o2_sessions_list |
List all stored sessions |
o2_session_get |
Get details of a specific session |
o2_place_order |
Place orders (Spot, Market, FillOrKill, PostOnly) |
o2_cancel_order |
Cancel an existing order |
o2_orders |
Get order history with pagination |
Installation
bun install
bun run build
Configuration
Environment Variables
O2_NETWORK=devnet # devnet (default), testnet, or mainnet
O2_PRIVATE_KEY=<your_key> # Owner private key for trading
Note: Trading sessions are automatically created and stored in
~/.o2-mcp/sessions.jsonfor reuse across sessions.
Claude Code
claude mcp add-json o2-mcp-server '{
"type": "stdio",
"command": "node",
"args": ["/path/to/o2-mcp/dist/stdio.js"],
"env": {
"O2_NETWORK": "devnet",
"O2_PRIVATE_KEY": "your_private_key"
}
}'
Codex
Add to .codex/config.toml:
[mcp_servers.o2_mcp]
command = "node"
args = ["/path/to/o2-mcp/dist/stdio.js"]
env = { O2_NETWORK = "devnet", O2_PRIVATE_KEY = "your_private_key" }
Other MCP Clients
Add to your MCP client config (e.g., mcp.json):
{
"mcpServers": {
"o2-mcp": {
"type": "stdio",
"command": "node",
"args": ["/path/to/o2-mcp/dist/stdio.js"],
"env": {
"O2_NETWORK": "devnet",
"O2_PRIVATE_KEY": "your_private_key"
}
}
}
}
Usage
IMPORTANT: Always ask the agent to create a trading account and session before making trades. Each session lives upto 48 hours
Technical Analysis with Indicators
// Get comprehensive technical indicators for ETH/USDC
{
marketId: "0x09c17f779eb0a7658424e48935b2bef24013766f8b3da757becb2264406f9e96",
indicators: ["rsi_14", "macd", "adx_14", "bbands", "vwap", "stoch"],
resolution: "5m",
period: "24h",
mode: "snapshot",
microSummary: true
}
// Returns: Current indicator values, trend bias, momentum, volatility assessment
Place Order
// Buy 5 USDC worth of FUEL at 1.50 USDC per token
{
tradeAccountId: "0x...",
pair: ["FUEL", "USDC"],
side: "Buy",
orderType: "Spot",
rawPrice: "1.50",
rawQuantity: "5.0",
sessionId: "session_123"
}
Market Data
// Get ETH/USDC ticker
{
marketId: "0x09c17f779eb0a7658424e48935b2bef24013766f8b3da757becb2264406f9e96"
}
// Get order book depth
{
marketId: "0x09c17f779eb0a7658424e48935b2bef24013766f8b3da757becb2264406f9e96",
precision: "2"
}
AI Prompts
Sample Chat: https://claude.ai/share/2fde9575-755e-4623-a651-47c4f0627e86
Create Session
Initialize trading account and create a session to trade ETH/USDC
Note: When creating an account with o2_account_create, the owner address is automatically derived from your O2_PRIVATE_KEY environment variable if not explicitly provided.
Placing order
Market Buy 2 USDC worth of ETH
Analyze Market
Comprehensive technical analysis of a market.
/o2-mcp:Analyze_Market <market_id> <period>
Example:
/o2-mcp:Analyze_Market 0x09c17f779eb0a7658424e48935b2bef24013766f8b3da757becb2264406f9e96 24h
Analyzes trend, momentum, volatility, support/resistance, and provides trading recommendations.
Technical Indicators
Supported indicators with o2_indicators tool:
Moving Averages: sma_20, sma_50, ema_12, ema_26, vwap
Momentum: rsi_14, mfi_14, cci_20, stoch
Trend: adx_14, plus_di, minus_di, macd
Volatility: bbands, atr_14
Volume: obv
Snapshot Mode (Default)
Returns latest values with metadata, previous values, deltas, and derived fields (%B, bandwidth, ATR distances).
Window Mode
Returns arrays of historical values aligned to timestamps for charting and analysis.
Order Types
- Spot: Standard limit order (default)
- Market: Execute at best available price
- FillOrKill: Fill completely or cancel (no partial fills)
- PostOnly: Maker-only order (adds liquidity)
Learn More
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。