Overview
https://qrep-api.tigzig.com/mcp/compare and via the MCP server below. This API is listed in the machine-readable catalog at api.tigzig.com/.well-known/api-catalog (RFC 9727); OpenAPI 3.1 at /openapi.json.QREP compares up to 6 securities against a benchmark (default SPY) and returns 81 QuantStats metrics per symbol - CAGR, Sharpe, Sortino, Max Drawdown, volatility and more. Powered by the original QuantStats library by Ran Aroussi. Same engine behind the QREP app.
Two access shapes over the same backend:
- MCP (open) - the compare tool at
/mcp/compareand the MCP transports below need no API key. Built for AI agent clients. - REST + Swagger - the
/qpulse/*endpoints (single-symbol analysis, multi-symbol compare, portfolio, HTML report + CSV export) are API-key protected for heavier report generation.
Two QuantStats versions exist: this is the newer one on the original ranaroussi/quantstats. The older QRep Portfolio Profiling server runs the QuantStats-Lumi fork.
MCP Server (for AI agents)
Connect an AI agent (Claude.ai, Cursor, n8n, custom clients) and let it compare securities directly. No auth. Three transports:
https://qrep-api.tigzig.com/v1/mcp/http- Streamable HTTP (recommended; MCP spec 2025-03-26).https://qrep-api.tigzig.com/v1/mcp/sse- SSE (legacy fallback).https://qrep-api.tigzig.com/mcp- original SSE endpoint, kept for back-compat.
Tool: mcp_compare_securities - compare up to 6 symbols against a benchmark, 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."
Add to Claude.ai: Settings -> Connectors -> Add custom connector -> paste the Streamable HTTP URL (fall back to SSE if needed) -> approve. The same URLs work for Cursor, n8n, and any MCP client.
How it works
- FastAPI backend + the
fastapi-mcppackage, which exposes FastAPI endpoints as MCP tools. - The MCP compare endpoint is a GET at
/mcp/compare- no API key needed. - Metrics computed with the original ranaroussi/quantstats library; prices from Yahoo Finance via yfinance (stocks, ETFs, metals, crypto).
- Rate limited per IP with per-IP concurrency controls; deployed on Coolify (Hetzner) behind Cloudflare.
Build your own (open source)
Clone the repo and run your own instance:
- Clone github.com/amararun/qrep-backend-fastapi
pip install -r requirements.txt- Set environment variables (see
.env.example):QPULSE_API_KEYfor the /qpulse/* endpoints,BASE_URL,RATE_LIMIT. uvicorn main:app --host 0.0.0.0 --port 8000- MCP endpoint athttp://localhost:8000/mcp.
Rate limits
Per IP, published so a well-behaved client can plan around them:
- Compare / MCP: 20 requests / minute per IP (100 / minute global).
- The heavier
/qpulse/*report endpoints have their own limits and require an API key.
On the limit you get a 429; back off and retry.
API Endpoints (REST / HTTP)
https://qrep-api.tigzig.comPrepend this to every path listed below (e.g. /series becomes https://qrep-api.tigzig.com/series). The curl example on each card shows the full URL.Generated from the live OpenAPI spec - always in sync with the API. Try them interactively in Swagger.
/mcp/compare
Mcp Compare
QREP security comparison. Returns 81 portfolio metrics per symbol, computed using the
| Param | In | Type | Description | |
|---|---|---|---|---|
symbols | query | string | required | Comma-separated Yahoo Finance ticker symbols, max 6 (e.g. AAPL,MSFT,GOOG) |
benchmark | query | string | optional | Benchmark symbol. Can be any valid Yahoo Finance ticker. |
start_date | query | string | required | Start date YYYY-MM-DD. Should be at least 6 months before end_date for meaningful analysis. |
end_date | query | string | required | End date YYYY-MM-DD. Must not be in the future. |
risk_free_rate | query | number | optional | Risk-free rate as decimal (e.g. 0.045 for 4.5%). Used in Sharpe, Sortino, Treynor, and other risk-adjusted calculations. |
curl "https://qrep-api.tigzig.com/mcp/compare"/qpulse/analyze
Qpulse Analyze
Generate QREP tearsheet (powered by QuantStats).
| Param | In | Type | Description | |
|---|---|---|---|---|
X-API-Key | header | string | optional |
curl "https://qrep-api.tigzig.com/qpulse/analyze"/qpulse/analyze
Qpulse Analyze Get
GET version of QREP analyze for browser/curl testing
| Param | In | Type | Description | |
|---|---|---|---|---|
symbol | query | string | required | Stock symbol |
benchmark | query | string | optional | Benchmark symbol |
start_date | query | string | required | Start date (YYYY-MM-DD) |
end_date | query | string | required | End date (YYYY-MM-DD) |
risk_free_rate | query | number | optional | Risk-free rate as decimal |
X-API-Key | header | string | optional |
curl "https://qrep-api.tigzig.com/qpulse/analyze"/qpulse/compare
Qpulse Compare
Compare multiple securities with full metrics.
| Param | In | Type | Description | |
|---|---|---|---|---|
X-API-Key | header | string | optional |
curl "https://qrep-api.tigzig.com/qpulse/compare"/qpulse/compare/export
Export Comparison
Export comparison results as HTML or PDF
| Param | In | Type | Description | |
|---|---|---|---|---|
X-API-Key | header | string | optional |
curl "https://qrep-api.tigzig.com/qpulse/compare/export"/qpulse/portfolio
Portfolio Compare
Compare multiple portfolios with weighted holdings.
| Param | In | Type | Description | |
|---|---|---|---|---|
X-API-Key | header | string | optional |
curl "https://qrep-api.tigzig.com/qpulse/portfolio"