# AlphaBook Risk Lab MCP (`neeenja/alphabook-risk-lab`) Actor

Risk analytics engine as a remote MCP server. Six tools: get_volatility, get_max_drawdown, get_beta, get_var, get_correlation, rank_risk.

- **URL**: https://apify.com/neeenja/alphabook-risk-lab.md
- **Developed by:** [Neeen Ja](https://apify.com/neeenja) (community)
- **Categories:** MCP servers, AI
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $20.00 / 1,000 analysis calls

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## AlphaBook Risk Lab MCP

Risk analytics engine as a remote MCP server. It gives your agent **risk metrics with interpretation and invalidation levels** — not a pile of raw price series. Six tools cover realized volatility, maximum drawdown, market beta, historical VaR, correlation and a basket risk ranking. All metrics are pure price-derived and work on A-shares, HK, US and global markets through free public data. No API key. **Not investment advice.**

> **Honest boundary:** historical VaR only reflects the in-sample tail and underestimates real risk in fat-tailed / gap events; beta and correlation depend on aligned return samples and can break down in crises (correlations converge to 1). These limits are declared in every tool output. A low risk score is not a guarantee of safety.

### Tools

| Tool | Event | Returns |
|------|-------|---------|
| `get_volatility` | tool-call $0.02 | Annualized realized volatility + risk band |
| `get_max_drawdown` | tool-call $0.02 | Peak-to-trough max drawdown + severity band + trough date |
| `get_beta` | tool-call $0.02 | Market beta vs benchmark (default CSI 300) + defensive/aggressive read |
| `get_var` | tool-call $0.02 | 1-day historical VaR at configurable confidence (default 95%) |
| `get_correlation` | tool-call $0.02 | Pearson correlation of two assets + diversifying/concentrated read |
| `rank_risk` | **screen-call $0.05** | Composite risk ranking of up to 10 codes (lower = safer) |

### Connect (MCP client)

```
https://neeenja--alphabook-risk-lab.apify.actor/mcp
Authorization: Bearer <APIFY_TOKEN>
```

POST JSON-RPC: `initialize`, `tools/list`, `tools/call`. Example:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": { "name": "get_volatility", "arguments": { "code": "600519" } }
}
```

### Pricing

Pay-per-event. `initialize` and `tools/list` are free. Each analysis call is **$0.02**; a composite basket risk ranking (`rank_risk`) is **$0.05** because it scores up to 10 symbols.

### Data sources & honest limits

- **Klines:** Tencent `gtimg.cn` (A/HK/US) and Yahoo (global). Free, no key.
- Missing data → `n/a`, never a fabricated `0`.
- Every output carries a `NOT_ADVICE` disclaimer.

***

## AlphaBook 风险实验室 MCP

风险分析引擎，以远程 MCP 服务器形式提供。它给 agent 的是 **带解读与失效位的风险指标**，而非一堆原始价格序列。六个工具覆盖已实现波动率、最大回撤、市场 Beta、历史 VaR、相关性与篮子风险排名。全部指标纯价格派生，支持 A 股、港股、美股与全球市场，免费公开数据，无需 API Key。**不构成投资建议。**

> **诚实边界：** 历史法 VaR 仅反映样本内尾部，对肥尾/跳空行情会低估真实风险；Beta 与相关依赖对齐收益样本，危机期可能失效（相关性向 1 收敛）。这些限制在工具输出中均如实声明。风险分低≠一定安全。

### 工具

| 工具 | 计费事件 | 返回 |
|------|----------|------|
| `get_volatility` | tool-call $0.02 | 年化已实现波动率 + 风险档位 |
| `get_max_drawdown` | tool-call $0.02 | 峰谷最大回撤 + 严重档位 + 回撤谷日期 |
| `get_beta` | tool-call $0.02 | 对基准的 Beta（默认沪深300）+ 防御/进攻判读 |
| `get_var` | tool-call $0.02 | 可配置信度的单日历史 VaR（默认 95%） |
| `get_correlation` | tool-call $0.02 | 两资产 Pearson 相关性 + 可分散/集中判读 |
| `rank_risk` | **screen-call $0.05** | 最多 10 只标的的综合风险排名（越低越安全） |

### 连接（MCP 客户端）

```
https://neeenja--alphabook-risk-lab.apify.actor/mcp
Authorization: Bearer <APIFY_TOKEN>
```

发送 JSON-RPC：`initialize`、`tools/list`、`tools/call`。示例：

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": { "name": "get_volatility", "arguments": { "code": "600519" } }
}
```

