Hyperliquid MCP
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Hyperliquid MCP What's my BTC PnL?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
๐ข Hyperliquid MCP
Control your Hyperliquid perps from Claude (or any MCP client) using natural language.
"What's my BTC PnL?" โ Claude fetches your positions and answers in seconds.
"Buy 0.1 ETH at market" โ Claude places the order via Hyperliquid API.
Built with the Model Context Protocol โ the open standard for connecting AI to external tools.
โจ Features
Tool | Description |
| Prices for all assets |
| L2 bids/asks for any asset |
| Market info (leverage, tick size) |
| OHLCV history (1m โ 1d) |
| Positions, equity, margin, PnL |
| Active orders |
| Trade history |
| Trade history filtered by coin, with win rate & PnL |
| Funding rate history |
| Predicted next-8h funding across venues |
| Mark, oracle, funding, OI, 24h change for BTC/ETH/XRP/SOL |
| Live tape with buy/sell imbalance |
| Place limit or market orders |
| Cancel specific order |
| Cancel all orders (optional: by coin) |
| Close entire position |
| Set leverage (cross or isolated) |
Related MCP server: hyperliquid-mcp
๐ Quick Start
1. Install
pip install hyperliquid-mcpOr run directly without installing:
uvx hyperliquid-mcp2. Configure Claude Desktop
Open ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows) and add:
Read-only mode (positions, prices, history โ no private key needed):
{
"mcpServers": {
"hyperliquid": {
"command": "uvx",
"args": ["hyperliquid-mcp"],
"env": {
"HL_WALLET_ADDRESS": "0xYourWalletAddressHere"
}
}
}
}Trading mode (place orders, cancel, close positions):
{
"mcpServers": {
"hyperliquid": {
"command": "uvx",
"args": ["hyperliquid-mcp"],
"env": {
"HL_PRIVATE_KEY": "0xYourPrivateKeyHere"
}
}
}
}โ ๏ธ Never share your private key. It stays on your machine โ this server runs locally via stdio, no data is sent anywhere except Hyperliquid's official API.
3. Restart Claude Desktop and start chatting
What are my open positions?
What's the ETH funding rate this week?
Place a limit order to buy 0.5 SOL at $150๐ง Manual Setup (from source)
git clone https://github.com/erscoder/hyperliquid-mcp
cd hyperliquid-mcp
pip install -e .
cp .env.example .env
# Edit .env with your wallet address or private keyThen in claude_desktop_config.json:
{
"mcpServers": {
"hyperliquid": {
"command": "python",
"args": ["-m", "hyperliquid_mcp"],
"cwd": "/path/to/hyperliquid-mcp",
"env": {
"HL_WALLET_ADDRESS": "0xYourWalletAddressHere"
}
}
}
}๐ Security
Your keys never leave your machine. The server runs locally via stdio transport.
Read-only by default. Set only
HL_WALLET_ADDRESSif you don't want trading enabled.Trading requires
HL_PRIVATE_KEY. Without it, all trading tools return an error.Use a dedicated trading wallet with limited funds for extra safety.
๐ค Use in AI Agents
MCP is not just for chat clients. Use hyperliquid-mcp as the trading layer inside any autonomous agent.
LangChain / LangGraph
from langchain_mcp_adapters.client import MultiServerMCPClient
client = MultiServerMCPClient({
"hyperliquid": {
"command": "uvx",
"args": ["hyperliquid-mcp"],
"transport": "stdio",
"env": {"HL_WALLET_ADDRESS": "0xYourWallet"}
}
})
tools = await client.get_tools()
# tools now includes hl_get_user_state, hl_get_orderbook, etc.
# Pass them to any LangChain agent or LangGraph nodeCrewAI
from crewai import Agent
from crewai_tools import MCPTool
hl_tools = MCPTool.from_server(
command="uvx",
args=["hyperliquid-mcp"],
env={"HL_WALLET_ADDRESS": "0xYourWallet"}
)
trader = Agent(
role="Trading Analyst",
goal="Monitor Hyperliquid positions and funding rates",
tools=hl_tools
)Custom agent (MCP Python SDK)
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client
server_params = StdioServerParameters(
command="uvx",
args=["hyperliquid-mcp"],
env={"HL_WALLET_ADDRESS": "0xYourWallet"}
)
async with stdio_client(server_params) as (read, write):
async with ClientSession(read, write) as session:
await session.initialize()
result = await session.call_tool("hl_get_user_state", {})
print(result.content)Agent ideas:
Portfolio monitor that alerts when funding rates spike above threshold
Risk manager that auto-closes positions when drawdown exceeds limit
Arbitrage scanner comparing funding across assets
Morning briefing agent that summarizes overnight PnL and open positions
๐ฌ Other MCP Clients
Works with any MCP-compatible client:
Claude Desktop โ see Quick Start above
VS Code (Copilot) โ add to
.vscode/mcp.jsonCursor โ add to MCP settings
Continue.dev โ add to config
๐ License
MIT โ free to use, fork, and contribute.
๐ Star History
If this saved you time, a โญ goes a long way!
Available Tools
13 toolshl_cancel_all_ordersA
Cancel all open orders, optionally filtered by coin. Requires HL_PRIVATE_KEY in env.
Args: coin: Optional asset symbol to filter (None cancels all)
Inputs: coin. Returns: result
hl_cancel_orderA
Cancel a specific order by order ID. Requires HL_PRIVATE_KEY in env.
Args: coin: Asset symbol e.g. BTC oid: Order ID to cancel
Inputs: coin (required), oid (required). Returns: result
hl_close_positionA
Close the entire position for a specific asset using a market order. Requires HL_PRIVATE_KEY in env.
Args: coin: Asset symbol e.g. BTC, ETH
Inputs: coin (required). Returns: result
hl_get_all_midsA
Get mid prices for all assets on Hyperliquid.
Inputs: no named parameters. Returns: result
hl_get_candlesB
Get OHLCV candles for a specific asset.
Args: coin: Asset symbol e.g. BTC, ETH, SOL interval: 1m, 5m, 15m, 30m, 1h, 4h, 8h, 1d (default 1h) limit: Number of candles to return (default 50)
Inputs: coin (required), interval, limit. Returns: result
hl_get_fillsA
Get your recent trade history (fills). Requires HL_WALLET_ADDRESS or HL_PRIVATE_KEY in env.
Args: limit: Number of recent trades to return (default 50)
Inputs: limit. Returns: result
hl_get_funding_historyB
Get funding rate history for a specific asset.
Args: coin: Asset symbol e.g. BTC, ETH, SOL days: Number of days of history (default 7)
Inputs: coin (required), days. Returns: result
hl_get_metaA
Get metadata for all markets: max leverage, tick size, lot size.
Inputs: no named parameters. Returns: result
hl_get_open_ordersA
Get all your open orders on Hyperliquid. Requires HL_WALLET_ADDRESS or HL_PRIVATE_KEY in env.
Inputs: no named parameters. Returns: result
hl_get_orderbookA
Get L2 orderbook (bids/asks) for a specific asset.
Args: coin: Asset symbol e.g. BTC, ETH, SOL depth: Number of price levels to return (default 10)
Inputs: coin (required), depth. Returns: result
hl_get_user_stateA
Get your Hyperliquid account: positions, equity, margin, unrealized PnL. Requires HL_WALLET_ADDRESS (read-only) or HL_PRIVATE_KEY (trading) in env.
Inputs: no named parameters. Returns: result
hl_place_orderA
Place an order on Hyperliquid. Requires HL_PRIVATE_KEY in env.
Args: coin: Asset symbol e.g. BTC, ETH, SOL is_buy: True for long/buy, False for short/sell size: Position size in coins price: Limit price (None for market order) order_type: limit or market (default limit) reduce_only: Only reduce existing position (default False)
Inputs: coin (required), is_buy (required), size (required), price, +2 more. Returns: result
hl_set_leverageA
Set leverage for a specific asset. Requires HL_PRIVATE_KEY in env.
Args: coin: Asset symbol e.g. BTC, ETH leverage: Leverage multiplier e.g. 5, 10, 20 is_cross: True for cross margin, False for isolated (default True)
Inputs: coin (required), leverage (required), is_cross. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
TDQS
Scored across 13 tools
Every tool has a clearly distinct purpose: order management, position control, data queries, leverage setting. No two tools overlap in functionality.
All tools follow the 'hl_' prefix with consistent verb_noun snake_case pattern (e.g., cancel_order, place_order, get_all_mids). Predictable and uniform.
13 tools is well-scoped for a trading platform, covering essential operations without being excessive or sparse.
Core trading workflow (order placement, cancellation, position closing, market data, account info) is covered. Lacks order modification and detailed trade history, but no critical gaps.
Maintenance
Related MCP Connectors
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
Trade Hyperliquid perpetual futures from your Ask Gina wallet. Moves real funds.
Hyperliquid MCP โ read-only market data from Hyperliquid's public info API.
Build, backtest and paper-run Hyperliquid strategies from your AI assistant.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to securely trade on Hyperliquid perpetual exchange, including order placement, position management, market data retrieval, and vault operations via natural language.23 PyPI24MIT
- AlicenseBqualityDmaintenanceIntegrates with Hyperliquid DEX to enable trading, account management, and market data queries through natural language.1220 npm3MIT
- AlicenseAqualityDmaintenanceEnables AI agents to interact with Hyperliquid perpetual futures exchange for market analysis, account management, and risk-managed trading.51MIT
- AlicenseNot gradedqualityDmaintenanceEnables natural language trading of Hyperliquid perpetual futures, including portfolio checks, market data, order placement with confirmation, and position management.MIT