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 分