LIVE · SDK 0.3.0

Docs · MCP usage

DOCS · MCP

MCP usage

The SDK ships an stdio MCP server built on the official @modelcontextprotocol/sdk. Any agent can read public Hyperliquid data, simulate against a supplied book and check receipts. It is keyless and has no order tool.

The 14 tools

Registered tool names, in list order:

ToolWhat it does
marketsList perpetual markets from the public info endpoint.
order_bookRead a capped order book and its data age.
fundingRead funding, mark and open interest for one coin.
positionsRead positions for one address.
feesRead the address fee rates and their data age.
simulateSimulate a closed-bar decision on a supplied book. Result is SIMULATED.
funding_extremesZ-score of the public hourly funding rate against a trailing window.
book_imbalanceBid depth divided by ask depth inside a public-book band.
get_limitsRead the owner limits and the remaining headroom.
trigger_kill_switchLatch the kill switch. A tool call cannot clear it.
get_cost_breakdownRecompute the execution-cost breakdown from a simulation receipt. Result is SIMULATED.
paperRead the live public book and funding for one coin, then run the guarded simulator. Result is SIMULATED; no keys, no order.
link_fillsLink an account's real fills (by order id, fill hash or client order id) to a simulation receipt. Gives back a hash-bound link record with fill ratio, slippage and fee drag against the simulation. Reads public fill history only.
holding_receiptBuild a holding-period receipt for one coin from supplied fills and funding rows: entry and exit fill linkage plus an account-level funding sum. Tamper-evidence only: the rows are not authenticated to the venue or account, and the simulation receipt is not verified here, so the record is capped at PROVISIONAL. Read-only, no keys, no orders.

submit_order and any other order tool is refused.

Connect a client

No API key, wallet or secret is required. The examples below start the published 0.3.0 server over stdio. Use uvx perpbrain==0.3.0 mcp (Python) or npx -y -p @perpbrain/sdk perpbrain-mcp (Node). Optional: set PERPBRAIN_HL_NETWORK to testnet; it defaults to mainnet public data. There is no order tool.

PerpBrain is listed in the official MCP Registry as io.github.PERPBRAIN/perpbrain, with the PyPI package perpbrain and the npm package @perpbrain/sdk. Each release is listed automatically.

Claude Desktop

Open claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json) and add:

{
  "mcpServers": {
    "perpbrain": {
      "command": "uvx",
      "args": ["perpbrain==0.3.0", "mcp"]
    }
  }
}

Cursor

Create .cursor/mcp.json in your project, or add a server under Cursor Settings → MCP, with the same shape:

{
  "mcpServers": {
    "perpbrain": {
      "command": "uvx",
      "args": ["perpbrain==0.3.0", "mcp"]
    }
  }
}

To use the npm launcher instead, set command to npx and args to ["-y", "-p", "@perpbrain/sdk", "perpbrain-mcp"].

Claude Code

claude mcp add perpbrain -- uvx perpbrain==0.3.0 mcp

VS Code / GitHub Copilot

Add a server in .vscode/mcp.json:

{
  "servers": {
    "perpbrain": {
      "command": "uvx",
      "args": ["perpbrain==0.3.0", "mcp"]
    }
  }
}

Cline, Windsurf and other stdio MCP clients

Use the same command as Claude Desktop: a stdio server with command uvx and args ["perpbrain==0.3.0", "mcp"], and no secrets. Windsurf uses ~/.codeium/windsurf/mcp_config.json; Cline uses its MCP settings JSON. The 14 tools are reads and simulations only.

From a clone, you can still run cd ts/mcp-server && npm ci (Node 22.6 or newer) and point command at node with args ["/absolute/path/to/perpbrain-sdk/bin/perpbrain-mcp.mjs"].

A first prompt flow

  1. Call get_limits and note the headroom.
  2. Call simulate on a supplied book. The result is labelled SIMULATED.
  3. Call get_cost_breakdown on the receipt for fees, slippage and funding.
  4. Call verify_receipt. A match reports VERIFIED.

The offline version of this flow is node --experimental-strip-types examples/mcp-fixtures.ts.

Agent-first, owner-controlledThe agent reads, simulates and checks. Only you set limits, and only you clear a kill switch. Limits you set; losses are still possible.