# Rubin Exchange

A remote MCP server for reading market and account data and trading spot assets or perpetual futures through AI agents.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI
- Author: rubin-trade
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/rubin-trade/rubin-mainnet-mcp
- Updated: 2026-07-01
- HTML: https://affpapa.org/en/nevibecode/mcp/rubin-exchange

## What it does

Rubin Exchange connects an AI agent to the Rubin decentralized exchange through a hosted remote MCP server using streamable HTTP. It exposes markets, order books, candles, balances, equity, positions, open orders, fills, and PnL.

The trading tools cover market and limit orders, cancellations, stop-loss, take-profit, cancel-all, and batch cancellation. Funds stay in your custody, while trading access is granted through a scoped token that you create yourself.

Create an MCP token in Rubin under `Trading Keys` → `MCP Token` before connecting. Account and trading requests require the `Authorization: Bearer <token>` header.

## Requirements
- Remote server: `https://mcp.mainnet.rubin.trade/mcp`

## Install

### Claude Code (native platform)

**Platform CLI: remote server**
```bash
claude mcp add --transport http rubin-exchange https://mcp.mainnet.rubin.trade/mcp
```

### Codex

**Platform CLI: remote server**
```bash
codex mcp add rubin-exchange --url https://mcp.mainnet.rubin.trade/mcp
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "rubin-exchange": {
            "url": "https://mcp.mainnet.rubin.trade/mcp"
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "rubin-exchange": {
            "type": "http",
            "url": "https://mcp.mainnet.rubin.trade/mcp"
        }
    }
}
```

### Gemini CLI

**Platform CLI: remote server**
```bash
gemini mcp add -t http rubin-exchange https://mcp.mainnet.rubin.trade/mcp
```

## When to use it
- read live market and order-book data
- inspect balances, positions, and PnL
- place or cancel a trading order
- set stop-loss and take-profit orders

## Example prompts
- Show Rubin markets and their current order books.
- Check my balances, positions, open orders, and PnL.
- Place a limit order and attach a stop-loss.

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89609
- [CCXT](https://affpapa.org/en/nevibecode/mcp/ccxt.md) — MCP server · ★ 44591
- [Finance Toolkit](https://affpapa.org/en/nevibecode/mcp/finance-toolkit.md) — MCP server · ★ 5469
- [EdgarTools](https://affpapa.org/en/nevibecode/mcp/edgartools.md) — MCP server · ★ 2817
- [LetsFG — Flights & Hotels](https://affpapa.org/en/nevibecode/mcp/letsfg-flights-hotels.md) — MCP server · ★ 2197
- [AutoTS](https://affpapa.org/en/nevibecode/mcp/autots.md) — MCP server · ★ 1434

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
