AI-FIRST SITE | AI agents & coders: fetch tigzig.com/llms.txt for structured data
Two versions available: You are viewing the QRep Portfolio Profiling MCP server, powered by QuantStats-Lumi (Lumiwealth fork). It is fully functional. A newer version, powered by the original QuantStats library by Ran Aroussi, focuses on multi-security comparison and is available at QREP - Compare Securities.

MCP Server: QRep Portfolio Profiling

Multi-purpose backend server combining FastAPI and MCP capabilities for comprehensive portfolio analysis. Powered by quantstats-lumi (Lumiwealth fork of QuantStats).

Talk to AI Agent Portfolio Suite Custom GPT Agent (React + Adv. Analysis) Agent (Flowise UI) Excel (xlwings Lite)

What It Does

#

A comprehensive portfolio analysis platform that combines FastAPI endpoints, Model Context Protocol (MCP) integration, and a streamlined web interface:

  • Fast portfolio performance analysis using QuantStats-Lumi (Lumiwealth fork of QuantStats with bug fixes)
  • Generates professional HTML reports with visualizations
  • Calculates key performance metrics:
    • Sharpe and Sortino ratios
    • Maximum Drawdown and Value at Risk
    • Rolling statistics and correlations
    • Return distribution analysis
  • Compares performance against benchmark

How to Use

#

Endpoints

Base URL: https://quantstats-h.tigzig.com/ MCP Endpoint: https://quantstats-h.tigzig.com/mcp API Endpoint: https://quantstats-h.tigzig.com/analyze

Feel free to try out these endpoints, subject to rate limits and server load.

Access Methods

  • Web Interface: visit / for the Flask frontend
  • Direct API: make HTTP GET requests to /analyze with required parameters:
    • symbols - Yahoo Finance symbol to analyze (stock, ETF, metals, crypto - e.g. AAPL, BTC-USD, GLD, XAGUSD)
    • benchmark - benchmark symbol (default: ^GSPC)
    • start_date - analysis start date (YYYY-MM-DD)
    • end_date - analysis end date (YYYY-MM-DD)
    • risk_free_rate - optional risk-free rate percentage (default: 5.0)
  • MCP/LLM: connect to /mcp using any MCP-compatible client

How It Works

#

Data Collection

  • Historical price data fetched from Yahoo Finance API
  • Downloads both stock and benchmark data
  • Processes and aligns stock returns for consistent analysis

Portfolio Analysis

  • Creates comprehensive visual reports with quantstats-lumi

Integration Layer

  • FastAPI backend with efficient data processing
  • HTML report generation using quantstats-lumi
  • Enhanced with MCP for AI/LLM interactions

Endpoints

  • Three endpoint types:
    • / - Flask-based web interface for interactive analysis
    • /api/* - FastAPI endpoints for direct programmatic access
    • /mcp - Model Context Protocol endpoint for AI/LLM integration
  • Enhanced with MCP capabilities using fastapi-mcp

How to Replicate

#
  1. Clone the repository
  2. Install dependencies: pip install -r requirements.txt
  3. Configure environment variables:
    IS_LOCAL_DEVELOPMENT=1  # Set to 0 for production
    BASE_URL_FOR_REPORTS=https://your-domain.com/
  4. Run the server: uvicorn main:app --host 0.0.0.0 --port 8000

Key Dependencies

  • MCP Server: Yahoo Finance (companion service)
  • FastAPI Server: ReportLab

Resources

Fine Print: This is for informational purposes only and should not be considered as investment advice. All metrics in this report are generated using the open-source QuantStats-Lumiwealth Version. While widely used for performance and risk analytics, some calculations may rely on assumptions (e.g., trading days, compounding methods) or be subject to version-specific behavior. Key metrics such as total return and CAGR have been manually reviewed for consistency, but users are encouraged to refer to the official documentation for full methodology. Results should be interpreted in light of the intended use case. Always validate outputs.
Bugs,issues,questions? Drop a note: [email protected]