MCP Server: QuantStats Profiling [NEW]
MCP Server for comprehensive portfolio analysis with QuantStats package. Provides Web Reports with KPIs and charts
MCP Server: Quantstats Portfolio Profiling
Multi-purpose backend server combining FastAPI and MCP capabilities for comprehensive portfolio analysis with quantstats-lumi package.
- Talk to AI Agent (NextJS)
- 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:
- Provides fast portfolio performance analysis using QuantStats-Lumi package, a Lumiwealth fork of QuantStats with important 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
- Available Endpoints
- Base URL:
https://quantstats.hosting.tigzig.com/
- MCP Endpoint:
https://quantstats.hosting.tigzig.com/mcp
- API Endpoint:
https://quantstats.hosting.tigzig.com/analyze
- Base URL:
- Access Methods
- Web Interface: Visit
/
for Flask frontend. - Direct API: Make HTTP GET requests to
/analyze
with parameters:symbols
,benchmark
,start_date
,end_date
,risk_free_rate
. - MCP/LLM: Connect to
/mcp
using any MCP-compatible client.
- Web Interface: Visit
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: Exposes three types of endpoints:
/
(Flask UI),/api/*
(FastAPI), and/mcp
(MCP/LLM).
How to Replicate
- Installation Steps: Clone the repository. Install dependencies from
requirements.txt
. Configure environment variables. Run the server with uvicorn. - Key Dependencies: MCP Server - Yahoo Finance, FastAPI Server - ReportLab.
Resources
- MCP Server: QuantStats (GitHub)
- MCP Server: Yahoo Finance
- FastAPI Server: ReportLab (GitHub)
- API Docs: QuantStats Server
- API Docs: Yahoo Finance Server
- API Docs: ReportLab Server
- QuantStats-Lumi Package (GitHub)
- FastAPI-MCP Package (GitHub)
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. Always validate outputs.