QuantRisk

dev.quantrisk由 quantrisk.dev 發布v1.0.2更新於 Oct 24, 2026

Portfolio risk analytics — VaR, Monte Carlo, optimization, options Greeks, stress testing.

已驗證Streamable HTTP可網頁執行金融資料與分析

概覽

AI 產生的概覽

QuantRisk 讓助理取得機構級投資組合風險分析能力:VaR、蒙地卡羅、壓力測試、相關性、曝險與選擇權希臘值。

可以做什麼
計算投資組合風險指標,例如 VaR、CVaR、波動率、貝他值與最大回撤,並對指定配置執行蒙地卡羅報酬模擬,以及歷史或自訂衝擊的壓力測試;付費版另提供投資組合最佳化與多組投組比較。透過兩兩相關矩陣分析分散程度,並依 GICS 產業、市值與資產類別拆解曝險,提供集中度指標。將績效歸因至因子、產業與持倉,並計算 Sharpe、Sortino、Treynor、Calmar 與資訊比率。取得一個或多個代碼的歷史 OHLCV 價格資料,並計算單一選擇權或選擇權組合的希臘值。
適用情境
適合讓助理回答量化投組問題:某個配置的風險、下行情境、分散程度、產業集中度或選擇權敏感度,而不必自行建構計算模型。免費版涵蓋小型投組與核心指標;投組最佳化、投組比較與希臘值需要 Pro。
執行需求
可作為遠端端點執行,也可作為本機 npm 套件(@quantrisk/mcp-server)透過 stdio 執行,本機使用需要 Node.js。QUANTRISK_API_KEY 中的 API 金鑰為選用;未提供時以免費版執行,工具與呼叫配額受限。需要能連線至 QuantRisk API 的網路。
安裝前請注意
送出的持倉與代碼會傳送至 QuantRisk API,行情資料來自 Yahoo Finance;README 表示請求完成後不保留投組資訊。付費版每月 29 美元,可解鎖最佳化、投組比較與希臘值。免費版限制為 20 個持倉、每日 50 次呼叫。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 QuantRisk,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/dev.quantrisk%2Fmcp-server/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "quantrisk": {
      "type": "http",
      "url": "https://quantrisk-mcp.quantrisk.workers.dev/mcp"
    }
  }
}

README

QuantRisk

Institutional-grade portfolio risk analytics for Claude and any MCP client.

[npm version] [npm downloads] [License: MIT] [MCP Compatible]

VaR / Monte Carlo / Stress Testing / Portfolio Optimization / Greeks / Correlation Matrices

Real market data. Real math. Not hallucinated numbers.

Website · Get Pro · Documentation


Quick Start

1. Install

bash
npm install -g @quantrisk/mcp-server

2. Configure (Claude Desktop — see below for Cursor)

Add to your claude_desktop_config.json:

json
{  "mcpServers": {    "quantrisk": {      "command": "quantrisk-mcp-server",      "env": {        "QUANTRISK_API_KEY": "your-api-key"      }    }  }}

Get your free API key at quantrisk.dev/signup.

3. Ask Claude

"What's the Value at Risk on a portfolio of 60% SPY, 25% TLT, and 15% GLD?"

That's it. Claude now has access to institutional-grade risk analytics.


Configuration

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

json
{  "mcpServers": {    "quantrisk": {      "command": "quantrisk-mcp-server",      "env": {        "QUANTRISK_API_KEY": "your-api-key"      }    }  }}

Cursor

Add to .cursor/mcp.json in your project root:

json
{  "mcpServers": {    "quantrisk": {      "command": "quantrisk-mcp-server",      "env": {        "QUANTRISK_API_KEY": "your-api-key"      }    }  }}

Any MCP Client

QuantRisk works with any client that supports the Model Context Protocol. Point it at the quantrisk-mcp-server binary with your API key in the environment.


Tools

ToolDescriptionTier
analyze_riskVaR, CVaR, volatility, Sharpe ratio, max drawdownFree
monte_carlo_simulationForward-looking return simulations with configurable pathsFree
stress_testPortfolio impact under historical and hypothetical scenariosFree
price_historyHistorical price and return data for any supported tickerFree
sector_exposureSector and industry breakdown across holdingsFree
performance_attributionReturn attribution by asset, sector, and factorFree
correlation_matrixCross-asset correlation analysisFree
optimize_portfolioMean-variance and risk-parity optimizationPro
compare_portfoliosSide-by-side risk/return comparison of multiple portfoliosPro
calculate_greeksOptions Greeks — delta, gamma, theta, vega, rhoPro

Example Queries

