MCP Hub
Back to servers

Lean All-in-One

A containerized implementation of the QuantConnect Lean algorithmic trading engine featuring GPU acceleration, a web UI, and MCP integration for AI-driven backtesting and strategy development.

Stars
1
Tools
5
Updated
Jan 3, 2026

English | 简体中文 | 繁體中文 | 日本語

🚀 Lean Engine All-in-One

Docker License GPU

All-in-One Docker image for QuantConnect Lean algorithmic trading engine with GPU support, modern Web UI, REST API, and MCP integration.

✨ Features

  • 🎯 GPU Auto-Selection - Automatically selects GPU with lowest memory usage
  • 🌐 Modern Web UI - Responsive design with dark mode and i18n (EN/ZH/JA)
  • 🔌 REST API - FastAPI with Swagger docs at /docs
  • 🤖 MCP Server - Model Context Protocol for AI integration
  • 📊 Real-time Monitoring - GPU status and backtest progress via WebSocket
  • 🐳 All-in-One - Single container with nginx, API, and MCP services

🚀 Quick Start

docker run -d --gpus all \
  -p 8280:80 -p 8281:8000 -p 8282:8001 \
  --name lean-engine \
  neosun/lean:latest

Access:

📦 Installation

Docker Compose (Recommended)

services:
  lean:
    image: neosun/lean:latest
    container_name: lean-engine
    restart: unless-stopped
    ports:
      - "8280:80"      # Web UI
      - "8281:8000"    # REST API
      - "8282:8001"    # MCP Server
    volumes:
      - ./data:/Lean/Data
      - ./results:/Lean/Results
      - ./algorithms:/Lean/Algorithms
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu]
docker compose up -d

⚙️ Configuration

Environment VariableDefaultDescription
MODEallService mode: ui, api, mcp, all
GPU_AUTO_SELECTtrueAuto-select GPU with lowest memory
API_HOST0.0.0.0API bind address
API_PORT8000API port
MCP_HOST0.0.0.0MCP bind address
MCP_PORT8001MCP port

🔌 API Endpoints

EndpointMethodDescription
/healthGETHealth check
/api/gpu/statusGETGPU status
/api/gpu/selectPOSTSelect GPU
/api/algorithmsGETList algorithms
/api/backtestPOSTRun backtest
/api/jobsGETList jobs
/api/results/{id}GETGet results
/wsWSWebSocket for real-time updates

🤖 MCP Tools

ToolDescription
gpu_statusGet GPU information
gpu_selectSelect specific GPU
list_algorithmsList available algorithms
run_backtestExecute backtest
get_resultsRetrieve backtest results

📁 Project Structure

docker/
├── Dockerfile           # Multi-stage build
├── docker-compose.yml   # Compose configuration
├── nginx.conf           # Reverse proxy config
├── supervisord.conf     # Process manager
├── app/
│   ├── api_server.py    # FastAPI REST API
│   ├── mcp_server.py    # MCP Server
│   ├── gpu_manager.py   # GPU auto-selection
│   └── static/
│       └── index.html   # Web UI
└── .env.example         # Environment template

🛠️ Tech Stack

  • Base: QuantConnect Lean Engine
  • Runtime: Python 3.10+, .NET 6
  • API: FastAPI, Uvicorn
  • GPU: NVIDIA CUDA, pynvml
  • Frontend: Tailwind CSS, Alpine.js
  • Process: Supervisord, Nginx

📝 License

Apache 2.0 - See LICENSE

⭐ Star History

Star History Chart

📱 Follow Us

WeChat

Reviews

No reviews yet

Sign in to write a review