Skip to content

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.

Agent App (Claude Desktop, Cursor, etc.)
↕ stdio or HTTP
reversion-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.

No local clone needed. Configure your MCP client to run:

Terminal window
npx -y reversion-mcp

See Reversion Agent — Configure Your MCP Client for full config examples per app.

Requires Bun runtime.

Terminal window
git clone https://github.com/reversion-trade/reversion-mcp.git
cd reversion-mcp
bun install

Point 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"
}
}
}
}

Run with HTTP transport for remote or web-based agents:

Terminal window
REVERSION_API_TOKEN=rvt_... bun run src/index.ts --transport http --port 3002

Then connect your MCP client over HTTP:

{
"mcpServers": {
"reversion": {
"type": "streamable-http",
"url": "http://localhost:3002/mcp"
}
}
}

Health check: GET http://localhost:3002/health

VariableRequiredDefaultDescription
REVERSION_API_TOKENYesAPI token (rvt_...) from the web app or POST /auth/tokens
REVERSION_BACKEND_URLNohttp://localhost:3001Backend URL. Use https://api.reversion.trade for production

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.

ScopeTools Granted
readAccount overview, watchlist, market data, economic calendar
tradeOrder placement & cancellation, position management, leverage & margin
algoAlgorithm 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.

The MCP server never touches your private keys:

  1. You connect your wallet (MetaMask, etc.) to the Reversion web app via SIWE sign-in
  2. The backend creates an API wallet — a separate encrypted keypair for executing trades on Hyperliquid
  3. You approve the API wallet on Hyperliquid (builder fee approval)
  4. You generate an API token (rvt_...) scoped to your account
  5. The MCP server uses the rvt_ token to authenticate; the backend resolves your user and trades via the API wallet
  • 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.

  • 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_URL to https://api.reversion.trade. The MCP server runs on the user’s machine (or a server for HTTP transport) and connects outbound.