
RiskModels
io.github.BlueWaterCorp由 GitHub 帳號 BlueWaterCorp 發布v2.0.1更新於 Oct 24, 2026
Dividend-adjusted US equity total returns, risk decomposition, attribution & ETF hedge ratios
概覽
RiskModels MCP 伺服器讓助理取得美股股息調整後總報酬、因子風險分解、報酬歸因與 ETF 對沖比率,可遠端或本機執行。
- 可以做什麼
- 查詢個股:快照、報酬、殘差報酬與訊號、總體相關性、基本面、申報機構、基金與 ETF
- 分解與比較風險:依市場、產業、次產業與個股特有層面拆分,並把對沖比率換算為美元 ETF 交易
- 分析投資組合:曝險報告、風險快照、選股與漂移分解,以及讀取已連結券商帳戶的持倉
- 篩選與排名:在全市場、產業與次產業內排名,並找出同類群組與同業
- 解析證券身分並檢索目錄;以 MCP 資源形式讀取 REST 目錄、回應結構與 OpenAPI 規格
- 適用情境
- 適合需要量化美股風險分析的場合:說明某檔股票波動的來源、為部位計算 ETF 對沖規模、比較不同標的,或檢視投資組合曝險與歸因。
- 執行需求
- 需要 RiskModels 帳戶:託管端點使用 OAuth 2.1 登入(Google、電子郵件連結或密碼),REST 風格端點使用 bearer 權杖(API 金鑰或 OAuth2 JWT)。本機方式透過 stdio 執行 npm 套件 @riskmodels/mcp,通常需要 Node.js。需能連線 riskmodels.app。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 RiskModels,將其新增到工作區。
- 連接 所需的 憑證。它們會被私密儲存,絕不會在公開頁面上展示。
- 為需要使用其工具的對話啟用該服務。
Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。
交給代理程式安裝
把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。
閱讀 https://sourceweft.com/mcp/io.github.BlueWaterCorp%2Friskmodels/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。其他 MCP 客戶端
把它新增到你客戶端的 mcpServers 設定中。 客戶端會在首次連接時完成 OAuth 登入。
{
"mcpServers": {
"riskmodels": {
"type": "http",
"url": "https://riskmodels.app/api/mcp/sse"
}
}
}README
RiskModels provides clean dividend-adjusted total returns, factor risk decomposition, return attribution, and ETF-executable hedge ratios for US equities — over REST, a typed SDK, and a built-in MCP server. The dataset is simulation-grade: it covers on the order of 16,000 US stocks across the full historical panel, while at each month end the model’s headline universe is the largest ~3,000 by market cap—the set the API surfaces for everyday returns, risk, and hedging.
Post-regression outputs (hedge ratios, explained-risk decompositions, and related L1–L3 series) are served from the first date whose full estimation window is covered: hedge ratios from 2010-12-08, explained-risk shares and stock variance from 2011-12-07, L* residual levels from 2013-01-01. Split- and dividend-adjusted returns (the inputs to the rolling regressions) begin 2006-01-04. The API is AI-agent ready, including a built-in Model Context Protocol (MCP) server for seamless integration with LLMs.
RiskModels API Developer Portal
[CI] [Live Docs] [OpenAPI] [PyPI] [smithery badge]
This repository is the authoritative public API reference for the RiskModels equity risk model API, featuring:
- 📖 Model methodology — ERM3 overview (canonical; also mirrored on riskmodels.net)
- 📚 Comprehensive API Documentation — OpenAPI 3.0.3 specification, guides, and examples
- 🌐 Developer Portal — Beautiful Next.js site (this repo) deployed at riskmodels.app
- 🐍 Python & TypeScript Examples — Production-ready code in
examples/ - 🤖 AI Agent Integration — MCP server, OAuth2, and agent manifest
Use in Cursor (Agent Plugin)
This repository is an Agent Plugins package: plugin.json and mcp.json at the repository root. The plugin connects Cursor to the hosted RiskModels MCP server. It contains no code that runs on your machine and no credentials.
Install
- In Cursor, open the Marketplace and search for RiskModels.
- Install it for your user or for the current project.
- Cursor adds the
riskmodelsMCP server. Its tools appear once you sign in.
Sign in
The server uses OAuth 2.1 with PKCE. Cursor handles the flow, and nothing goes in the plugin files:
- When Cursor first connects to the
riskmodelsserver, the server asks for sign-in and Cursor opens a browser at riskmodels.app. - Sign in with Google or an email link, or choose Sign in with a password instead.
- The consent screen shows Signed in as <email>. If that is the wrong account, click Use a different account first, then Allow.
- Cursor stores the token. The tools are read-only: they return data and never place orders or change your account.
Pricing and account
- A RiskModels account is required. New accounts start with $20 of prepaid credit. A payment method is collected at signup for verification and is not charged until you top up.
- Usage is pay-as-you-go and billed per tool call against that balance. Most single-stock calls cost $0.005; fundamentals cost $0.02, and a full portfolio exposure report costs $0.25. Rates and plans: riskmodels.app/pricing.
- Optional: link a brokerage account (Alpaca, Connect Trade or Plaid) in riskmodels.net Settings, and
riskmodels_get_my_positionsreads that book.
Example: NVDA
Ask in Cursor's agent chat:
Decompose NVDA's risk with RiskModels and give me the ETF hedge for a $100,000 position.
The agent calls riskmodels_decompose for the market / sector / subsector / stock-specific split of NVDA's variance and the hedge ratio at each level. Then it calls riskmodels_decompose again with a dollar amount to turn those ratios into dollar trades in SPY and the sector and subsector ETFs. The numbers are live model output as of the latest trading day.
The Claude plugin (claude-plugin/) and the local developer MCP server (.cursor/mcp.json, mcp/) are separate and unchanged.
🚀 Quick Links
- Python SDK — AOM quickstart (Google Colab): Open notebook · source:
sdk/notebooks/riskmodels_aom_colab.ipynb - Developer Portal: riskmodels.app
- Live API Docs: riskmodels.net/docs/api/erm3
- ERM3 methodology: riskmodels.app/docs/methodology
- Get API Key: riskmodels.app/get-key
- API Terms: riskmodels.net/terms/api
- Issues: github.com/BlueWaterCorp/RiskModels_API/issues
- PyPI (Python SDK): riskmodels-py
Canonical URLs (REST, OpenAPI, and docs)
Use these only for integrations and tooling:
Important: The hostname api.riskmodels.app is not used for the public API or machine-readable docs. Older links or docs that mention it should be treated as obsolete; use riskmodels.app (apex) as above.
📖 API Overview
The RiskModels API provides institutional-grade equity risk analysis:
- Daily factor decompositions — market, sector, subsector explained-risk fractions for the headline ~3,000 largest US stocks by market cap (month-end universe)
- Hedge ratios — dollar-denominated ETF hedge amounts (L1/L2/L3) designed to remain executable with liquid raw ETFs
- Historical time series — split- and dividend-adjusted returns (2006-01-04–present) plus rolling hedge ratios (2010-12-08–present) and ER (2011-12-07–present; factor outputs need a full regression window)
- AI-agent ready — OAuth2, per-request billing, machine-readable manifests
Data coverage: ~16,000 US stocks in the historical panel; ~3,000 largest by market cap at each month end for headline outputs. Updated daily. Hedge ratios: 2010-12-08 through present. Explained risk: 2011-12-07 through present. L* levels: 2013-01-01 through present. Adjusted return series: 2006-01-04 through present.
Why The Engine Matters
RiskModels is designed to be useful for real portfolio work, not just descriptive analytics:
- Built to be time-safe — the engine is designed to avoid common sources of forward contamination such as recycled tickers, snapshot shares, and retroactive universe contraction
- Grounded in a real Security Master — ticker-level outputs sit on top of a point-in-time identity layer built for identifier continuity, symbol changes, and historically defensible shares data
- Hierarchical by design — the model separates market, sector, and subsector structure rather than collapsing everything into a flat beta view
- Tradeable in practice — the published hedge ratios are designed to work with liquid ETFs at execution time, not only with synthetic or orthogonalized factors
- Built on adjusted return series — split- and dividend-adjusted returns make the decomposition and hedge ratios more economically consistent over long horizons
For a deeper explanation of the engine design choices behind these claims, see the methodology docs and API reference.
🐍 Python SDK (riskmodels-py)
Prefer the Python SDK over raw REST for agent-native workflows — ticker resolution, semantic field normalization, validation with instructional errors, and LLM-ready context formatting are built in.
Install (PyPI):
Quickstart:
Snapshot generation (institutional PDF reports):
Documentation:
- Package README — install, methods, agent-native helpers
- Quickstart — 60-second setup path
- API Docs — agent-native helpers reference table
Risk intelligence
Charts below are generated from live API data (get_rankings + MAG7 L3 batch metrics) via scripts/generate_readme_assets.py. Set RISKMODELS_API_KEY (free tier is sufficient), run the script from the repo root, then commit ./assets/ and ./public/docs/readme/.
MAG7 — L3 σ-scaled decomposition
[MAG7 L3 sigma-scaled risk ratios and residual HR share]
Same “tech” label, different subsector DNA — bar length ∝ annualized σ; segments = σ × L3 market/sector/subsector risk ratios + residual (HR share). POST /batch/analyze via SDK save_mag7_l3_sigma_rr_png
Cross-sectional rankings
[Ranking by cohort]
Universe / sector / subsector rank percentile breakdown
🤖 MCP Server (v3.0.0-agent)
RiskModels includes a first-class MCP (Model Context Protocol) server, enabling AI agents to directly query risk data and perform factor analysis.
MCP Connection (hosted API):
- Endpoint (Streamable HTTP, POST):
https://riskmodels.app/api/mcp - Named endpoints:
/api/mcp/openaiand/api/mcp/sseremain supported - Authentication: Bearer token (API key or OAuth2 JWT)
- Discovery:
https://riskmodels.app/.well-known/mcp.json(see OPENAPI_SPEC.yaml)
Local MCP server (mcp/ in this repo, @riskmodels/mcp 2.0.0) — stdio transport for Cursor / Claude Desktop / Zed. Tool set 2.0 is one registry shared with the hosted endpoints: 25 tools locally, 26 hosted (adds riskmodels_render_artifact):
riskmodels_get_stock_snapshot, riskmodels_decompose, riskmodels_compare, riskmodels_get_returns, riskmodels_get_return_attribution, riskmodels_get_residual_returns, riskmodels_get_residual_signal, riskmodels_get_macro_correlation, riskmodels_get_fundamentals, riskmodels_analyze_portfolio, riskmodels_get_portfolio_risk_snapshot, riskmodels_portfolio_exposure, riskmodels_decompose_selection_vs_drift, riskmodels_get_my_positions, riskmodels_get_rankings, riskmodels_screen_rankings, riskmodels_get_cohorts, riskmodels_get_peers, riskmodels_search, riskmodels_resolve_security_identity, riskmodels_get_filer, riskmodels_get_fund, riskmodels_get_etf, riskmodels_get_benchmark_fit, riskmodels_get_factor_returns.
The REST catalog, response schemas and OpenAPI spec are MCP resources (riskmodels:///capabilities, riskmodels:///schemas/{path}, riskmodels:///openapi). Tool list, prices and the 1.x → 2.0 migration table: mcp/README.md. Outside MCP, call the REST API or the Python SDK (riskmodels-py).
See mcp/README.md for install and config.
Anthropic Claude (Managed Agents vs Messages API): internal engineering design for optional cloud-hosted agents, billing, and compliance — see docs/ANTHROPIC_CLOUD_AGENTS.md.
⌨️ Command-line CLI (riskmodels)
The npm package in cli/ installs the riskmodels binary: config, SQL query (billed API or direct Supabase), schema introspection, balance, and static agent manifests.
Install from npm:
Develop from this repo:
Publish to npm (maintainers): procedure is documented in the private BWMACRO monorepo (docs/RISKMODELS_CLI_NPM_PUBLISHING.md), not here. Only publish from the cli/ directory — the repo root Next.js app is not published to npm.
💻 Developer Portal (This Repo)
This repo now includes a Next.js developer portal with:
- ✨ Hero landing page with feature highlights
- 📚 MDX-powered documentation (README_API.md, AUTHENTICATION_GUIDE.md)
- 🔍 Interactive API reference (Redoc OpenAPI viewer)
- 💡 Code examples with syntax highlighting and copy buttons
- 🎯 Step-by-step quickstart guide
Local Development
Screenshot Capture Hygiene:
When capturing site screenshots for audit or documentation:
- Ensure the build passes first:
npm run buildmust complete without errors - Verify the dev server serves HTTP 200: Visit
http://localhost:3000and confirm pages render (not "Internal Server Error") - Run the capture script:
python3 capture_site.py(requires Playwright)
The script will skip pages returning HTTP 500 or containing "Internal Server Error" content. Screenshots with server errors should never be committed to the repository.
Environment Management with Doppler:
This repo uses Doppler for secrets management. The doppler.yaml is pre-configured for the erm3 project:
For curl/API testing with Doppler secrets:
See DEPLOYMENT.md for detailed Vercel/Doppler integration.
Visit http://localhost:3000
Build & Deploy
Deployment: See DEPLOYMENT.md for Vercel setup, env vars, and Supabase/Stripe config.
📂 Repository Structure
🛠️ Tech Stack (Developer Portal)
- Framework: Next.js 15 (App Router)
- Styling: Tailwind CSS 3.4, dark mode default
- MDX: @next/mdx for documentation
- API Reference: Redoc (OpenAPI 3.0 viewer)
- Code Highlighting: Custom CodeBlock with copy button
- Fonts: Inter (system-ui fallback)
- Colors: Blue primary (
hsl(217, 91%, 60%)), zinc/slate dark palette
📄 Documentation Files
🔗 Related
- ERM3 — Python risk model computation engine (open source)
🤝 Contributing
We welcome pull requests, especially to improve the OpenAPI spec — clearer descriptions, better schemas, and more examples help everyone.
- OpenAPI spec: CONTRIBUTING.md — PRs to
OPENAPI_SPEC.yamlare encouraged - Issues: Open an issue for bugs or feature requests
- Examples: Submit new examples via PR to
examples/ - Docs: Improve documentation by editing MDX files in
content/docs/
📧 Support
- API Support: [email protected]
- Issues: github.com/BlueWaterCorp/RiskModels_API/issues
- Status: riskmodels.net/status · API metrics riskmodels.app/api/status
📜 License
See LICENSE for details.
© 2026 Blue Water Macro Corp. All rights reserved.
Deploy trigger: Tue Jun 9 16:13:22 PDT 2026
來源:README.md,提交 411bc14
工具
0版本歷史
4- v2.0.1最新Oct 15, 2026
- v1.0.12Oct 14, 2026
- v1.0.11Oct 13, 2026
- v1.0.6Sep 16, 2026
評分
已滿足適用檢查項的 85%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通必需25 分
- 已宣告認證方式必需10 分
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分