Reversion MCP
Reversion MCP is an open-source Model Context Protocol server that exposes the Reversion trading platform to AI agents. It connects any MCP-compatible app — Claude Desktop, Cursor, VS Code, or custom agents — to live markets, algorithmic strategies, backtesting, and optimization.
How It Works
Section titled “How It Works”Agent App (Claude Desktop, Cursor, etc.) ↕ stdio or HTTPreversion-mcp ↕ HTTP (Bearer token auth)Reversion Backend (:3001) ├── Trading, algos, market data (direct) └── Charting, backtesting, optimization (proxied to compute worker)The MCP server is stateless and talks only to the backend. All functionality — trading, charting, backtesting, optimization — routes through the backend’s single API gateway.
Installation
Section titled “Installation”Option A: npm (recommended)
Section titled “Option A: npm (recommended)”No local clone needed. Configure your MCP client to run:
npx -y reversion-mcpSee Reversion Agent — Configure Your MCP Client for full config examples per app.
Option B: From source
Section titled “Option B: From source”Requires Bun runtime.
git clone https://github.com/reversion-trade/reversion-mcp.gitcd reversion-mcpbun installPoint your MCP client to the local source:
{ "mcpServers": { "reversion": { "command": "bun", "args": ["run", "/path/to/reversion-mcp/src/index.ts"], "env": { "REVERSION_API_TOKEN": "rvt_your_token_here", "REVERSION_BACKEND_URL": "http://localhost:3001" } } }}Option C: HTTP transport
Section titled “Option C: HTTP transport”Run with HTTP transport for remote or web-based agents:
REVERSION_API_TOKEN=rvt_... bun run src/index.ts --transport http --port 3002Then connect your MCP client over HTTP:
{ "mcpServers": { "reversion": { "type": "streamable-http", "url": "http://localhost:3002/mcp" } }}Health check: GET http://localhost:3002/health
Environment Variables
Section titled “Environment Variables”| Variable | Required | Default | Description |
|---|---|---|---|
REVERSION_API_TOKEN | Yes | — | API token (rvt_...) from the web app or POST /auth/tokens |
REVERSION_BACKEND_URL | No | http://localhost:3001 | Backend URL. Use https://api.reversion.trade for production |
Token Scopes & Access Control
Section titled “Token Scopes & Access Control”API tokens are SHA-256 hashed in the database — the plaintext is shown once at creation. Tokens support scopes and optional expiry, and can be revoked at any time from the web app.
| Scope | Tools Granted |
|---|---|
read | Account overview, watchlist, market data, economic calendar |
trade | Order placement & cancellation, position management, leverage & margin |
algo | Algorithm CRUD, charting, backtesting, optimization |
A request to a tool outside the token’s scopes returns a permissions error. For full agent access, create a token with all three scopes.
Authentication Flow
Section titled “Authentication Flow”The MCP server never touches your private keys:
- You connect your wallet (MetaMask, etc.) to the Reversion web app via SIWE sign-in
- The backend creates an API wallet — a separate encrypted keypair for executing trades on Hyperliquid
- You approve the API wallet on Hyperliquid (builder fee approval)
- You generate an API token (
rvt_...) scoped to your account - The MCP server uses the
rvt_token to authenticate; the backend resolves your user and trades via the API wallet
Supported Exchanges
Section titled “Supported Exchanges”- Hyperliquid — native perpetual futures (all listed pairs)
- HIP-3 XYZ DEX markets — perpetual markets for tradfi assets on Hyperliquid’s HIP-3 protocol
The exchangeId parameter defaults to hyperliquid across all tools.
Deployment Notes
Section titled “Deployment Notes”- Single dependency — only needs
REVERSION_BACKEND_URL. All functionality is proxied through the backend. - Stateless — no local state. Safe to restart or run multiple instances.
- Auth forwarding — the API token is sent as
Authorization: Bearer rvt_...on every request. - Production — point
REVERSION_BACKEND_URLtohttps://api.reversion.trade. The MCP server runs on the user’s machine (or a server for HTTP transport) and connects outbound.