AI-FIRST SITE | AI agents & coders: fetch tigzig.com/llms.txt for structured data

MCP Agent - Portfolio Analytics

Comprehensive portfolio analytics agent with QRep (powered by QuantStats) analysis, Technical Analysis, Security Performance Reports, and Yahoo Finance data integration for any symbol.

Chat with Agent

What This App Does

#

QRep Analysis

  • Wrapper over QuantStats-Lumi (Lumiwealth fork with bug fixes)
  • Provides risk-return ratios (CAGR, Sharpe, Sortino) for single symbol vs benchmark
  • Generates professional HTML reports with visualizations

Technical Analysis Reports

  • Live price data with technical indicators using Finta package
  • Advanced charts with Matplotlib and Gemini Vision API analysis
  • PDF and HTML reports with embedded visuals

Security Performance Report (SPR)

  • Multi-symbol portfolio analysis using custom calculations + FFN library
  • Interactive daily returns charts with comprehensive risk metrics
  • Professional HTML reports with CSV exports for detailed analysis

Yahoo Finance Integration

  • Compatible with any Yahoo Finance symbol - stocks, ETFs, metals, cryptocurrencies
  • Historical data retrieval with flexible date ranges

Methodology detail: SPR vs QRep Comparison.

How to Use

#

Ask the AI agent to guide you with these examples:

QRep Analysis

  • Example: "Compare AAPL against QQQ from January 2020 to March 2023"
  • Specify symbol, benchmark (default: ^GSPC), and time range

Technical Analysis

  • Example: "Analyze MSFT with RSI, MACD and Bollinger Bands for the past 6 months"
  • Specify symbol, timeframe, and desired indicators

Security Performance Report

  • Example: "Generate SPR for AAPL,MSFT,GOOG from 2020-01-01 to 2023-12-31"
  • Provide multiple symbols and date range for comprehensive analysis

Yahoo Finance Data

  • Retrieve financial statements, profile information, and historical prices
  • Simply provide Yahoo Finance symbol and specify date range if needed

How It Works

#

1. QRep Analysis

  • Backend QRep MCP server runs Lumiwealth's QuantStats-Lumi fork with bug fixes
  • Agent passes parameters to MCP server for processing
  • Returns formatted HTML report with risk-return metrics

2. Technical Analysis

  • React frontend relays requests to n8n Webhook URL
  • FastAPI Technical Analysis service pulls data from Yahoo Finance API
  • Converts daily to weekly data, computes indicators with Finta
  • Generates charts via Matplotlib, analyzes with Gemini Vision API
  • Returns Markdown responses, converts to PDF/HTML reports

3. Security Performance Report (SPR)

  • Dual methodology: custom calculations for core metrics + FFN library
  • FastAPI backend with MCP integration for AI/LLM interactions
  • Processes multiple symbols with data quality filters
  • Generates HTML reports with matplotlib charts and CSV exports

4. Yahoo Finance Data

  • Dedicated Yahoo Finance MCP-integrated FastAPI server
  • Runs yfinance package for data extraction
  • Handles financial statements, profile info, and historical prices

How to Replicate

#

Follow these steps to deploy your own version:

Frontend

  • Clone the React app
  • Deploy (Vercel, Netlify, etc.) and configure .env with the n8n Webhook URL

Backend Services

  1. QRep MCP Server
  2. Yahoo Finance MCP Server (prices & financials)
  3. Technical Analysis MCP Server
  4. Security Performance Report (SPR) MCP Server
  5. Markdown-to-PDF FastAPI Server for report conversion

Make sure to update the Yahoo Finance API endpoint in the Technical Analysis server configuration.

n8n Configuration

  • Configure agents in n8n by adding MCP clients to connect to the MCP servers for QRep, Technical Analysis, SPR, and Yahoo Finance
  • Set the base URL with a /mcp endpoint for each service

Environment Setup

IS_LOCAL_DEVELOPMENT=1  # Set to 0 for production
BASE_URL_FOR_REPORTS=https://your-domain.com/

Resources

Bugs,issues,questions? Drop a note: [email protected]