HPSILab Quant Finance

io.github.haiyunsky由 GitHub 账号 haiyunsky 发布v0.11.1更新于 Oct 31, 2026

Stock & options risk analytics for AI agents: pre-trade risk scan, IV, gamma walls, Monte Carlo.

发布方自己的服务:Finance Foundation

已验证Streamable HTTP可网页运行金融数据与分析

概览

AI 生成的概览

为助手提供股票与期权的量化研究工具:交易前风险扫描、隐含波动率结构、Gamma 墙、蒙特卡洛区间与回测。

可以做什么
  • 一次调用完成个股综合分析,给出方向信号、利多与利空因素及通俗总结
  • 读取隐含波动率水平、排名、偏斜与状态,以及期权链压力如最大痛点与 Gamma 墙
  • 模拟未来约 10 个交易日的价格区间与上涨概率,并查看策略回测的夏普比率、回撤与胜率
  • 执行交易前风险扫描,涵盖波动率、贝塔、回撤、VaR、仓位规模与相关性检查
  • 生成托管的股票报告图片和完整的 Markdown 研究报告
  • 在客户端内注册免费账户并立即获取 API 密钥
适用场景
适合需要结构化、机器可读的美股、ETF 或受支持期权市场研究的场景,例如交易想法前的风险把关、期权结构复盘,或对某只股票做多信号速览。仅供研究与教育用途,不执行交易。
运行要求
可使用托管的 streamable HTTP 端点并通过 OAuth 登录,或在本地以 stdio 运行 PyPI 包(pip 或 uvx)。所有研究工具都需要已登录账户:OAuth,或在 Authorization 头中提供 Bearer API 密钥,stdio 方式则使用 HPSILAB_API_KEY 环境变量。需要访问托管服务的网络;付费工具需要 Credits 或 x402 支付。
安装前请注意
API 密钥属于机密:应放在客户端私有配置中,切勿粘贴到聊天或提交到代码库。部分工具会产生费用——交易前风险扫描和研究报告对匿名调用者按次通过 x402 收费,登录用户则消耗 Credits,且各套餐有每日与每分钟调用上限。图片与报告生成会创建托管产物、不具幂等性并消耗配额,不应自动重试。register_account 会在无人参与的情况下创建账户并发送邮件。输出为实时数据,两次调用之间可能变化。

安装

在 SourceWeft 中

  1. 打开 控制台中的 HPSILab Quant Finance,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.haiyunsky%2Fhpsilab-quant-finance-mcp/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "hpsilab-quant-finance": {
      "type": "http",
      "url": "https://hpsilab.com/mcp"
    }
  }
}

README

HPSILab Quant Finance MCP Server for Stock & Options Analytics

[HPSILab in the Claude Directory] [PyPI] [CI] [License] [Listed on mcpservers.org] [HPSILab Quant Finance MCP on Glama]

Stock and options risk analytics for AI agents. Connect one remote MCP endpoint, https://hpsilab.com/mcp, sign in with OAuth (no API key to paste), and your agent can call:

  • a pre-trade risk scan: volatility, beta, drawdown and VaR against SPY with fixed pass/warn/fail limits, plus sizing, sector exposure and correlation checks;
  • options structure: IV level, rank and skew, gamma wall, call/put walls, max pain;
  • a 10-trading-day Monte Carlo price range and odds of finishing higher;
  • analyze_stock for a one-call overview, plus AI prediction and backtests.

Results are structured JSON with machine-readable errors, for US-listed equities, ETFs and supported options. This repository is the open-source Python server (MIT); the hosted endpoint runs the same tool surface.

Research and educational use only. HPSILab does not provide investment advice and does not execute trades.

Get a Free API Key · Pricing · Tool reference · Client setup · Python SDK

Registry nameio.github.haiyunsky/hpsilab-quant-finance-mcp
Version0.11.1 — a source checkout reports 0.11.1+source
TransportsStreamable HTTP (hosted) · stdio (PyPI package)
Remote endpointhttps://hpsilab.com/mcp
Packagepip install -U hpsilab-quant-finance-mcp
AuthenticationOAuth sign-in or Bearer API key (hosted), HPSILAB_API_KEY (stdio)
Tools10 — nine financial research tools plus register_account

