onus-spot-mcp
v1.0.0
Published
MCP Server for ONUS Spot Exchange - allows AI tools to trade, view orderbook, check balances, and stream market data
Downloads
81
Maintainers
Readme
ONUS Spot Exchange MCP Server
MCP (Model Context Protocol) server that wraps the ONUS Spot Exchange REST API and WebSocket streams, allowing AI tools (Claude Desktop, Claude Code, Cursor, etc.) to interact with the exchange.
Features
- 17 tools covering market data, trading, account management, and real-time streams
- Field name decoding: abbreviated API fields (a, b, c...) are decoded to human-readable names
- WebSocket message buffering for stream data queries
- Error code mapping to readable messages
Installation
cd mcp-server
npm install
npm run buildConfiguration
Set environment variables:
# Required for authenticated endpoints (trading, balances, etc.)
export ONUS_API_KEY=your-api-key-here
# Optional (defaults shown)
export ONUS_BASE_URL=https://spot-markets.goonus.io
export ONUS_WS_URL=wss://spot-stream.goonus.ioUsage with Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"onus-spot": {
"command": "node",
"args": ["/absolute/path/to/mcp-server/dist/index.js"],
"env": {
"ONUS_API_KEY": "your-api-key-here"
}
}
}
}Usage with Claude Code
Add to .claude/settings.json:
{
"mcpServers": {
"onus-spot": {
"command": "node",
"args": ["/absolute/path/to/mcp-server/dist/index.js"],
"env": {
"ONUS_API_KEY": "your-api-key-here"
}
}
}
}Available Tools
Market Data (no auth required)
| Tool | Description |
|------|-------------|
| get_symbol_configs | Get all symbol and currency configurations |
| get_candlesticks | Get candlestick/kline data |
| get_orderbook | Get current orderbook |
| get_ticker_stats | Get 24h ticker statistics |
| get_trades | Get recent trades |
User Data (requires API key)
| Tool | Description |
|------|-------------|
| get_balances | Get all currency balances |
| get_balance | Get balance for a specific currency |
| get_active_orders | Get open/active orders |
| get_closed_orders | Get closed orders in a time range |
| get_asset_histories | Get asset and trade history |
Trading (requires API key)
| Tool | Description |
|------|-------------|
| new_order | Place order (v1: LIMIT, MARKET) |
| new_order_v2 | Place order (v2: + STOP, OCO) |
| cancel_order | Cancel an active order |
| withdraw | Withdraw currency |
WebSocket Streams
| Tool | Description |
|------|-------------|
| subscribe_market_stream | Subscribe to market data streams |
| unsubscribe_market_stream | Unsubscribe from streams |
| get_stream_messages | Get buffered stream messages |
