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 12 tools
Registered tool names, in list order:
| Tool | What it does |
|---|---|
markets | List perpetual markets from the public info endpoint. |
order_book | Read a capped order book and its data age. |
funding | Read funding, mark and open interest for one coin. |
positions | Read positions for one address. |
fees | Read the address fee rates and their data age. |
simulate | Simulate a closed-bar decision on a supplied book. Result is SIMULATED. |
funding_extremes | Z-score of the public hourly funding rate against a trailing window. |
book_imbalance | Bid depth divided by ask depth inside a public-book band. |
get_limits | Read the owner limits and the remaining headroom. |
trigger_kill_switch | Latch the kill switch. A tool call cannot clear it. |
get_cost_breakdown | Recompute the execution-cost breakdown from a simulation receipt. Result is SIMULATED. |
verify_receipt | Check a simulation receipt against its manifest and inputs bytes: verified and reproducible. |
submit_order and any other order tool is refused.
Connect a client
Run cd ts/mcp-server && npm ci once in your clone (Node 22.6 or newer). Then add this block, with the absolute path to your clone:
Claude Desktop
{
"mcpServers": {
"perpbrain": {
"command": "node",
"args": ["/absolute/path/to/perpbrain-sdk/bin/perpbrain-mcp.mjs"],
"env": {
"PERPBRAIN_HL_NETWORK": "mainnet"
}
}
}
}
Cursor
In Cursor Settings → MCP, add a server with the same shape (stdio, no secrets).
A first prompt flow
- Call
get_limitsand note the headroom. - Call
simulateon a supplied book. The result is labelledSIMULATED. - Call
get_cost_breakdownon the receipt for fees, slippage and funding. - Call
verify_receipt. A match reportsVERIFIED.
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.