
Company News
Free Business Plan Upgrades for Open Source Maintainers
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.
@quantrisk/mcp-server
Advanced tools
Portfolio risk analytics engine exposed as MCP tools — VaR, Monte Carlo, Markowitz optimization, options Greeks, and stress testing — for quant traders talking to AI assistants.
Portfolio risk analytics engine for AI assistants — VaR, Monte Carlo, optimization, stress testing, and more.
There are over 10,000 MCP servers indexed across every major registry. Zero of them compute portfolio risk. You can ask your AI assistant to check GitHub issues, query a database, or send a Slack message — but if you ask "what's my portfolio's VaR at 95% confidence?" you get a polite explanation of what VaR is, not an answer.
QuantRisk closes that gap. It exposes institutional-grade risk analytics — Value at Risk, Monte Carlo simulation, Markowitz optimization, options Greeks, stress testing against historical crises — as first-class MCP tools. You describe your portfolio in plain English. Your AI assistant calls the right tool, runs the math server-side on Cloudflare's global edge, and returns a structured result it can reason about and explain.
No Python environment. No Bloomberg terminal. No context-switching. Just quant-grade analytics inside the conversation you're already having.
npm install -g @quantrisk/mcp-server
Get a free API key at quantrisk.dev.
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"quantrisk": {
"command": "quantrisk-mcp",
"env": {
"QUANTRISK_API_KEY": "your-api-key-here"
}
}
}
}
Add to your Cursor MCP config (.cursor/mcp.json in your project root or ~/.cursor/mcp.json globally):
{
"mcpServers": {
"quantrisk": {
"command": "quantrisk-mcp",
"env": {
"QUANTRISK_API_KEY": "your-api-key-here"
}
}
}
}
If you prefer the hosted endpoint directly:
{
"mcpServers": {
"quantrisk": {
"transport": "http",
"url": "https://mcp.quantrisk.dev/sse",
"headers": {
"Authorization": "Bearer your-api-key-here"
}
}
}
}
| Tool | Description | Tier |
|---|---|---|
analyze_risk | VaR, CVaR, volatility, beta, max drawdown for a portfolio | |
monte_carlo_simulation | Distribution of future returns across simulated paths | |
stress_test | P&L impact under GFC 2008, COVID crash, dot-com, and more | |
correlation_matrix | Pairwise asset correlations + eigenvalue decomposition | |
performance_attribution | Sharpe, Sortino, Treynor, Calmar, Information ratio | |
sector_exposure | GICS sector, market cap, and HHI concentration breakdown | |
price_history | Historical OHLCV data for one or more tickers | |
optimize_portfolio | Mean-variance optimization: max Sharpe, min variance, target return | |
compare_portfolios | Head-to-head risk/return comparison of 2-5 portfolio allocations | |
calculate_greeks | Delta, gamma, theta, vega, rho for options portfolios |
Full input/output schemas for every tool are documented at quantrisk.dev/docs.
Everything below is real natural language. The AI constructs the tool call from your words; you never touch JSON.
Value at Risk
"I have 200 shares of AAPL, 150 shares of MSFT, and 100 shares of NVDA. What's my portfolio's VaR at 95% confidence over a 1-day horizon?"
Your portfolio has an estimated 1-day 95% VaR of $4,820 (2.3% of portfolio value).
Expected shortfall in the worst 5% of days is $7,340. Annual volatility is 28.4%.
Portfolio beta vs SPY is 1.12.
Monte Carlo Simulation
"Run a Monte Carlo simulation on that portfolio with 10,000 paths over the next month."
Over 10,000 simulated 21-day paths:
Median outcome: $214,500 (+2.6%)
5th percentile: $183,200 (-12.2%)
95th percentile: $248,100 (+18.9%)
Probability of any loss: 31.4%
Worst simulated outcome: $151,800
Stress Testing
"Stress test my portfolio against 2008 and COVID. How bad would it have gotten?"
2008 Financial Crisis: -$41,200 (-19.7%)
Worst position: NVDA (-28.4%), Best: MSFT (-14.1%)
COVID Crash (Feb-Mar 2020): -$33,800 (-16.2%)
Worst position: AAPL (-21.3%), Best: MSFT (-12.8%)
Both scenarios would have been painful. Tech-heavy portfolios had limited shelter
in either event. Consider adding uncorrelated assets or tail-risk hedges.
Portfolio Optimization
"Optimize my portfolio for maximum Sharpe ratio. Keep any single position under 40%."
Optimal weights for maximum Sharpe (1.87):
AAPL: 38.2%
MSFT: 39.8%
NVDA: 22.0%
Expected annual return: 24.3%
Expected annual volatility: 19.1%
Compared to your current allocation, this improves Sharpe by 0.31.
| Limit | Value |
|---|---|
| Positions per call | 20 |
| Monte Carlo paths | 1,000 |
| Price history | 1 ticker, 1 year |
| Correlation matrix | 10 assets |
| API calls | 100/day, 10/minute |
| Tools | 7 of 10 (no optimize, compare, or Greeks) |
| Limit | Value |
|---|---|
| Positions per call | 500 |
| Monte Carlo paths | 100,000 |
| Price history | 20 tickers, 5 years |
| Correlation matrix | 50 assets |
| API calls | 5,000/day, 60/minute |
| Custom stress scenarios | Included |
| Full factor attribution | Included |
| Tools | All 10 |
Upgrade at quantrisk.dev/upgrade — takes 30 seconds, cancel any time.
The server is open source under MIT. You can deploy your own instance on Cloudflare Workers in under 5 minutes.
git clone https://github.com/quantrisk/mcp-server.git
cd mcp-server
npm install
cp .env.example .env
# Fill in ALPHA_VANTAGE_KEY and STRIPE_SECRET_KEY in .env
npx wrangler deploy
You'll need:
The hosted service at mcp.quantrisk.dev is the recommended path for most users. Self-hosting is for teams with data-residency requirements or those who want to modify the analytics engine.
Contributions are welcome — especially to the engine layer (src/engine/), which is pure TypeScript math with no external dependencies.
git clone https://github.com/quantrisk/mcp-server.git
cd mcp-server
npm install
npm test # run the full test suite
npm run test:watch # watch mode for development
Before opening a PR:
test/engine/See CONTRIBUTING.md for the full guide.
MIT — see LICENSE.
The hosted service at quantrisk.dev is a separate commercial product. The MIT license covers this repository's code; it does not grant access to the hosted API.
Built with @modelcontextprotocol/sdk, deployed on Cloudflare Workers.
FAQs
Portfolio risk analytics engine exposed as MCP tools — VaR, Monte Carlo, Markowitz optimization, options Greeks, and stress testing — for quant traders talking to AI assistants.
The npm package @quantrisk/mcp-server receives a total of 67 weekly downloads. As such, @quantrisk/mcp-server popularity was classified as not popular.
We found that @quantrisk/mcp-server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.