Skip to main content
Glama
Hyperliquid MCP Server

Hyperliquid MCP Server

๐Ÿ”ฎ Hyperliquid MCP Server

Python 3.10+ MCP License: MIT

The first MCP server for DeFi perpetual futures trading. Let AI agents trade on Hyperliquid โ€” the #1 decentralized derivatives exchange ($50B+ weekly volume).

Trade perps, check positions, manage risk โ€” all through natural language via Claude, GPT, or any MCP-compatible AI agent.

โšก Features

Tool

Description

get_account_info

Wallet balance, margin, withdrawable funds

list_markets

All available perpetual futures markets

get_market_info

Price, funding rate, OI, 24h volume

get_orderbook

Live orderbook with configurable depth

get_open_orders

All pending orders

get_positions

Open positions with PnL & liquidation price

place_order

Limit or market orders

cancel_order

Cancel by order ID

set_leverage

Set leverage (cross or isolated)

close_position

Close positions (market or limit)

Related MCP server: hyperliquid-mcp

๐Ÿš€ Quick Start

1. Install

pip install -e .

Or install dependencies directly:

pip install "mcp[server]" hyperliquid-python-sdk python-dotenv

2. Configure

cp .env.example .env

Edit .env:

HYPERLIQUID_PRIVATE_KEY=your_private_key_here
HYPERLIQUID_WALLET_ADDRESS=0xYourAddress
HYPERLIQUID_TESTNET=true

โš ๏ธ Start with testnet! Set HYPERLIQUID_TESTNET=true for paper trading.

3. Run

hyperliquid-mcp
# or
python -m hyperliquid_mcp.server

๐Ÿค– Claude Desktop Configuration

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "hyperliquid": {
      "command": "python",
      "args": ["-m", "hyperliquid_mcp.server"],
      "cwd": "/path/to/hyperliquid-mcp",
      "env": {
        "HYPERLIQUID_PRIVATE_KEY": "your_key",
        "HYPERLIQUID_WALLET_ADDRESS": "0xYourAddress",
        "HYPERLIQUID_TESTNET": "true"
      }
    }
  }
}

Or if installed via pip:

{
  "mcpServers": {
    "hyperliquid": {
      "command": "hyperliquid-mcp",
      "env": {
        "HYPERLIQUID_PRIVATE_KEY": "your_key",
        "HYPERLIQUID_WALLET_ADDRESS": "0xYourAddress",
        "HYPERLIQUID_TESTNET": "true"
      }
    }
  }
}

๐Ÿ’ฌ Example Prompts

Once connected, try asking your AI agent:

  • "What's the current BTC funding rate on Hyperliquid?"

  • "Show me the ETH orderbook, top 5 levels"

  • "Set leverage to 5x on SOL and buy 10 SOL at market"

  • "What are my open positions and total PnL?"

  • "Close my ETH position at market price"

  • "List all available markets and their max leverage"

๐Ÿ”’ Security

  • Never commit your .env file โ€” it contains your private key

  • Start with testnet โ€” always test with paper money first

  • Review orders before confirming โ€” AI agents can make mistakes

  • Private keys are only used locally โ€” never transmitted except to Hyperliquid's API

๐Ÿ“‹ Requirements

  • Python 3.10+

  • A Hyperliquid wallet (testnet or mainnet)

  • An MCP-compatible client (Claude Desktop, etc.)

License

MIT

Available Tools

10 tools
cancel_orderB

Cancel an open order by order ID

Inputs: symbol (required), order_id (required).

close_positionB

Close an open position (market close or limit close)

Inputs: symbol (required), price.

get_account_infoA

Get wallet balance, margin summary, and withdrawable funds

Inputs: no named parameters.

get_market_infoB

Get current price, funding rate, open interest, and 24h volume for a perpetual market

Inputs: symbol (required).

get_open_ordersB

List all open orders for the connected wallet

Inputs: no named parameters.

get_orderbookB

Get the orderbook (bids and asks) for a perpetual market

Inputs: symbol (required), depth.

get_positionsA

List all open positions with unrealized PnL, leverage, and liquidation price

Inputs: no named parameters.

list_marketsA

List all available perpetual futures markets on Hyperliquid

Inputs: no named parameters.

place_orderC

Place a limit or market order on Hyperliquid perps

Inputs: symbol (required), side (required), size (required), price, +2 more.

set_leverageC

Set leverage for a perpetual market

Inputs: symbol (required), leverage (required), is_cross.

Tool Schema Changelog

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

Loading tool schema changelogโ€ฆ

    TDQS

    A3.6/5.0

    Scored across 10 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose in the trading lifecycle. Orders (place, cancel, get_open) are cleanly separated from positions (get, close), and market data tools (list_markets, get_market_info, get_orderbook) serve different information needs without overlap.

    Naming Consistency5/5

    Excellent consistency throughout. All tools use snake_case with clear verb_noun or get_noun patterns (e.g., place_order, get_account_info, list_markets). The verb choices (place, cancel, close, get, list, set) are precise and predictable.

    Tool Count4/5

    Ten tools is a reasonable scope for active trading operations, covering account, market data, orders, and positions. While the count is appropriate, a comprehensive trading surface might additionally include order history or modification tools, making it slightly lean.

    Completeness4/5

    Covers the core trading lifecycle well (account balance, market data, order management, position closing). Minor gaps include order history/fills, the ability to modify existing orders, and funding rate historyโ€”though agents can work around these by canceling/replacing orders and using current market data.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      Not graded
      maintenance
      Enables interaction with the Hyperliquid DEX for retrieving market data, managing positions, and executing trades. Supports both testnet and mainnet operations with comprehensive trading tools including order placement, cancellation, and portfolio management.
      11
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to securely trade on Hyperliquid perpetual exchange, including order placement, position management, market data retrieval, and vault operations via natural language.
      23 PyPI
      24
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables natural language control of Hyperliquid perpetual futures, including querying positions, prices, orderbook, and executing trades like market and limit orders, all from MCP-compatible clients.
      13
      MIT