Connect: hosted Streamable HTTP

Recommended, and requires no local installation.

With OAuth sign-in

Clients that support MCP OAuth (Claude Code, Claude.ai and ChatGPT connectors, and others) only need the URL; they open the HPSILab sign-in page on first use.

bash
claude mcp add --transport http hpsilab https://hpsilab.com/mcp

In a connector UI, add a custom connector with the URL https://hpsilab.com/mcp.

With an API key

For clients without OAuth support, or for scripts:

  1. Register a free account, sign in, and generate an API key from Settings.
  2. Add the server to your client's private configuration, replacing hpsi_your_key. Never commit a real key or paste one into chat.

The example below is Claude Code's .mcp.json; other clients use different configuration schemas, all covered in client setup.

json
{  "mcpServers": {    "hpsilab": {      "type": "http",      "url": "https://hpsilab.com/mcp",      "headers": {        "Authorization": "Bearer hpsi_your_key"      }    }  }}
  1. Verify the connection:
text
Use HPSILab to analyze AAPL. Separate observed metrics from interpretation,identify conflicting signals, and finish with a concise risk summary.

All financial research tools require a signed-in account: OAuth or a valid API key. See authentication for key handling and rotation.

Building an agent? examples/agents has one-file risk-check agents for the OpenAI Agents SDK, the Claude Agent SDK and LangGraph. Walkthrough: docs/guide-risk-gate-for-trading-agents.md.

Connect: local stdio

For clients that require a local process:

bash
pip install -U hpsilab-quant-finance-mcp

This example uses the mcpServers schema supported by Claude and Cursor; VS Code and GitHub Copilot use a servers schema instead.

json
{  "mcpServers": {    "hpsilab": {      "command": "hpsilab-quant-finance-mcp",      "env": {        "HPSILAB_API_KEY": "hpsi_your_key"      }    }  }}

Then verify it through the MCP client:

text
Use HPSILab to get the AI prediction for NVDA and summarize the model consensus.

The client discovers tools with MCP tools/list and invokes them with tools/call. See local setup and Python usage, which also covers calling the tool functions directly from Python.

Tools

Nine financial research tools, plus register_account. Tool names and parameter meanings are part of the public compatibility contract.

ToolWhat it returnsBehavior
analyze_stockAggregate directional and quantitative stock analysisRead-only
get_ai_predictionNext-session prediction, confidence, and model consensusRead-only
get_iv_radarIV level, rank, percentile, skew, and regimeRead-only
get_option_pressureMax pain, gamma walls, expected move, and pressure zonesRead-only
get_monte_carlo10-trading-day simulated distribution and probabilitiesRead-only
get_equity_curveStrategy backtests and risk-adjusted performanceRead-only
get_pretrade_risk_scanPosition, exposure, correlation, and risk checksRead-only
generate_stock_imagesHosted stock and options chart artifactsCreates an artifact; not idempotent
generate_stock_research_reportStructured Markdown research report and timestampCreates an artifact; not idempotent
register_accountSigning up from the client with no API key yet, or a fresh key for an existing accountCreates an account and sends email; not idempotent

Research tools accept one exchange ticker such as NVDA, SPY, or BRK.B; company names are not accepted. Live results can change between calls. Artifact tools can consume quota and should not be retried automatically.

Full inputs, outputs, side effects, and tool-selection guidance are in docs/tools.md.

Monte Carlo research example

[PLTR Monte Carlo scenario visualization]

Example visualization of scenario-based Monte Carlo research output. Results depend on the selected inputs and model assumptions. See get_monte_carlo for tool details.

Copy-ready prompts

Claude

text
Use HPSILab to analyze NVDA. Summarize the directional signal, AI modelconsensus, IV regime, options pressure, 10-day Monte Carlo range, and thethree most important risks. Distinguish tool data from interpretation.

Cursor

text
Use HPSILab's IV radar and option-pressure tools for SPY. Compare IV rank,percentile, skew, expected move, max pain, gamma wall, and pressure zones.Return a compact table and do not recommend a trade.

ChatGPT