### 计费

按事件付费。`initialize` 与 `tools/list` 免费。每次分析调用 **$0.02**；篮子风险排名（`rank_risk`）为 **$0.05**，因其最多评分 10 只标的。

### 数据源与诚实边界

- **K 线：** 腾讯 `gtimg.cn`（A/港/美）与 Yahoo（全球），免费、无 Key。
- 数据缺失 → 返回 `n/a`，绝不编造 `0`。
- 所有输出均带 `NOT_ADVICE` 免责声明。

***

## AlphaBook 風險實驗室 MCP

風險分析引擎，以遠端 MCP 伺服器形式提供。它給 agent 的是 **帶解讀與失效位的風險指標**，而非一堆原始價格序列。六個工具涵蓋已實現波動率、最大回撤、市場 Beta、歷史 VaR、相關性與籃子風險排名。全部指標純價格派生，支援 A 股、港股、美股與全球市場，免費公開資料，無需 API Key。**不構成投資建議。**

> **誠實邊界：** 歷史法 VaR 僅反映樣本內尾部，對肥尾/跳空行情會低估真實風險；Beta 與相關依賴對齊收益樣本，危機期可能失效（相關性向 1 收斂）。這些限制在工具輸出中均如實聲明。風險分低≠一定安全。

### 工具

| 工具 | 計費事件 | 回傳 |
|------|----------|------|
| `get_volatility` | tool-call $0.02 | 年化已實現波動率 + 風險檔位 |
| `get_max_drawdown` | tool-call $0.02 | 峰谷最大回撤 + 嚴重檔位 + 回撤谷日期 |
| `get_beta` | tool-call $0.02 | 對基準的 Beta（預設滬深300）+ 防禦/進攻判讀 |
| `get_var` | tool-call $0.02 | 可配信賴度的單日歷史 VaR（預設 95%） |
| `get_correlation` | tool-call $0.02 | 兩資產 Pearson 相關性 + 可分散/集中判讀 |
| `rank_risk` | **screen-call $0.05** | 最多 10 檔標的的綜合風險排名（越低越安全） |

### 連線（MCP 用戶端）

```
https://neeenja--alphabook-risk-lab.apify.actor/mcp
Authorization: Bearer <APIFY_TOKEN>
```

發送 JSON-RPC：`initialize`、`tools/list`、`tools/call`。範例：

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": { "name": "get_volatility", "arguments": { "code": "600519" } }
}
```

### 計費

按事件付費。`initialize` 與 `tools/list` 免費。每次分析呼叫 **$0.02**；籃子風險排名（`rank_risk`）為 **$0.05**，因其最多評分 10 檔標的。

### 資料來源與誠實邊界

- **K 線：** 騰訊 `gtimg.cn`（A/港/美）與 Yahoo（全球），免費、無需 Key。
- 資料缺失 → 回傳 `n/a`，絕不編造 `0`。
- 所有輸出均附 `NOT_ADVICE` 免責聲明。

# Actor input Schema

## Actor input object example

```json
{}
```

# Actor output Schema

## `mcpEndpoint` (type: `string`):

Streamable HTTP MCP endpoint of this Actor run. Connect an MCP client here (Authorization: Bearer \<APIFY_TOKEN>). POST JSON-RPC messages: initialize, tools/list, tools/call.

## `tools` (type: `string`):

Comma-separated list of the 6 tools: get_volatility, get_max_drawdown, get_beta, get_var, get_correlation, rank_risk.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("neeenja/alphabook-risk-lab").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("neeenja/alphabook-risk-lab").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call neeenja/alphabook-risk-lab --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,neeenja/alphabook-risk-lab"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/fnOfOrr37bERglv8I/builds/eZZRMCfqQFwO4Tnhs/openapi.json
