home / mcp / hyperliquid mcp server

Hyperliquid MCP Server

🚀 MCP Server para Hyperliquid DEX - Trade com Claude usando linguagem natural. Desenvolvido por Caio Vicentino para as comunidades Yield Hacker, Renda Cripto e Cultura Builder

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "caiovicentino-hyperliquid-mcp-server": {
      "command": "mcp",
      "args": [
        "dev",
        "server.py"
      ],
      "env": {
        "LOG_LEVEL": "INFO",
        "WS_TIMEOUT": "60",
        "HTTP_TIMEOUT": "30",
        "RATE_LIMIT_WEIGHT": "1200",
        "HYPERLIQUID_WS_URL": "wss://api.hyperliquid.xyz/ws",
        "HYPERLIQUID_API_URL": "https://api.hyperliquid.xyz",
        "HYPERLIQUID_NETWORK": "mainnet",
        "HYPERLIQUID_PRIVATE_KEY": "YOUR_PRIVATE_KEY_PLACEHOLDER",
        "HYPERLIQUID_ACCOUNT_ADDRESS": "YOUR_ACCOUNT_ADDRESS_PLACEHOLDER"
      }
    }
  }
}

The Hyperliquid MCP Server is a Python-based MCP server that lets you connect Claude Desktop to the Hyperliquid decentralized exchange. You can trade with natural language, analyze markets in real time, automate strategies, and retain full control of your keys and funds through a secure MCP setup.

How to use

Set up the MCP server and run it locally to enable Claude Desktop to interact with Hyperliquid. You will issue natural-language requests to trade, monitor markets, and manage your positions, while the MCP layer translates those requests into authenticated actions against Hyperliquid.

How to install

Prerequisites you need before installing: Python 3.8+ installed on your system, Claude Desktop installed and configured, and a Hyperliquid account with API credentials. This guide uses the official installation flow demonstrated here.

1. Clone the MCP server repository and enter the directory.

git clone https://github.com/seu-usuario/hyperliquid-mcp-server.git
cd hyperliquid-mcp-server

2. Run the automatic setup script to create a Python virtual environment, install dependencies, generate configuration, and guide credential setup.

python3 setup.py

3. Edit the generated .env file to add your Hyperliquid credentials and network information.

HYPERLIQUID_PRIVATE_KEY=0x...
HYPERLIQUID_ACCOUNT_ADDRESS=0x...
HYPERLIQUID_NETWORK=mainnet

4. Restart Claude Desktop to apply the MCP configuration you created during setup.

5. Verify the server is ready by asking Claude what Hyperliquid tools are available.

Optional manual path to start the MCP server is shown in the testing steps if you prefer manual control.

Additional sections

Configuration and credentials: The server relies on environment variables defined in a .env file to securely store your private key, account address, and network. Keep this file local and do not commit it to version control.

Security best practices: Use testnet for experimentation, rotate credentials periodically, and prefer isolated margin when trading high-risk strategies. Never expose your private key and consider hardware wallets for added security.

Starting the server from the MCP CLI during testing: you will use the MCP command to start the local server script in dev mode.

If you encounter issues, consult troubleshooting steps for common problems like authentication failures, rate limits, and WebSocket connectivity.

Available tools

place_order

Place a limit or market order for a trading instrument.

place_batch_orders

Submit multiple orders in a single batch.

cancel_order

Cancel a specific order by ID.

cancel_all_orders

Cancel all open orders for a symbol or account.

modify_order

Modify the price or size of an existing order.

place_twap_order

Place a TWAP order to execute a large amount over time.

adjust_leverage

Adjust leverage for cross or isolated margin.

modify_isolated_margin

Manage isolated margin for supported positions.

update_dead_mans_switch

Configure automatic safety for inactive connections.

get_user_state

Retrieve the complete state of your account.

get_positions

Fetch all open positions with PnL.

get_open_orders

List all currently open orders.

get_user_fills

Access trade history for the user.

get_historical_orders

Access historical order data.

get_portfolio_value

Analyze the full value of the portfolio.

get_subaccounts

Manage subaccounts under the main account.

get_rate_limit_status

Check current API rate limit status.

get_all_mids

Fetch mid prices for all trading pairs.

get_l2_orderbook

Retrieve real-time L2 order book data.

get_candles

Get historical OHLCV candles for a symbol.

get_recent_trades

Fetch recent trades.

get_funding_rates

Get current funding rates for perpetuals.

get_asset_contexts

Retrieve market context and statistics.

subscribe_user_events

Subscribe to account-related events.

subscribe_market_data

Subscribe to live market data.

subscribe_order_updates

Subscribe to updates for orders.

get_active_subscriptions

Manage active subscriptions.