samimiair

Hyperliquid MCP Server ๐Ÿš€

Community samimiair
Updated

MCP server for Hyperliquid โ€” 48 tools for trading, monitoring, risk management & security

Hyperliquid MCP Server ๐Ÿš€

Model Context Protocol (MCP) server for Hyperliquid โ€” 48 tools for trading, monitoring, risk management, and security on the Hyperliquid perpetual DEX.

Built on the official hyperliquid-python-sdk with production-grade error handling.

Features

๐Ÿ“ก Tier 1 โ€” Monitoring (15 tools)

  • Real-time user state, positions, balances
  • Open orders, trade history, funding history
  • Market data: mid prices, L2 order book, candlesticks
  • Sub-accounts, staking, fee structure

๐Ÿ’น Tier 2 โ€” Trading (10 tools)

  • Limit, market, and trigger orders
  • Bracket orders (entry + TP + SL)
  • Position management: modify, close, leverage
  • Funding rate impact calculator

โš ๏ธ Tier 3 โ€” Risk Management (10 tools)

  • Order risk validation before execution
  • Liquidation price estimation
  • Margin health monitoring
  • Portfolio health check & simulation
  • Auto leverage adjustment

๐Ÿ”’ Tier 4 โ€” Security (8 tools)

  • Wallet & configuration validation
  • Preflight checks before trading
  • API Wallet / Agent Mode setup
  • Trading limits, rate limiting
  • Audit trail & emergency stop

๐Ÿ“Š Bonus Analytics (5 tools)

  • Position analysis with P&L and risk scoring
  • Performance metrics (win rate, Sharpe, drawdown)
  • Multi-coin comparison
  • Strategy backtesting (MA/RSI/Momentum)
  • Market sentiment analysis

Quick Start

1. Install

git clone https://github.com/samimiair/hyperliquid-mcp.git
cd hyperliquid-mcp
pip install -r requirements.txt

2. Configure

cp .env.example .env
# Edit .env with your wallet details:
#   HYPERLIQUID_PRIVATE_KEY=your_64_char_hex_key
#   HYPERLIQUID_ACCOUNT_ADDRESS=0xYourWalletAddress

3. Run

./run.sh

Or run directly with Hermes:

hermes mcp add hyperliquid --command /path/to/hyperliquid-mcp/run.sh
hermes config set mcp_servers.hyperliquid.cwd /path/to/hyperliquid-mcp
hermes config set mcp_servers.hyperliquid.timeout 120

Environment Variables

Variable Required Description
HYPERLIQUID_PRIVATE_KEY โœ… Your wallet private key (64 hex chars)
HYPERLIQUID_ACCOUNT_ADDRESS โœ… Your wallet address (0x...)
HYPERLIQUID_API_WALLET โŒ API wallet for Agent Mode
HYPERLIQUID_TESTNET โŒ Set to "true" for testnet (default: mainnet)

Architecture

hyperliquid-mcp/
โ”œโ”€โ”€ main.py            # MCP server entry point (48 tools)
โ”œโ”€โ”€ api_client.py      # Hyperliquid API wrapper (SDK-based)
โ”œโ”€โ”€ trading.py         # Order placement & management
โ”œโ”€โ”€ monitoring.py      # Market data & state queries
โ”œโ”€โ”€ risk_mgmt.py       # Risk validation & simulation
โ”œโ”€โ”€ security.py        # Wallet & configuration checks
โ”œโ”€โ”€ validators.py      # Input validation
โ”œโ”€โ”€ rate_limiter.py    # API rate limiting
โ”œโ”€โ”€ alert_manager.py   # Error & alert handling
โ”œโ”€โ”€ wallet.py          # (Deprecated) Legacy wallet code
โ”œโ”€โ”€ run.sh             # Startup script with env validation
โ”œโ”€โ”€ .env.example       # Configuration template
โ””โ”€โ”€ requirements.txt   # Dependencies

Security

  • Never commit your .env file โ€” it's in .gitignore
  • All secrets are read from environment variables
  • The run.sh script validates required env vars before starting
  • Use API Wallet / Agent Mode to limit trading permissions
  • Emergency stop tool (emergency_stop) closes all positions instantly

License

MIT

MCP Server ยท Populars

MCP Server ยท New

    DeusData

    codebase-memory-mcp

    High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph โ€” average repo in milliseconds. 159 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

    Community DeusData
    joaoh82

    rustunnel

    Self-hosted, secure tunnel server in Rust. Expose local HTTP/HTTPS/TCP/UDP services to the public internet via TLS-encrypted WebSocket. Open-source, pay-as-you-go managed option, MCP server for AI agents.

    Community joaoh82
    GethosTheWalrus

    Temporal MCP Server

    MCP Server

    Community GethosTheWalrus
    SikamikanikoBG

    ๐Ÿ›ฐ๏ธ HomeLab Monitor

    Plug-and-play homelab dashboard in one container โ€” GPU, local-AI VRAM, Docker, systemd, host health. Built-in read-only MCP server so AI agents can explore it too.

    Community SikamikanikoBG
    w1ckedxt

    Cynical Sally

    Brutally honest senior-engineer code reviews for Claude Code, Cursor & Windsurf - and your terminal. Scores, evidence-backed issues, usable fixes.

    Community w1ckedxt