Skip to main content
Glama
Reins MCP

Reins MCP

by onreins

Reins MCP

Let any AI agent trade through a Mandate on Arc: an MCP server, a JavaScript SDK and a reference agent.

A Mandate is a smart contract that holds an agent's USDC under rules the agent can't break: a cap on every trade, a fair-price check against Chainlink, a loss limit with a public stop-loss, an expiry, and no way to move money out. The contracts are in reins-contracts. This repo is how an agent uses one.

The agent never needs to be trusted. It holds only its own trading key, and the contract decides what that key may do. A trade that breaks a rule is refused on-chain, and the refusal comes back to the agent as a plain sentence naming the rule, so it can adjust instead of retrying blindly.

Part of Reins · app at app.reins.one

The MCP server

Ten tools for any MCP client (Claude Desktop, Claude Code, or any agent framework that speaks MCP). Five run the agent's account:

Tool

What it does

mandate_status

Equity in USD, what the Mandate holds, the rules it trades within (max trade size, loss limit, allowed assets, expiry) and how much loss headroom is left

mandate_price

The Chainlink price for an asset, the one every trade is checked against

mandate_check

Would this trade go through? The contract simulates it and nothing is sent: what it would receive, or the rule it would break and the largest amount it could trade instead

mandate_trade

Trade an amount of one asset for another, e.g. { "from": "USDC", "to": "EURC", "amount": "5" }

mandate_history

Recent on-chain events (trades, deposits, withdrawals, freezes), plus every trade tried this session, including refused ones, which never reach the chain

Five bring in the rest of the Reins platform, and need no key at all:

Tool

What it does

markets

Live markets on Hyperliquid, Binance and Coinbase: price, 24-hour change and volume, funding for perpetuals

hot_list

This four-hour round's hottest and coolest coins, each with a verdict, a reason, limits sized for its swings and a strategy idea

thesis

Three readers on one coin (trend, flow, risk), a verdict of hot, watch or cold, and suggested limits

backtest

A strategy in plain words, turned into rules and tested on real prices since 2021, after fees, against buying and holding. The text is sent to the Reins app (REINS_APP_URL) to run

plan_agent

A deposit and limits, turned into a link to the create page with them filled in. The owner signs it; the AI never can

A refused trade returns { "ok": false, "rule": "TradeTooLarge", "reason": "…" } rather than a raw revert, and mandate_check tells the agent before it tries.

So one conversation can go from "what's moving?" (hot_list) to "test buying it on a trend" (backtest) to "set it up with a 10% loss limit" (plan_agent), and then trade inside the rules (mandate_check, mandate_trade).

Research only

Started with no MANDATE_ADDRESS and MANDATE_AGENT_KEY, the server offers just the five platform tools. It's a way to try Reins from Claude before creating an agent:

{ "mcpServers": { "reins": { "command": "node", "args": ["/path/to/reins-mcp/src/mcp-server.js"] } } }

Use it from Claude Desktop

git clone https://github.com/onreins/reins-mcp && cd reins-mcp && npm install

Then add it to claude_desktop_config.json:

{
  "mcpServers": {
    "mandate": {
      "command": "node",
      "args": ["/path/to/reins-mcp/src/mcp-server.js"],
      "env": {
        "MANDATE_ADDRESS": "0xYourMandate",
        "MANDATE_AGENT_KEY": "0xTheAgentsTradingKey",
        "MANDATE_NETWORK": "testnet"
      }
    }
  }
}

Setting

MANDATE_ADDRESS

The Mandate the agent trades for

MANDATE_AGENT_KEY

The agent's own trading key, never the owner's wallet. The contract refuses to let the owner also be the agent.

MANDATE_NETWORK

mainnet (default) or testnet

MANDATE_RPC

Optional RPC URL; defaults to Arc's public endpoint

REINS_APP_URL

Optional; where backtests run and plan links point. Defaults to https://app.reins.one

Create a Mandate and its agent key in the app at app.reins.one, or with createMandate below.

Related MCP server: arcus-agent-gateway

The SDK

import { MandateClient, createMandate } from "./src/sdk.js";

const mandate = new MandateClient({ publicClient, wallet, address });

await mandate.status();                                   // money, holdings, rules, headroom
await mandate.price("EURC");                              // { usd, updatedAt }
await mandate.trade({ from: "USDC", to: "EURC", amount: "5" });
// → { sold, bought, equityUsd }, or throws with err.mandate = { rule, reason }

publicClient and wallet are viem clients for Arc; the wallet holds the agent's key, and reading needs no wallet at all.

