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