text
Run the HPSILab pre-trade risk scan for TSLA. Explain every warning or failedcheck, preserve unavailable fields as unavailable, and quote the returnedreason instead of guessing. Do not execute or recommend a trade.

Setup guidance covers ChatGPT, Claude, Cursor, VS Code, GitHub Copilot, Continue, and Kimi. See the client setup guide for each client's transport and configuration format.

Errors, retries, and limits

Every failure is a structured object with a stable error_code, never prose an agent has to pattern-match. Five refusals matter, because each has a different remedy:

error_codeMeaningWhat resolves it
api_key_requiredNo key is configuredRegistering. Nothing is sent downstream
rate_limitedCalling too fast (429)Waiting — next_actions carries the seconds
insufficient_creditsThe Credit balance is empty (402)Adding Credits, or registering for trial Credits
allowance_exhaustedThe free evaluation ceiling is spent (402)Registering, or verifying an email. Money does not lift it
settlement_unknownA payment whose outcome is unconfirmedReconciliation. Do not retry it and do not pay again

Without a key the package stops locally, before constructing the downstream client or sending a request:

json
{  "error": "api_key_required",  "message": "A free API key is required.",  "register_url": "https://hpsilab.com/register",  "docs_url": "https://hpsilab.com/developer/v2"}

401 and 402 responses are never retried. A 429 is retried only when it carries a valid Retry-After. Read-only calls use a finite retry budget for timeouts and recoverable 500/502/503/504 responses; artifact-producing calls are not retried automatically. The package also applies one process-local safeguard of 10 requests per rolling minute per API key — burst protection, not a quota, since only the hosted service knows the balance and the plan.

Field-by-field payloads, the Credits circuit breaker, and the reasoning behind each remedy are in docs/authentication.md and docs/python-sdk.md.

Why HPSILab

HPSILab gives assistants typed inputs, structured outputs, ticker validation, machine-readable errors, and dedicated tools instead of invented metrics. It supports US-listed equities, ETFs, and supported options data; coverage and limits depend on the hosted service and plan.

Safety and license

HPSILab is for research and education only. Outputs may be incomplete, delayed, or wrong and are not investment, financial, or trading advice. The MCP server has no brokerage connectivity, order entry, or trade-execution capability.

Licensed under the MIT License. Contributions are welcome; read AGENTS.md and CONTRIBUTING.md before proposing public schema changes.

来源:README.md,提交 3e02e4e

工具

10

register_account

Register a Free Account

Register a free hpsilab account for yourself, with no human involvement, and receive an API key immediately. Call this when the user has no API key yet and asks to sign up from here, or when a refusal's `next_actions` names register_account and the user agrees. This is the only tool that works without an API key. You do not need a password, a wallet, or a web browser. The account is bound to you server-side, so calls you make after this are metered as your account even though you cannot change your own Authorization header. The account is created unverified, with only a capped evaluation allowance and no trial Credits, until the email address is confirmed; confirming it grants the one-time 100-Credit Registered Trial (14 days). Ask the human you are working with to click the link in the email that will arrive. Calling again from the same caller returns the same account with a fresh key; an address that belongs to another account is refused. A valid user email address is required. Do not call this tool with an empty or fabricated email address. If the user's email is unavailable, ask the user to provide it before calling register_account. Args: email: The real user email address that will receive verification.

输入参数email必填

get_iv_radar

Implied Volatility Radar

Implied-volatility (IV) structure for a stock: how expensive options are, whether volatility is being squeezed, and whether traders are paying up for upside (calls) or downside (puts). Available to all signed-in users. Args: ticker: Stock symbol, e.g. "NVDA". refresh: Bypass the backend's fresh IV cache and request the latest option-chain pull. Defaults to False.

输入参数ticker必填refresh

get_monte_carlo

Monte Carlo Simulation

Monte Carlo price simulation for the next ~10 trading days: thousands of random price paths estimate a likely price range and the odds of finishing higher. Args: ticker: Stock symbol, e.g. "AAPL".

输入参数ticker必填

get_ai_prediction

AI Prediction

AI next-day prediction: probability the stock closes UP, a paper-trading buy/watch/sell lean (research only, not a trade instruction), and how strongly the models agree (consensus). Available to every authenticated plan (Free / Pro / Enterprise); subject to the caller's plan requests/day and requests/minute limits. Args: ticker: Stock symbol, e.g. "TSLA".