createMandate creates and funds one through the factory, with rules in plain units:

const address = await createMandate({
  publicClient, ownerWallet, factory, venue, base: USDC,
  name: "my first agent",
  agent: agentAddress,
  rules: { maxTradeUsd: 2, maxLossPercent: 10, maxSlippagePercent: 1, expiresAt: "2026-12-31" },
  assets: [{ token: EURC, feed: EURC_USD_FEED }],
  deposit: 5,
});

The reference agent

examples/fx-reversion.js trades EUR/USD reversion through a Mandate: when EURC is cheap in the Uniswap pool against Chainlink by more than the pool fee plus a margin, it buys; when rich, it sells. Every decision is logged with its reason.

MANDATE_ADDRESS=0x… MANDATE_AGENT_KEY=0x… npm run agent:fx -- --once

It is a worked example, not a profitable strategy. We measured it on live Arc mainnet data: over 23.8 hours the pool moved 33.7bp in total, against a 10bp round-trip cost, so every threshold at or above cost fired zero trades. It's here to show how an agent drives a Mandate, and because its refusals are what the live testnet run exercised.

Settings: AGENT_EDGE_BPS (default 15), AGENT_TRADE_USD (default: the Mandate's limit), AGENT_INTERVAL_SEC (default 60).

Tests

npm install
npm run chain        # terminal 1: a local node
npm test             # terminal 2: 20 tests

They run the MCP server through a real MCP client against freshly deployed contracts: status, prices and trades; every refusal named instead of dumped as a raw revert; tokens that return nothing or restrict who may hold them; and the reference agent's decisions. compiled/ holds the contract builds the tests deploy, produced by reins-contracts.

License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    • Warden MCP lets AI agents find tokens, quote swaps and trade onchain on Base, BNB Chain, Robinhood Chain, Arc and Solana, within limits you set. Market tools need no credential: list_chains, search_tokens, trending_tokens, price_history, quote_swap and swap_status. Search by name, ticker or contract address, read USD price candles, and price a swap before committing to it, including cross-chain swaps. Wallet tools act for the wallet whose owner connected the agent, by OAuth sign-in or a wk_ key. agent_permissions shows what the agent may do and its daily limits. prepare_swap builds a trade and hands the owner a review link to sign. With request_session the owner turns on hands-free trading in one tap, and execute_swap then trades within the limits they set. swap_status tracks gasless and cross-chain trades. get_wallet shows holdings on every chain. Gasless trading is available on Base, BNB Chain and Robinhood Chain. Built by Warden Protocol, the team behind Warden Token Terminal.

    • Human-governed Arc agent services, live demand signals, quotes, feedback, and USDC commerce.

    • OpenFinance gives any AI agent easy trading across every major market through one hosted MCP server. Trade crypto spot and perpetuals on Hyperliquid with market, limit and TWAP orders, leverage and margin control. Trade stocks, indices, commodities, forex and pre-IPO names as Hyperliquid HIP-3 perps. Trade Polymarket prediction markets with odds, order books, positions, PnL and trader leaderboards. Swap and bridge across 40+ EVM chains and Solana with Relay and Jupiter, find memecoins across 200+ chains, launch tokens on Robinhood Chain and Solana, and buy crypto with card, bank or UPI. Write actions are designed to ask for your confirmation first. Connect with OAuth (sign in to OpenFinance and approve) or an API key. Works with Claude, ChatGPT, Cursor, VS Code, Codex and any MCP client. No install. Home: https://openfinance.tech/agents · Docs: https://docs.openfinance.tech · GitHub: https://github.com/openfinance-tech/mcp

    • Pay-per-call DeFi and macro intel for AI agents. x402 USDC tools via streamable HTTP /api/mcp.

      https://conc-exe.xyz/api/mcp

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Lets MCP-capable AI agents interact with the Arcade DEX and launchpad on Circle's Arc L1 to discover markets, get quotes, and execute trades via contract-call descriptors.
      8
      7 npm
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents to place and manage Hyperliquid trades through MCP with position, leverage, daily-loss, market, and stop-loss limits enforced outside the model, plus paper trading and an auditable decision log.
      9
      104 npm
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to place spot market orders on a paper or ccxt exchange account only when the trade fits a pre-registered mandate, sealing a hash of the agent's rationale into a tamper-evident trace and reconciling the authorized intent against the actual fill. It also exposes the mandate, quotes, balances, and trade trace/journal records as tools, failing closed whenever policy checks are unreachable.
      177 PyPI
      MIT