# Reins

**Category:** 💰 Finance & Fintech  
**Repository:** https://github.com/R2Rlabs/reins  
**GitHub Stars:** 0  
**npm Downloads (last month):** 524  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/reins

## Description
Risk limits and an audit log for AI agents trading Hyperliquid, enforced outside the model.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "reins": {
    "command": "npx",
    "args": ["-y","@r2rlabs/reins"],
    "env": {
      "REINS_MODE": "",
      "REINS_NETWORK": "",
      "REINS_ACCOUNT_ADDRESS": "",
      "REINS_PRIVATE_KEY": "",
      "REINS_LOG_FILE": ""
    }
  }
}
```

**Requires environment variables:** `REINS_MODE`, `REINS_NETWORK`, `REINS_ACCOUNT_ADDRESS`, `REINS_PRIVATE_KEY`, `REINS_LOG_FILE` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What Reins MCP server does

Reins MCP server sits between an AI agent and Hyperliquid. It checks trading requests before they reach the exchange and records the result. The controls are implemented outside the model, so a prompt or model decision cannot bypass the configured checks.

The risk engine supports position caps, per-trade risk limits, leverage limits, daily-loss halts, market allowlists, rate limiting, and a stop-loss requirement for positions. Orders that fail a check are recorded as refusals rather than disappearing from the history. Trading actions that require an explanation, including placing an order, closing a position, and setting a stop-loss, require a reason.

Paper trading provides a rehearsal path using live Hyperliquid prices, simulated fills, and fees. The same tools and limits are used in paper and live modes. In live mode, Reins sends orders to the user's Hyperliquid account through an API wallet; it does not hold funds or provide an exchange.

## How it works

The Reins MCP server can run through stdio, and the project also provides an HTTP mode with token authentication, configurable binding, and JSON responses. The HTTP implementation exposes the same nine tools as routes for clients or bots that do not speak MCP.

Before a tool call, Reins compares account activity with its decision history. This captures fills caused by a stop-loss or resting order, as well as other exchange activity that Reins did not initiate. The resulting append-only JSON Lines log contains the agent's stated reason, request, account context, risk decision, and outcome. Set `REINS_LOG_FILE` to retain the file across process restarts; otherwise, the log remains in memory.

Paper runs can also be persisted across restarts. Live and paper operation share a trading-client interface, while the exchange client handles orders, cancellations, market data, fills, account state, and builder-code operations.

## Setup and configuration

Run `npx @r2rlabs/reins init` to add a paper-mode Reins entry to `.mcp.json`. The defaults are paper trading and Hyperliquid testnet access. A local demo can be built and run with `npm run build` followed by `npm run demo -- --scripted`; the scripted path does not need an API key.

Live operation requires explicit configuration: set `REINS_MODE=live`, choose the network with `REINS_NETWORK`, provide `REINS_ACCOUNT_ADDRESS`, and provide `REINS_PRIVATE_KEY` when signing orders is needed. The private key should belong to a Hyperliquid API wallet, not the main account wallet. The account address identifies where positions and fills are read. Without a live key, live mode remains read-only.

On mainnet, the account must approve Reins' 2 bp builder fee before live trading begins. Run `npx @r2rlabs/reins approve-builder` from the account's own wallet. `npx @r2rlabs/reins live-check` verifies that the live exchange accepts Reins' requests.

## Tools and capabilities

Reins MCP server provides agent-facing operations for trading and account interaction, with every action risk-checked and logged before transmission. The documented actions include placing orders, closing positions, setting stop-losses, and reading recent decisions. The underlying client supports cancellations, order-book and candle data, fills, account state, and builder-code access.

The command-line interface supports serving, initialization, builder-fee approval, live checks, HTTP serving, and platform statistics. The statistics command reports accounts, trades, volume, and fees associated with Reins' builder code.

## Limitations and notes

Reins does not choose a strategy, decide which trades are profitable, or guarantee against losses. Stop-losses can slip in fast markets. Hyperliquid remains responsible for matching orders, and Reins is neither a broker nor a custodian.

The project describes itself as early-stage. A reason in the log is the agent's testimony, not independent proof of its intent. The audit record captures what the agent said and what the exchange did, but it does not make a poor decision correct.

The live private key is read only in live mode; paper mode does not sign transactions. API wallets can trade for an account but cannot withdraw, and Hyperliquid may remove expired or replaced API wallets.

_Full upstream README: https://allmcps.com/mcp/reins/readme_