Once configured, ask Claude questions like these:

  • "Run a Monte Carlo simulation on my portfolio: 50% AAPL, 30% MSFT, 20% NVDA. Show me the 5th percentile outcome."
  • "Stress test 70% VTI / 30% BND against the 2008 financial crisis and a hypothetical 300bp rate shock."
  • "What's my sector exposure if I hold equal weights in AMZN, JPM, JNJ, XOM, and NEE?"
  • "Show me the correlation matrix for SPY, GLD, TLT, and BTC-USD over the last 2 years."
  • "Compare the risk-adjusted returns of a 60/40 portfolio vs. an all-weather portfolio." (Pro)
  • "Calculate the Greeks for a SPY 550 call expiring in 30 days." (Pro)

Why Pro?

The free tier covers core risk analytics for small portfolios. Pro unlocks the tools and scale that serious analysis demands.

FreePro ($29/mo)
Positions20500
API calls50/dayUnlimited
Tools7All 10
Monte Carlo paths1,000100,000
Portfolio optimization—Mean-variance, risk-parity, min-volatility
Portfolio comparison—Side-by-side multi-portfolio analysis
Options Greeks—Full Greeks surface

What that means in practice:

  • Free: "What's the VaR on my 10-stock portfolio?" — works great.
  • Pro: "Optimize my 200-position portfolio for maximum Sharpe, then stress test it against 5 scenarios and compare it to my current allocation." — you need Pro for that.

Upgrade to Pro


How It Works

Claude / MCP Client      |  MCP Protocol      |QuantRisk MCP Server (local process)      |QuantRisk API (Cloudflare Workers)      |Yahoo Finance (market data) + risk engine (math)
  • MCP Server runs locally as a stdio process — your API key never leaves your machine except to authenticate with the QuantRisk API.
  • Risk Engine runs on Cloudflare Workers. All calculations — VaR, Monte Carlo, optimization — happen server-side with real math on real market data.
  • Market Data sourced from Yahoo Finance. Prices, fundamentals, and options chains are fetched in real time.
  • Reports generated with pdf-lib when applicable.

No data is stored. No portfolio information is retained after a request completes.


Contributing

Contributions are welcome. Please open an issue first to discuss what you'd like to change.

bash
git clone https://github.com/78degrees/mcp-server.gitcd mcp-servernpm installnpm test

See CONTRIBUTING.md for guidelines.


License

MIT


Built by the team at quantrisk.dev

Contact: [email protected]

來源:README.md,提交 df287a5

工具

10

analyze_risk

Calculate core risk metrics for a portfolio — Value at Risk (VaR), Conditional VaR (CVaR), volatility, beta, and max drawdown.

輸入參數methodbenchmarkpositions必填horizon_dayslookback_daysconfidence_level

monte_carlo_simulation

Run Monte Carlo simulation on a portfolio to model the distribution of future returns, including percentile outcomes and probability of loss.

輸入參數seedmodelnum_pathspositions必填horizon_dayslookback_days

stress_test

Stress test a portfolio against historical crisis scenarios (GFC 2008, COVID 2020, etc.) or custom shocks (paid tier).

輸入參數positions必填scenarioscustom_shocks

optimize_portfolio

Find the optimal portfolio allocation using mean-variance optimization. Supports max Sharpe, min variance, and target return objectives. Paid tier only.

輸入參數tickers必填objectiveconstraintslookback_daystarget_returnrisk_free_rate

correlation_matrix

Compute the pairwise correlation matrix for a set of assets. Identifies highly correlated pairs and diversification opportunities.

輸入參數methodtickers必填lookback_days

performance_attribution

Break down portfolio performance into factor exposures, sector allocation, and position contributions. Computes Sharpe, Sortino, Treynor, Calmar, and Information ratios.

輸入參數benchmarkpositions必填period_daysrisk_free_rate

sector_exposure

Break down portfolio exposure by GICS sector, market cap, and asset class. Returns concentration metrics including the Herfindahl-Hirschman Index.

輸入參數positions必填

price_history

Fetch historical OHLCV price data for one or more tickers. Free tier: 1 ticker, 252 days. Paid tier: up to 20 tickers, 1260 days.

輸入參數daystickers必填interval

compare_portfolios

Compare two or more portfolio allocations head-to-head across all key risk and return metrics. Paid tier only.

輸入參數portfolios必填period_daysconfidence_level

calculate_greeks

Calculate option Greeks (delta, gamma, theta, vega, rho) for individual options or an options portfolio. Uses Black-Scholes for European, binomial for American style. Paid tier only.

輸入參數options必填risk_free_rate

版本歷史

1
  1. v1.0.2最新Sep 16, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分