GearTrade MCP Server
š¤ Model Context Protocol Server for AI-Powered Cryptocurrency Trading
A comprehensive Model Context Protocol (MCP) server that bridges AI assistants with professional cryptocurrency trading capabilities. This server transforms AI conversations by providing real-time market data, sophisticated technical analysis, and intelligent trade execution tools through standardized MCP protocols. Whether you're building trading bots, automated strategies, or AI financial advisors, this server delivers the complete infrastructure needed for data-driven trading decisions across multiple timeframes and asset classes.
š„ Key Features:
š“ 38+ Trading Tools - Complete analysis & execution toolkit
š Real-time Market Data - Live prices, indicators, volume analysis
šÆ Advanced Technical Analysis - RSI, MACD, Fibonacci, Order Book, etc.
š° Risk Management - Position sizing, stop loss, take profit calculations
š Multi-Timeframe Analysis - Daily, 4H, 1H trend alignment
š¤ 23 AI Prompts - Pre-configured trading workflows
š 19 Resources - Comprehensive trading documentation
š Streaming Support - HTTP/SSE for real-time updates
š® Paper Trading - Test strategies without risk
ā” Live Execution - Trade on Hyperliquid (optional)
š Local Development: Run the MCP server locally for full control and privacy
š HTTP Streaming: Remote MCP connection via mcp-remote for Cursor IDE
š Live Deployment: https://geartrade-mcp-server.fajararrizki15.workers.dev/
š What's Included
š 38+ Complete Trading Tools
Price Tools (2): Real-time pricing for single/multiple assets
Technical Analysis (2): 20+ indicators (RSI, EMA, MACD, Bollinger Bands, ATR, ADX, etc.)
Volume Analysis (2): Buy/sell pressure, CVD, liquidity zones analysis
Multi-Timeframe (2): Daily, 4H, 1H trend alignment analysis
Advanced Analysis (3): Fibonacci, Order Book Depth, Liquidation Levels
Market Analysis (8): Volume Profile, Market Structure, Candlestick Patterns, Divergence, Long/Short Ratio, Spot-Futures Divergence, External Data
Risk Management (2): Position sizing, stop loss, take profit calculations
Comprehensive Analysis (2): Complete crypto analysis with position setup
Execution Tools (4): Spot & Futures trading (paper trading + live execution)
Batch Operations (11): Multi-asset analysis for all above tools
š 19 Trading Resources
geartrade://trading-strategies - Comprehensive trading strategies guide
geartrade://risk-management - Risk management best practices
geartrade://tools-overview - Complete tools overview
geartrade://execution-workflow - Analysis to execution workflow
geartrade://technical-indicators-guide - Technical indicators guide
geartrade://hyperliquid-api-reference - Hyperliquid API reference
Plus 13 more specialized guides (volume analysis, fibonacci, orderbook, etc.)
š¤ 23 AI Trading Prompts
Core Trading: analyze_and_execute, multi_asset_scan, comprehensive_analysis
Technical Analysis: technical_indicator_analysis, volume_profile_analysis, market_structure_analysis
Advanced: divergence_scan, liquidation_analysis, fibonacci_trading_strategy, spot_futures_arbitrage
Risk Management: risk_analysis, position_monitoring, portfolio_review, volatility_analysis
Plus 12 more specialized prompts
š Quick Start
ā” Fastest Way - Streaming Mode (Recommended)
# Terminal 1 - Start Streaming Server
bash scripts/start-mcp-stream.sh
# Terminal 2 - Connect Terminal UI
pnpm run terminal
Server runs at http://localhost:8787 with SSE streaming support!
š Full Guide: See QUICKSTART.md and STREAMING_GUIDE.md
Installation:
# Clone the repository
git clone https://github.com/FajarArrizki/ai-trading-mcp-server.git
cd ai-trading-mcp-server
# Install dependencies
pnpm install
# Build the server
pnpm run build
š„ļø Terminal UI (New!)
Interactive terminal interface untuk testing dan development - NO IMPORT ISSUES!
# Quick start
pnpm run terminal:build
pnpm run terminal
Features:
šØ Beautiful UI - Claude Code inspired design
š Zero Import Issues - Pure Node.js, deployment-ready
š ļø Interactive Tools - Execute all 36 MCP tools
š¦ Resource Access - Read all 25 resources
ā
Production Ready - Works everywhere, no bundling issues
Documentation:
Why Terminal UI?
Dibuat khusus untuk mengatasi masalah "pas di deployment ga bisa, karna mengunakan import":
š§ Configure MCP Client
š Quick Start - MCP Integration
Option 1: HTTP Streaming Mode (Recommended)
Start the server:
cd /root/GEARTRADE
bash scripts/mcp-auto-start.sh
Server runs at http://localhost:8787 with SSE streaming support!
Configure Cursor (~/.cursor/mcp.json):
{
"mcpServers": {
"geartrade-local-stream": {
"command": "npx",
"args": [
"mcp-remote",
"http://localhost:8787/mcp"
],
"env": {
"AI_PROVIDER": "openrouter",
"MODEL_ID": "openai/gpt-4-turbo",
"OPENROUTER_API_KEY": "your_openrouter_api_key_here",
"HYPERLIQUID_API_URL": "https://api.hyperliquid.xyz",
"HYPERLIQUID_WALLET_API_KEY": "",
"HYPERLIQUID_ACCOUNT_ADDRESS": "",
"CANDLES_COUNT": "100"
}
}
}
}
Required Environment Variables:
OPENROUTER_API_KEY - Get from OpenRouter (Required for AI analysis)
HYPERLIQUID_API_URL - API endpoint for market data (default provided)
HYPERLIQUID_WALLET_API_KEY - Only for live trading (leave empty for analysis only)
HYPERLIQUID_ACCOUNT_ADDRESS - Only for live trading (leave empty for analysis only)
CANDLES_COUNT - Number of candles for analysis (100 recommended)
Option 2: Direct Execution
Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"geartrade": {
"command": "tsx",
"args": ["/path/to/GEARTRADE/packages/geartrade-mcp-server/src/index.ts"],
"env": {
"AI_PROVIDER": "openrouter",
"MODEL_ID": "openai/gpt-4-turbo",
"OPENROUTER_API_KEY": "your_api_key_here",
"HYPERLIQUID_API_URL": "https://api.hyperliquid.xyz"
}
}
}
}
Cursor (Alternative) (.cursor/mcp.json):
{
"mcpServers": {
"geartrade": {
"command": "node",
"args": [
"--loader",
"tsx",
"/path/to/GEARTRADE/packages/geartrade-mcp-server/src/index.ts"
],
"env": {
"NODE_OPTIONS": "--loader tsx",
"AI_PROVIDER": "openrouter",
"MODEL_ID": "openai/gpt-4-turbo",
"OPENROUTER_API_KEY": "your_api_key_here",
"HYPERLIQUID_API_URL": "https://api.hyperliquid.xyz",
"CANDLES_COUNT": "100"
}
}
}
}
š¦ MCP Capabilities
Tools (38+)
Category | Count | Description |
Price Analysis | 2 | Real-time pricing for single/multiple assets |
Technical Analysis | 2 | 20+ indicators (RSI, EMA, MACD, Bollinger Bands, ATR, ADX) |
Volume Analysis | 2 | Buy/sell pressure, CVD, liquidity zones |
Multi-Timeframe | 2 | Daily, 4H, 1H trend alignment |
Advanced Analysis | 3 | Fibonacci, Order Book Depth, Liquidation Levels |
Market Analysis | 8 | Volume Profile, Market Structure, Candlestick Patterns, Divergence, Long/Short Ratio, Spot-Futures Divergence, External Data |
Risk Management | 2 | Position sizing, stop loss, take profit calculations |
Comprehensive | 2 | Complete crypto analysis with position setup |
Execution | 4 | Paper trading + live execution via Hyperliquid |
Batch Operations | 11+ | Multi-asset versions of all above tools |
Example Tools:
get_price / get_multiple_prices - Real-time crypto prices
get_indicator / get_multiple_indicators - Technical indicators (RSI, MACD, etc.)
get_volume_analysis - Buy/sell pressure, CVD, liquidity zones
get_fibonacci - Fibonacci retracement levels
get_orderbook_depth - Order book support/resistance
analisis_crypto - Comprehensive single-asset analysis
analisis_multiple_crypto - Batch multi-asset analysis
calculate_risk_management - Stop loss, take profit, risk/reward
get_execution_spot / get_execution_futures - Trade execution
Resources (19)
geartrade://trading-strategies - Trading strategies guide
geartrade://risk-management - Risk management guide
geartrade://tools-overview - Complete tools documentation
geartrade://execution-workflow - Step-by-step execution guide
geartrade://technical-indicators-guide - Indicators reference
geartrade://hyperliquid-api-reference - Hyperliquid API docs
geartrade://volume-analysis-guide - Volume analysis guide
geartrade://fibonacci-trading-guide - Fibonacci strategies
Plus 11 more specialized guides
Prompts (23)
Core Trading: analyze_and_execute, multi_asset_scan, comprehensive_analysis
Quick Analysis: quick_price_check, trend_analysis, market_overview
Technical: technical_indicator_analysis, volume_profile_analysis, market_structure_analysis
Advanced: divergence_scan, liquidation_analysis, fibonacci_trading_strategy, spot_futures_arbitrage
Risk: risk_analysis, position_monitoring, portfolio_review, volatility_analysis, entry_exit_strategy
Plus 8 more specialized prompts
šļø Architecture
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā GearTrade MCP Server ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¤
ā ā
ā āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā
ā ā MCP Clients āāāāāŗā MCP Protocol āāāāāŗā
ā ā - Claude ā ā - Tool Execution ā ā
ā ā - Cursor IDE ā ā - Resource Access ā ā
ā ā - Cline IDE ā ā - Prompt Management ā ā
ā āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā
ā ā ā
ā ā¼ ā
ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā ā Core MCP Server āā
ā ā āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā āā
ā ā ā Trading Tools ā ā Resources ā āā
ā ā ā - Price (2) ā ā - Trading State ā āā
ā ā ā - Analysis (2) ā ā - Performance Metrics ā āā
ā ā ā - Volume (2) ā ā - Configuration ā āā
ā ā ā - Advanced (10)ā ā - Documentation ā āā
ā ā ā - Risk (2) ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā āā
ā ā ā - Exec (4) ā āā
ā ā āāāāāāāāāāāāāāāāāāā āā
ā ā āā
ā ā āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā āā
ā ā ā AI Prompts ā ā Security Layer ā āā
ā ā ā - Core Trading ā ā - Multi-User Credentials ā āā
ā ā ā - Technical ā ā - Input Validation (Zod) ā āā
ā ā ā - Risk Mgmt ā ā - Paper Trading Default ā āā
ā ā āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā āā
ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā ā ā
ā ā¼ ā
ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā ā External APIs āā
ā ā āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā āā
ā ā ā Hyperliquid ā ā AI Providers ā āā
ā ā ā - Market Data ā ā - OpenRouter ā āā
ā ā ā - Execution ā ā - OpenAI ā āā
ā ā ā - Account Info ā ā - Custom Models ā āā
ā ā āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā āā
ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Component Details
MCP Protocol Layer
Tool Execution: 38+ trading tools for analysis and execution
Resource Management: 19 comprehensive documentation resources
Prompt System: 23 AI-optimized trading prompts
Security Layer
š Project Structure
ai-trading-mcp-server/
āāā packages/
ā āāā geartrade-mcp-server/ # Main MCP server package
ā āāā src/
ā ā āāā index.ts # MCP server entry (36 tools, 25 resources, 23 prompts)
ā ā āāā signal-generation/ # Trading engine modules
ā ā āāā ai/ # AI integration
ā ā ā āāā call-api.ts # OpenRouter/OpenAI API calls
ā ā ā āāā index.ts
ā ā āāā analysis/ # Market analysis modules
ā ā ā āāā bounce.ts # Bounce detection
ā ā ā āāā btc-correlation.ts # BTC correlation analysis
ā ā ā āāā candlestick.ts # Candlestick patterns
ā ā ā āāā divergence.ts # Divergence detection
ā ā ā āāā market-regime.ts # Market regime detection
ā ā ā āāā market-structure.ts # Market structure analysis
ā ā ā āāā orderbook.ts # Order book analysis
ā ā ā āāā volume-analysis.ts # Volume analysis
ā ā ā āāā volume-profile.ts # Volume profile
ā ā ā āāā whale-detection.ts # Whale activity detection
ā ā ā āāā ... # 20+ analysis modules
ā ā āāā data-fetchers/ # Market data sources
ā ā ā āāā binance.ts # Binance spot data
ā ā ā āāā binance-futures.ts # Binance futures data
ā ā ā āāā blockchain.ts # On-chain data
ā ā ā āāā hyperliquid.ts # Hyperliquid API
ā ā ā āāā market-data.ts # Aggregated market data
ā ā ā āāā historical-data.ts # Historical OHLCV data
ā ā āāā execution/ # Trade execution
ā ā ā āāā paper-executor.ts # Paper trading simulation
ā ā ā āāā live-executor.ts # Live trade execution
ā ā ā āāā hyperliquid-signing.ts # Hyperliquid signing
ā ā ā āāā position-sizer.ts # Position sizing
ā ā āāā technical-indicators/ # Technical analysis
ā ā ā āāā aggregator.ts # Indicator aggregation
ā ā ā āāā fibonacci.ts # Fibonacci levels
ā ā ā āāā funding-rate.ts # Funding rate analysis
ā ā ā āāā liquidation.ts # Liquidation levels
ā ā ā āāā long-short-ratio.ts # Long/short ratio
ā ā ā āāā momentum.ts # RSI, MACD, Stochastic
ā ā ā āāā moving-averages.ts # EMA, SMA, WMA
ā ā ā āāā open-interest.ts # Open interest analysis
ā ā ā āāā spot-futures-divergence.ts # Spot-futures spread
ā ā ā āāā trend.ts # Trend indicators
ā ā ā āāā volatility.ts # ATR, Bollinger Bands
ā ā ā āāā volume.ts # Volume indicators
ā ā āāā risk-management/ # Risk management
ā ā ā āāā anti-liquidation.ts # Liquidation protection
ā ā ā āāā emergency-exit.ts # Emergency exit logic
ā ā ā āāā leverage.ts # Leverage calculation
ā ā ā āāā margin.ts # Margin management
ā ā ā āāā take-profit.ts # Take profit strategies
ā ā ā āāā mae.ts # Max adverse excursion
ā ā āāā types/ # TypeScript types
ā ā ā āāā futures-types.ts # Futures trading types
ā ā ā āāā index.ts # Type exports
ā ā āāā utils/ # Utilities
ā ā ā āāā cache.ts # Data caching
ā ā ā āāā logger.ts # Logging utility
ā ā ā āāā multi-timeframe.ts # MTF utilities
ā ā ā āāā trend-strength.ts # Trend strength calc
ā ā āāā config/ # Configuration
ā ā ā āāā index.ts # Server config
ā ā āāā index.ts # Signal generation exports
ā ā āāā main.ts # Main signal generation
ā āāā dist/ # Compiled JavaScript output
ā ā āāā index.js # Main entry point
ā ā āāā index.d.ts # TypeScript declarations
ā ā āāā signal-generation/ # Compiled modules
ā āāā package.json # Package dependencies
ā āāā tsconfig.json # TypeScript config
ā āāā mcp.local.json # Local MCP configuration
āāā scripts/ # Utility scripts
ā āāā run-mcp-inspector.sh # MCP inspector launcher
ā āāā setup-git-remote.sh # Git remote setup
ā āāā test-signal-generation.js # Signal generation tests
āāā package.json # Workspace root config
āāā pnpm-workspace.yaml # PNPM workspace config
āāā pnpm-lock.yaml # Dependency lock file
āāā mcp.json # MCP configuration
āāā LICENSE # MIT License
āāā README.md # This file
Key Directories
Directory | Description |
src/index.ts
| Main MCP server with 38+ tools, 19 resources, 23 prompts |
local-server.ts
| HTTP/SSE streaming server for remote MCP connections |
signal-generation/analysis/
| 20+ market analysis modules |
signal-generation/technical-indicators/
| 13 technical indicator modules |
signal-generation/data-fetchers/
| Multi-source market data fetchers |
signal-generation/execution/
| Paper & live trade execution |
signal-generation/risk-management/
| Risk management & position sizing |
š ļø Development
# Development mode
pnpm run dev
# Build
pnpm run build
# Validate MCP config
pnpm run validate
# List tools & resources
pnpm run list
š Security & Multi-User Support
Analysis-Only Mode (Recommended for beginners)
Leave wallet credentials empty - all analysis tools work without trading:
{
"HYPERLIQUID_WALLET_API_KEY": "",
"HYPERLIQUID_ACCOUNT_ADDRESS": ""
}
Available without credentials:
ā
All price & market data tools
ā
All technical analysis tools
ā
All volume & advanced analysis
ā
Risk calculations
ā
Paper trading simulation
Real Trading Mode (Advanced users)
Users provide their own credentials via tool parameters OR environment variables:
Via Tool Parameters:
{
"name": "get_execution_futures",
"arguments": {
"ticker": "BTC",
"side": "LONG",
"quantity": 0.1,
"leverage": 10,
"execute": true,
"useLiveExecutor": true,
"accountAddress": "0xUserAddress",
"walletApiKey": "UserPrivateKey"
}
}
Via Environment Variables:
{
"env": {
"HYPERLIQUID_WALLET_API_KEY": "your_private_key",
"HYPERLIQUID_ACCOUNT_ADDRESS": "0xYourAddress"
}
}
Security Features
ā
Multi-user credentials support
ā
Zod schema validation
ā
Paper trading by default
ā
No hardcoded secrets
ā
Analysis-only mode available
ā
Credentials per-tool override
š API Endpoints (HTTP Streaming Mode)
When running bash scripts/start-mcp-stream.sh:
Endpoint | Method | Description |
http://localhost:8787/
| GET | Server info & documentation |
http://localhost:8787/health
| GET | Health check (JSON) |
http://localhost:8787/mcp
| POST | MCP JSON-RPC endpoint |
http://localhost:8787/stream
| GET/POST | SSE streaming endpoint |
Test Commands:
# Health check
curl http://localhost:8787/health
# List all tools
curl -X POST http://localhost:8787/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'
# Get BTC price
curl -X POST http://localhost:8787/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_price","arguments":{"ticker":"BTC"}}}'
š License
MIT
Built for the AI trading community - empowering AI assistants with professional trading capabilities