5ce18bb435e3ca6d8e77916072e869dd9e3dcc33
Changed from services.agiliton.internal:8000 to services:8001 to match actual conductor port. Port 8001 is the external mapping for conductor's internal port 8000.
Gridbot MCP Server
Exposes eToroGridbot trading bot operations via Model Context Protocol. Provides monitoring, trading, and analysis tools for the automated trading system.
Requirements
- VPN connection to services network:
vpn-connect - Gridbot conductor running on services VM (http://services:8000)
- Python 3.10+ with uv for development
Configuration
Add to ~/.claude/settings.json under mcpServers:
{
"gridbot": {
"command": "/path/to/gridbot-mcp/.venv/bin/python",
"args": ["-m", "src.server"],
"cwd": "/path/to/gridbot-mcp",
"env": {
"GRIDBOT_API_URL": "http://services:8000"
}
}
}
Tools
Monitoring
health- Check conductor health, queue size, capacityemergency_status- Emergency stop status, circuit breaker, drawdown limitsmarket_hours- Market hours for all exchanges (NYSE, NASDAQ, CRYPTO, FOREX)positions- All portfolio positions with real-time P/Lpending_orders- Pending limit orders with amounts, rates, TP/SLrisk_score- Portfolio risk score and componentsdashboard- Full dashboard (positions, orders, analytics)session_start- Comprehensive session summary (replaces 5-6 individual calls)
Market Data
vix- VIX volatility index and interpretationcrypto_fear_greed- Crypto Fear & Greed index with trading guidance
Trading Operations
validate_trade- Validate trade before execution (checks risk limits)create_order- Create BUY/SELL order with full validationclose_position- Close existing position (full or partial)close_positions_by_filter- Close multiple positions (e.g., all crypto, all losers)cancel_order- Cancel single pending ordercancel_orders_bulk- Cancel multiple orders at oncefind_duplicate_orders- Find duplicate pending ordersemergency_stop- HALT all trading (emergency use only)emergency_reset- Resume trading after emergency stopcleanup_stale_orders- Cleanup stale/expired orders
Signal Intents (Limit Orders)
intents- List signal intents (pending orders awaiting trigger)intents_pending- List pending intents onlyintents_executed- List executed intentsintents_stats- Intent statistics (pending/executed/expired)create_intent- Create signal intent (limit order)create_intents_bulk- Create multiple intents at oncecancel_intent- Cancel pending intent
Scale-Out (Profit Taking)
scale_out_status- Scale-out monitor statusscale_out_pending- Positions pending scale-outscale_out_stats- Scale-out statistics (P/L locked)scale_out_trigger- Manually trigger scale-out for positionscale_out_adjust_threshold- Override threshold for symbolscale_out_get_overrides- Get all threshold overridesscale_out_delete_override- Delete threshold overridescale_out_set_dry_run- Enable/disable dry-run mode
Analysis
trades- Recent trades with P/L detailsanalytics- Trading analytics (win rate, Sharpe ratio)expectancy- Trading expectancy metrics by symbolprofitable_symbols- Profitable symbols ranked by expectancycorrelations- Top correlated asset pairssignal_quality- Signal acceptance rate, rejection reasonstrend_alerts- Active trend change alertsstatistics- Trading statistics summarysupport_resistance- Support/resistance levels for symbol
System
queue_status- Signal processing queue statusbot_health- Trading bot health (Freqtrade, Hummingbot)stale_bots- Bots with no recent signalsmonitoring_stats- System monitoring statsenv_health- Environment health (API keys, credentials)candle_freshness- Candle data staleness checkrate_limiter- Rate limiter statisticsportfolio_allocation- Portfolio allocation breakdownmarket_closure_context- Market closure contextcontainer_logs- Get container logs with grep filtercontainer_restart- Restart a containerpi_consensus_query- Get PI consensus data for symbolpi_consensus_top- Get top PI consensus opportunitiespi_scan_trigger- Trigger manual PI portfolio scan
CLI Wrapper
A command-line wrapper is available at ~/Development/Infrastructure/AgilitonScripts/bin/gridbot:
# Session start (recommended)
gridbot session-start # Comprehensive session summary
# Monitoring
gridbot health # Check system health
gridbot positions # List all positions
gridbot pending # Show pending orders
gridbot risk # Portfolio risk score
gridbot dashboard # Full dashboard
# Market data
gridbot market-hours # Market hours
gridbot vix # Volatility index
gridbot crypto-fear-greed # Fear & Greed index
# Trading validation
gridbot validate BTC BUY 100 # Validate $100 BTC buy
# Analysis
gridbot trades # Recent trades
gridbot analytics # Trading performance
gridbot expectancy # Expectancy by symbol
gridbot profitable # Best performing symbols
gridbot correlations # Correlated pairs
gridbot statistics # Trading statistics
# System
gridbot queue # Queue status
gridbot bot-health # Bot health
gridbot monitoring # System stats
gridbot env-health # Environment check
gridbot candle-freshness # Data freshness
# Emergency
gridbot emergency-stop "reason" # HALT trading
gridbot emergency-reset # Resume trading
gridbot cleanup-orders # Cleanup stale orders
The CLI wrapper provides terminal access to all MCP tools without requiring Claude Code.
Development
# Setup
uv venv
source .venv/bin/activate
uv pip install -r requirements.txt
# Run
python -m src.server
Architecture
- Conductor API: Trading bot coordinator (services:8000)
- Position Management: Real-time P/L tracking with BotPriceProvider
- Risk Management: Portfolio risk scoring, circuit breakers
- Signal Intents: Limit orders with trigger price
- Scale-Out: Automated profit-taking at thresholds
- PI Consensus: Portfolio Intelligence integration
- Market Hours: Dynamic allocation based on market status
Related
- Conductor:
/Users/christian.gick/Development/Apps/eToroGridbot - Dashboard: http://services:5555
- Documentation: ClaudeFramework/docs/gridbot/
Description
Languages
Python
100%