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

MCP Server: QREP - Compare Securities

FastAPI backend with MCP endpoint for comparing up to 6 securities against a benchmark. Returns 81 QuantStats metrics per symbol.

Powered by QuantStats (the portfolio analytics library created by Ran Aroussi, also the creator of yfinance).
QREP App GitHub Repo

What This Server Does

#

MCP Endpoint: Compare Securities

  • Compare up to 6 symbols against a benchmark (default: SPY)
  • Returns 81 QuantStats metrics per symbol including CAGR, Sharpe, Sortino, Max Drawdown
  • Lightweight JSON response designed for LLM/MCP consumption
  • No API key required on the MCP endpoint

API Endpoints (Key Protected)

  • Single symbol analysis with full HTML report generation
  • Multi-symbol comparison with charts and CSV exports
  • Portfolio analysis with weighted allocations

Data Source

  • Yahoo Finance via yfinance - stocks, ETFs, metals, crypto
  • Flexible date ranges with configurable risk-free rate

MCP Configuration

#

Server URL

https://qrep-api.tigzig.com/mcp

SSE transport. Connect any MCP client (Claude Desktop, n8n, Cursor) to this URL.

Available Tool

mcp_compare_securities

Compare securities against a benchmark with 81 QuantStats metrics each.

Parameters

symbols:         "AAPL,MSFT,GOOG"   (comma-separated, max 6)
benchmark:       "SPY"               (default)
start_date:      "2020-01-01"        (YYYY-MM-DD)
end_date:        "2025-12-31"        (YYYY-MM-DD)
risk_free_rate:  0.045               (decimal, optional)

Example Prompt

"Compare AAPL, MSFT and GOOG against SPY from 2020-01-01 to 2025-12-31"

How It Works

#
  • Built with FastAPI + fastapi-mcp package which exposes FastAPI endpoints as MCP tools
  • MCP endpoint is a GET at /mcp/compare - no API key needed
  • Uses the original ranaroussi/quantstats library for metric computation
  • Pulls price data from Yahoo Finance via yfinance
  • Rate limited (20/min per IP, 100/min global) with per-IP concurrency controls
  • Deployed on Coolify (Hetzner) with Cloudflare WAF and JS Challenge

How to Replicate

#

Clone the repo and deploy:

  1. Clone github.com/amararun/qrep-backend-fastapi
  2. Install dependencies: pip install -r requirements.txt
  3. Set environment variables (see .env.example in repo)
  4. Run: uvicorn main:app --host 0.0.0.0 --port 8000
  5. MCP endpoint available at http://localhost:8000/mcp

Key Environment Variables

QPULSE_API_KEY=your-key      # for /qpulse/* endpoints
BASE_URL=https://your-domain.com
RATE_LIMIT=20/minute

Resources

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