
Hyperliquid MCP 服务器 - 通过模型上下文协议实现的超流动交易接口
概览
一个用于超流动永续交易的模型上下文协议(MCP)服务器,使用官方 Python SDK 进行。该服务器为 AI 助手提供安全、可靠的超流动交易平台访问。 ✅ - 基于官方Hyperliquid Python SDK构建,并有正确签名 ✅ - 所有交易端点:订单、头寸、市场数据、金库 ✅ - 正确签署EIP-712并支持✅代理模式 - Atomic Entry + TP + SL订单下放 ✅ - 实时价格、订单簿、资金利率、K线 ✅ - 头寸、余额、填充、资金历史 ✅ - 上线前安全测试策略 - Python 3.10或更高版本 - 用于包管理的uv或uvx- 带有存入资金的超流动账户 如果你是本地运行源代码,请使用以下配置: 将 /path/to/hyperliquid-mcp 替换为通往你克隆仓库的实际路径。 您的钱包必须在Hyperliquid注册后才能交易。 1. 前往https://app.hyperliquid.xyz 2.连接你的钱包 3.
概述(AI 翻译)
一个用于超流动永续交易的模型上下文协议(MCP)服务器,使用官方 Python SDK 进行。该服务器为 AI 助手提供安全、可靠的超流动交易平台访问。
特色
✅ 官方SDK——基于官方Hyperliquid Python SDK并进行正确签名 ✅ 全面覆盖 - 所有交易端点:订单、头寸、市场数据、金库 ✅ 安全 - 支持代理模式的正确EIP-712签名 ✅ 括号顺序 - 原子输入 + TP + SL 排序 ✅ 市场数据 - 实时价格、订单簿、资金利率、蜡烛 ✅ 账户管理 - 头寸、余额、填充、资金历史 ✅ Testnet支持——上线前安全测试策略
先修条件
- Python 3.10 或更高版本
- 用于包管理的UV或UVX
- 带有存款资金的超流动账户
安装
使用 UVX(推荐)
使用 pip
地方发展
本地开发配置
如果你是本地运行源代码,请使用以下配置:
将/path/to/hyperliquid-mcp替换为通往你克隆仓库的实际路径。
配置
1.在Hyperliquid注册你的钱包
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Hyperliquid MCP Server
A Model Context Protocol (MCP) server for Hyperliquid perpetual trading using the official Python SDK. This server provides AI assistants with secure, reliable access to Hyperliquid’s trading platform.
Features
✅ Official SDK - Built on the official Hyperliquid Python SDK with proper signing
✅ Complete Coverage - All trading endpoints: orders, positions, market data, vaults
✅ Secure - Proper EIP-712 signing with agent mode support
✅ Bracket Orders - Atomic entry + TP + SL order placement
✅ Market Data - Real-time prices, order books, funding rates, candles
✅ Account Management - Positions, balances, fills, funding history
✅ Testnet Support - Test strategies safely before going live
Prerequisites
Installation
Using uvx (Recommended)
# Install and run directly from PyPI
uvx --from mcp-hyperliquid hyperliquid-mcp
Using pip
# Install with pip
pip install mcp-hyperliquid
# Run
mcp-hyperliquid
Local Development
# Clone and install from source
git clone https://github.com/edkdev/hyperliquid-mcp.git
cd hyperliquid-mcp
uv sync
# Run locally
uv run python -m hyperliquid_mcp.server
Local Development Configuration
If you’re running from source code locally, use this configuration:
{
"mcpServers": {
"hyperliquid": {
"command": "uv",
"args": [
"--directory",
"/path/to/hyperliquid-mcp",
"run",
"python",
"-m",
"hyperliquid_mcp.server"
],
"env": {
"HYPERLIQUID_PRIVATE_KEY": "0x1234567890abcdef...",
"HYPERLIQUID_TESTNET": "false"
}
}
}
}
Replace /path/to/hyperliquid-mcp with the actual path to your cloned repository.
Configuration
1. Register Your Wallet on Hyperliquid
IMPORTANT: Your wallet must be registered on Hyperliquid before trading.
Mainnet:
- Go to https://app.hyperliquid.xyz
- Connect your wallet
- Deposit funds from Arbitrum One (any amount registers your wallet)
Testnet:
- Go to https://app.hyperliquid-testnet.xyz
- Connect your wallet
- Get testnet funds from the faucet or bridge
2. Configure Your MCP Client
Environment variables are now configured directly in your MCP client settings (no .env file needed).
Claude Desktop / Kiro
Add to your mcp.json configuration file:
{
"mcpServers": {
"hyperliquid": {
"command": "uvx",
"args": ["--from", "mcp-hyperliquid", "hyperliquid-mcp"],
"env": {
"HYPERLIQUID_PRIVATE_KEY": "0x1234567890abcdef...",
"HYPERLIQUID_TESTNET": "false"
}
}
}
}
Required Environment Variables:
HYPERLIQUID_PRIVATE_KEY- Your wallet’s private key for signing transactions
安装
uvx --from mcp-hyperliquid hyperliquid-mcp配置
{
"mcpServers": {
"hyperliquid": {
"command": "uv",
"args": [
"--directory",
"/path/to/hyperliquid-mcp",
"run",
"python",
"-m",
"hyperliquid_mcp.server"
],
"env": {
"HYPERLIQUID_PRIVATE_KEY": "0x1234567890abcdef...",
"HYPERLIQUID_TESTNET": "false"
}
}
}
}