Skip to main content
Glama
QuantRisk-MCP-Server

QuantRisk-MCP-Server

by 78degrees

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

npm install -g @quantrisk/mcp-server

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

Add to your claude_desktop_config.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.


Related MCP server: optionslab

Configuration

Claude Desktop

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

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

Cursor

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

{
  "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

Tool

Description

Tier

analyze_risk

VaR, CVaR, volatility, Sharpe ratio, max drawdown

Free

monte_carlo_simulation

Forward-looking return simulations with configurable paths

Free

stress_test

Portfolio impact under historical and hypothetical scenarios

Free

price_history

Historical price and return data for any supported ticker

Free

sector_exposure

Sector and industry breakdown across holdings

Free

performance_attribution

Return attribution by asset, sector, and factor

Free

correlation_matrix

Cross-asset correlation analysis

Free

optimize_portfolio

Mean-variance and risk-parity optimization

Pro

compare_portfolios

Side-by-side risk/return comparison of multiple portfolios

Pro

calculate_greeks

Options Greeks — delta, gamma, theta, vega, rho

Pro


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.

Free

Pro ($29/mo)

Positions

20

500

API calls

50/day

Unlimited

Tools

7

All 10

Monte Carlo paths

1,000

100,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.

git clone https://github.com/78degrees/mcp-server.git
cd mcp-server
npm install
npm test

See CONTRIBUTING.md for guidelines.


License

MIT


Built by the team at quantrisk.dev

Contact: hello@quantrisk.dev

Available Tools

10 tools
analyze_riskBInspect

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

Inputs: positions (required), confidence_level, horizon_days, method, +2 more.

calculate_greeksAInspect

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.

Inputs: options (required), risk_free_rate.

compare_portfoliosBInspect

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

Inputs: portfolios (required), period_days, confidence_level.

correlation_matrixAInspect

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

Inputs: tickers (required), lookback_days, method.

monte_carlo_simulationAInspect

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

Inputs: positions (required), num_paths, horizon_days, model, +2 more.

optimize_portfolioAInspect

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

Inputs: tickers (required), objective, target_return, constraints, +2 more.

performance_attributionBInspect

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

Inputs: positions (required), period_days, benchmark, risk_free_rate.

price_historyAInspect

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

Inputs: tickers (required), days, interval.

sector_exposureAInspect

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

Inputs: positions (required).

stress_testBInspect

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

Inputs: positions (required), scenarios, custom_shocks.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 10 tools

    Disambiguation5/5

    Each tool targets a distinct financial analysis function (risk metrics, greeks, comparison, correlation, simulation, optimization, attribution, history, sector exposure, stress test) with no overlap.

    Naming Consistency5/5

    All tool names consistently follow the verb_noun pattern with snake_case (e.g., analyze_risk, calculate_greeks, compare_portfolios).

    Tool Count5/5

    10 tools is well within the ideal 3-15 range, covering a comprehensive set of risk analysis capabilities without being excessive.

    Completeness5/5

    The tool set covers all major areas of quantitative risk analysis: basic risk metrics, options greeks, portfolio optimization, simulation, stress testing, performance attribution, correlation, sector exposure, and historical data.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides real-time options analytics, pricing with Greeks, Monte Carlo simulations, volatility analysis, strategy backtesting, and risk metrics using actual market data from Yahoo Finance and Polygon.io.
      1
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Options analytics MCP server providing 40+ tools for options chain data, position valuation, Greeks, charts, and volatility analysis.
      MIT
    • F
      license
      A
      quality
      D
      maintenance
      MCP server providing portfolio analytics tools: beta to a benchmark, sector correlation, and FIFO trade matching with realized/unrealized P&L using Yahoo Finance prices.
      3
      -
    • A
      license
      A
      quality
      A
      maintenance
      MCP server exposing Interactive Brokers' portfolio risk analysis, including model greeks, implied volatility surface, what-if margin, and a local stress engine for P&L curve analysis.
      9
      MIT