Alpha Arena MCP
Enables AI agents to interact with Hyperliquid perpetual futures exchange for market analysis, account management, and risk-managed trading.
README
Alpha Arena MCP
An MCP server that delivers hyperliquid account data, perpetuals market context, and trading tools for AI agents — inspired by nof1.ai and open-nof1.ai.
Overview
Alpha Arena MCP bridges AI models with the Hyperliquid perpetual futures exchange, allowing LLMs to:
- Analyze real-time market data (prices, indicators, open interest).
- Fetch and format account positions and performance.
- Execute trades with risk-managed orders (including auto-calculated take-profit/stop-loss).
- Close positions or cancel orders programmatically.
Designed for algorithmic trading bots, this server supports both mainnet and testnet operations. It uses the CCXT library for exchange interactions and pandas_ta for technical analysis.
Key Use Case: Integrate with Claude Desktop or similar MCP clients to create an AI trading assistant that generates recommendations based on prompts and executes them via tools.
Features
-
Trading Tools:
- Place limit/market orders with leverage, TP/SL (auto-calculated if omitted).
- Close all positions for a symbol (reduce-only market orders).
- Cancel all open orders for a symbol.
- Retrieve formatted account info (balance, positions, PnL).
- Get formatted market state (OHLCV, EMAs, MACD, RSI, volume, OI, funding rate).
-
MCP Prompts:
- System prompt for expert crypto analysis.
- User prompt template incorporating market/account data for LLM invocations.
-
Exchange Support: Hyperliquid perpetuals (sandbox/testnet configurable).
-
Risk Management: Built-in TP/SL calculation based on leverage (2:1 reward:risk ratio).
-
Error Handling: Graceful fallbacks for API errors.
Prerequisites
- Python 3.10+
- uv for dependency management (recommended; fallback to pip)
- A Hyperliquid account with API credentials (wallet address and private key).
Installation
-
Clone the Repository:
git clone https://github.com/kukapay/alpha-arena-mcp.git cd alpha-arena-mcp -
Install dependencies with uv:
uv sync -
Install to Claude Desktop:
Install the server as a Claude Desktop application:
uv run mcp install main.py --name "Alpha Arena"Configuration file as a reference:
{ "mcpServers": { "Alpha Arena": { "command": "uv", "args": [ "--directory", "/path/to/alpha-arena-mcp", "run", "main.py" ], "env": { "MAIN_ACCOUNT_ADDRESS": "your_main_account_address", "API_ACCOUNT_PRIVATE_KEY": "your_api_account_private_key", "NETWORK": "testnet" /* testnet | main */ } } } }Replace /path/to/alpha-arena-mcp with your actual installation path, and update your_main_account_address and your_ai_account_private_key with your own account details.
Usage
Example Workflow
-
Set Up Analysis (via Prompt):
- Use
nof1_system_prompt()to load the expert trader persona.
- Use
-
Generate Recommendation (via Prompt + Data):
- Use
nof1_user_prompt("BTC/USDC:USDC")→ Injects market/account data into the user prompt for LLM analysis.
- Use
-
Execute Trade (via Tool):
place_order(symbol="BTC/USDC:USDC", side="buy", size=0.01, leverage=10)→ Places order with auto-TP/SL.
-
Manage Position:
close_position("BTC/USDC:USDC")→ Closes all positions.cancel_open_orders("BTC/USDC:USDC")→ Cancels pending orders.
Available Tools
place_order
Places a limit/market order with optional TP/SL. Auto-calculates TP/SL if not provided based on leverage (2:1 reward:risk).
Parameters:
symbol(str): Trading pair, e.g., "BTC/USDC:USDC".side(str: buy/sell): Order direction.size(float): Order size (quantity).price(float, optional): Limit price (defaults to current market price).leverage(float=10): Leverage multiplier.tp_price/sl_price(float, optional): Take-profit/stop-loss prices.
Returns: Dict: Order IDs or error.
Usage Example
Prompt:
Buy 0.01 BTC with 10x leverage on Hyperliquid, using market price.
Response:
{
"status": "success",
"result": {
"main_order_id": "abc123",
"tp_order_id": "def456",
"sl_order_id": "ghi789",
"status": "success"
}
}
close_position
Closes all positions for a symbol using reduce-only market orders.
Parameters:
symbol(str): Trading pair, e.g., "BTC/USDC:USDC".
Returns: Dict: Close orders or no-action message.
Usage Example
Prompt:
Close my entire BTC position now.
Response:
{
"close_orders": [
{
"order_id": "jkl012",
"side": "sell",
"size": 0.01,
"status": "closed"
}
],
"status": "success"
}
cancel_open_orders
Cancels all open orders for a symbol.
Parameters:
symbol(str): Trading pair, e.g., "ETH/USDC:USDC".
Returns: Dict: Canceled orders or no-action message.
Usage Example
Prompt:
Cancel all my pending orders for ETH.
Response:
{
"canceled_orders": [
{
"id": "mno345",
"status": "canceled"
},
{
"id": "pqr678",
"status": "canceled"
}
],
"status": "success"
}
account_info
Fetches and formats account balance, positions, and performance summary.
Parameters: None.
Returns: str: Formatted account summary.
Usage Example
Prompt:
What's my current account status?
Response:
Current Total Return (percent): 2.5%
Available Cash: 1500.0
Current Account Value: 1525.0
Positions: {"symbol": "BTC/USDC:USDC", "quantity": 0.01, "unrealized_pnl": 25.0, ...}
market_state
Fetches and formats market data, including technical indicators, volume, open interest, and funding rate.
Parameters:
symbol(str): Trading pair, e.g., "SOL/USDC:USDC".
Returns: str: Formatted market state.
Usage Example
Prompt:
Give me the latest market data for SOL.
Response:
Current Market State:
current_price = 150.25, current_ema20 = 148.50, current_macd = 1.20, current_rsi (7 period) = 65.3
Open Interest: Latest: 100000.0 Average: 100000.0
Funding Rate: 0.0001
Intraday series (by minute, oldest → latest):
Mid prices: [145.0, 146.2, ...]
...
Available Prompts
nof1_system_prompt
Expert crypto analyst system prompt.
Parameters: None
Returns: str: System message.
Example:
You are an expert cryptocurrency analyst and trader with deep knowledge of blockchain technology, market dynamics, and technical analysis.
Your role is to:
- Analyze cryptocurrency market data, including price movements, trading volumes, and market sentiment
- Evaluate technical indicators such as RSI, MACD, moving averages, and support/resistance levels
- Consider fundamental factors like project developments, adoption rates, regulatory news, and market trends
- Assess risk factors and market volatility specific to cryptocurrency markets
- Provide clear trading recommendations (BUY, SELL, or HOLD) with detailed reasoning
- Suggest entry and exit points, stop-loss levels, and position sizing when appropriate
- Stay objective and data-driven in your analysis
[... full prompt continues ...]
Today is November 01, 2025.
nof1_user_prompt
Data-enriched user prompt for analysis.
Parameters: symbol (str)
Returns: str: Prompt with market/account data.
It has been 45 minutes since you started trading. The current time is 2025-11-01T10:30:00 and you've been invoked 3 times. Below, we are providing you with a variety of state data, price data, and predictive signals so you can discover alpha. Below that is your current account information, value, performance, positions, etc.
ALL OF THE PRICE OR SIGNAL DATA BELOW IS ORDERED: OLDEST → NEWEST
Timeframes note: Unless stated otherwise in a section title, intraday series are provided at 3-minute intervals. If a coin uses a different interval, it is explicitly stated in that coin's section.
# HERE IS THE CURRENT MARKET STATE
## ALL SOL DATA FOR YOU TO ANALYZE
Current Market State:
current_price = 150.25, current_ema20 = 148.50, current_macd = 1.20, current_rsi (7 period) = 65.3
[... full formatted market data ...]
----------------------------------------------------------
## HERE IS YOUR ACCOUNT INFORMATION & PERFORMANCE
Current Total Return (percent): 2.5%
Available Cash: 1500.0
Current Account Value: 1525.0
Positions: {"symbol": "BTC/USDC:USDC", "quantity": 0.01, ...}
License
MIT License. See LICENSE for details.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。