hl_get_all_midsLABSCO SUMMARY
Read-only is a real mode here, not a promise in a prompt.
Set the wallet address and the trading tools cannot work, whatever the model decides to try; the private key is what turns them on. Once it is on, this executes rather than advises — placing an order, cancelling everything and closing a position are each one call.
What it is
A Hyperliquid client with seventeen tools: mid prices, the order book, candles and funding; your positions, open orders and fills; and orders placed and cancelled, positions closed and leverage set. Two configurations, and the difference matters — a wallet address alone is read-only, and the trading tools return an error until a private key is present.
What you get
- Limit and market orders placed, one order cancelled, or every open order cancelled with an optional coin filter — hl_place_order, hl_cancel_order, hl_cancel_all_orders
- A whole position closed in one call, and leverage set cross or isolated — hl_close_position, hl_set_leverage
- Market data deep enough to trade on — mid prices for every asset, the L2 book, OHLCV candles from 1m to 1d, and each market's leverage and tick size — hl_get_all_mids, hl_get_orderbook, hl_get_candles, hl_get_meta
- Funding history, predicted next-8h funding across venues, and mark, oracle, open interest and 24h change for BTC, ETH, XRP and SOL — hl_get_funding_history, hl_get_predicted_fundings, hl_get_asset_contexts
- Positions, equity, margin and PnL, and the open orders against them — hl_get_user_state, hl_get_open_orders
- Trade history, or the fills for one coin with win rate and PnL, plus the live tape with its buy/sell imbalance — hl_get_fills, hl_get_user_fills_by_coin, hl_get_recent_trades
Requirements
Python and a clone of this repository, installed with pip install -e . from inside it. For reading only, set HL_WALLET_ADDRESS and nothing else. Trading needs HL_PRIVATE_KEY, which stays on your machine — the server runs locally over stdio and talks only to Hyperliquid's API. With the key present, an order placed is a live order, so the project's own advice is a dedicated trading wallet with limited funds.
Setup effort
Build from source — git clone https://github.com/erscoder/hyperliquid-mcp
USE CASES
Asking where the account stands
Read positions, equity, margin and PnL, and the open orders against them.
Sizing an order that will actually be accepted
Read the market's tick size and leverage limits, check the book at the size you want, then place a limit or market order.
Deciding whether the carry is worth holding
Read current and historical funding for the perpetual next to its candles before adding to or cutting the position.
Pulling an order the market has left behind
List what is still open and cancel the order that no longer makes sense.
Clearing the book in a hurry
Cancel every open order at once, optionally limited to one coin, or close a whole position in one call.
Reconciling what was actually filled
Pull the trade history, or the fills for one coin with win rate and PnL, and set leverage back where you want it.
17 tools
Listed in project docs. Your client may show a different list.
hl_get_orderbookhl_get_metahl_get_candleshl_get_user_statehl_get_open_ordershl_get_fillshl_get_user_fills_by_coinhl_get_funding_historyhl_get_predicted_fundingshl_get_asset_contextshl_get_recent_tradeshl_place_orderhl_cancel_orderhl_cancel_all_ordershl_close_positionhl_set_leverageBEFORE YOU INSTALL
What to know first
Tools you get
17 tools named in the project's documentation. hl_place_order, hl_cancel_order, hl_cancel_all_orders, hl_close_position and hl_set_leverage require HL_PRIVATE_KEY and fail with only HL_WALLET_ADDRESS.
Requires
- git and pip on PATH
- HL_WALLET_ADDRESS in your environment
Optional
HL_PRIVATE_KEY in your environment
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
Server setup
git clone https://github.com/erscoder/hyperliquid-mcp
cd hyperliquid-mcp
pip install -e .
cp .env.example .envEdit .env with your wallet address or private key
MCP Clients
Claude Desktop — Local build
After the clone and pip install above, add this to claude_desktop_config.json and set cwd to the hyperliquid-mcp folder the clone created. HL_WALLET_ADDRESS alone keeps it read-only; add HL_PRIVATE_KEY to turn on trading.
{
"mcpServers": {
"hyperliquid": {
"command": "python",
"args": [
"-m",
"hyperliquid_mcp"
],
"cwd": "<YOUR_PATH_TO_HYPERLIQUID_MCP>",
"env": {
"HL_WALLET_ADDRESS": "<YOUR_HL_WALLET_ADDRESS>"
}
}
}
}