输入参数ticker必填

get_equity_curve

Strategy Backtest

Backtest performance of the quant strategy across your watchlist: Sharpe ratio, max drawdown, win rate and total return per symbol. Available to every authenticated plan (Free / Pro / Enterprise); subject to the caller's plan requests/day and requests/minute limits. Args: ticker: Optional symbol to show just one row, e.g. "SPY". Leave blank for all.

输入参数ticker

get_option_pressure

Options Pressure Map

Option-chain pressure map for the nearest weekly/monthly expiry — Max Pain, dealer Gamma Wall, likely weekly high, and an extreme squeeze target. Args: ticker: Stock symbol, e.g. "SPY".

输入参数ticker必填

analyze_stock

Stock Analysis

Aggregate all quant tools into one JSON stock analysis. The tool reuses the existing MCP tools as its data sources, then derives a direction signal, direction score, bullish factors, bearish factors and plain-English summary. If one underlying tool is gated, unavailable or raises an error, the remaining tools still contribute to the final result (status "partial"); if every underlying tool fails, the whole call fails (status "error", isError=True) instead of a misleadingly "successful" empty analysis. Args: symbol: Stock symbol, e.g. "NVDA". refresh: Request fresh IV Radar data instead of using the backend's fresh IV cache. Defaults to False. lang: Language for `summary`, `bullish_factors` and `bearish_factors` - "en" (default), "zh" or "ja"; regional forms like "zh-CN" are accepted. Everything else in the response, `signal` included, is language-independent, so an existing caller that omits this gets byte-identical output to before.

输入参数langsymbol必填refresh

get_pretrade_risk_scan

Pre-Trade Risk Scan

Full pre-trade risk scan JSON for a stock. Pro tool ($0.15/call via x402 for anonymous callers; Credits for signed-in accounts). Signed-in hpsilab users (including Free, on its trial Credits) spend Credits from their balance at this tool's catalog price — each tool is priced differently; see GET /api/credits/catalog. Anonymous / tokenless agents pay per call via x402 (USDC on Base) when payments are enabled — send the x402 payment in the request _meta. Args: symbol: Stock symbol, e.g. "NVDA".

输入参数symbol必填

generate_stock_images

Stock Chart Generator

Generate stock-report PNG images and return their URLs. This is intentionally separate from analyze_stock so the JSON analysis stays fast and light. The backend reuses the same Growth Engine image generators used by email/social publishing. Args: symbol: Stock symbol, e.g. "RXRX". force: Regenerate images instead of using cached PNGs. Defaults to True so manually requested images reflect the latest available data. types: Optional subset of chart types. Allowed values are "ai_prediction", "iv_radar", "option_pressure", "monte_carlo", and "equity_curves". Omit to generate every chart type.

输入参数forcetypessymbol必填

generate_stock_research_report

Stock Research Report

Full markdown research report with five stock-report charts. Pro tool ($0.35/call via x402 for anonymous callers; free within plan limits for signed-in accounts, subject to a monthly report quota). Runs analyze_stock and stock-report image generation concurrently, then renders a presentation-ready markdown report (direction, direction score, bullish / bearish factors, source-tool status, and the five chart embeds). The markdown is returned for display and the same data is mirrored in structured JSON. Signed-in hpsilab users call this within their plan's free rate limits. Anonymous / tokenless agents pay per call via x402 (USDC on Base) when payments are enabled — send the x402 payment in the request _meta. Args: symbol: Stock symbol, e.g. "RXRX". refresh: Bypass the backend's fresh IV cache for the IV-driven modules. Defaults to False. force_images: Force a fresh image render instead of reusing the backend's image cache. Defaults to False.

输入参数symbol必填refreshforce_images

版本历史

5
  1. v0.11.1最新Oct 24, 2026
  2. v0.11.0Oct 12, 2026
  3. v0.10.2Oct 12, 2026
  4. v0.10.1Sep 30, 2026
  5. v0.10.0Sep 16, 2026

评分

已满足适用检查项的 100%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Finance 集成