xstock-mcp 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -92
- package/dist/index.js +662 -14
- package/package.json +1 -1
- package/src/data/binance.ts +50 -0
- package/src/data/yahoo.ts +232 -0
- package/src/tools/crypto.ts +53 -0
- package/src/tools/index.ts +13 -3
- package/src/tools/kline.ts +91 -0
- package/src/tools/us-fundamentals.ts +174 -0
- package/src/tools/us-market.ts +78 -1
- package/src/utils/indicators.ts +178 -0
package/README.md
CHANGED
|
@@ -1,125 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
<a href="#english">English</a> | <a href="#中文">中文</a>
|
|
3
|
-
</div>
|
|
1
|
+
# xstock-mcp
|
|
4
2
|
|
|
5
|
-
|
|
3
|
+
基于 MCP 协议的股票与加密货币分析服务器,支持美股、加密货币、A股和港股。
|
|
6
4
|
|
|
7
|
-
##
|
|
8
|
-
|
|
9
|
-
A MCP server for stock and crypto market analysis. Supports US stocks, cryptocurrency, A-shares, and Hong Kong stocks.
|
|
10
|
-
|
|
11
|
-
### Features
|
|
12
|
-
|
|
13
|
-
- **US Stocks** — real-time quotes, K-line data, company profile, major indices (S&P 500, NASDAQ, Dow Jones, Russell 2000, VIX)
|
|
14
|
-
- **Cryptocurrency** — market overview, fear & greed index, top coins by market cap, sector categories, perpetual funding rates
|
|
15
|
-
- **A-shares & HK Stocks** — real-time quotes via Tencent Finance
|
|
16
|
-
- **Stock Search** — search any symbol by name or ticker
|
|
17
|
-
|
|
18
|
-
### Tools
|
|
19
|
-
|
|
20
|
-
| Tool | Description |
|
|
21
|
-
|------|-------------|
|
|
22
|
-
| `get_quote` | Real-time price quote for US stocks, crypto, A-shares, HK stocks |
|
|
23
|
-
| `get_kline` | K-line (OHLCV) data — daily / weekly / monthly |
|
|
24
|
-
| `search_stock` | Search stocks and crypto by keyword |
|
|
25
|
-
| `get_us_indices` | Major US market indices |
|
|
26
|
-
| `get_stock_profile` | Company profile and fundamentals |
|
|
27
|
-
| `get_crypto_overview` | Global crypto market cap + fear & greed index |
|
|
28
|
-
| `get_crypto_top` | Top N coins by market cap |
|
|
29
|
-
| `get_crypto_categories` | Crypto sector categories (DeFi, Layer1, AI, GameFi…) |
|
|
30
|
-
| `get_funding_rate` | Binance perpetual contract funding rates |
|
|
31
|
-
|
|
32
|
-
### Installation
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
npx stock-mcp
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
Or install globally:
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
npm install -g stock-mcp
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### Claude Desktop Configuration
|
|
45
|
-
|
|
46
|
-
Add to your `claude_desktop_config.json`:
|
|
47
|
-
|
|
48
|
-
```json
|
|
49
|
-
{
|
|
50
|
-
"mcpServers": {
|
|
51
|
-
"stock-mcp": {
|
|
52
|
-
"command": "npx",
|
|
53
|
-
"args": ["-y", "stock-mcp"]
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### Development
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
git clone https://github.com/gxz2019/stock-mcp.git
|
|
63
|
-
cd stock-mcp
|
|
64
|
-
npm install
|
|
65
|
-
npm run build
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
---
|
|
69
|
-
|
|
70
|
-
## 中文
|
|
71
|
-
|
|
72
|
-
股票与加密货币市场分析的 MCP 服务器,支持美股、加密货币、A股和港股。
|
|
73
|
-
|
|
74
|
-
### 功能特性
|
|
5
|
+
## 功能
|
|
75
6
|
|
|
76
7
|
- **美股** — 实时行情、K线数据、公司简介、主要指数(标普500、纳斯达克、道琼斯、罗素2000、VIX)
|
|
77
8
|
- **加密货币** — 市场概况、恐惧贪婪指数、市值排名、赛道分类、永续合约资金费率
|
|
78
|
-
- **A股 & 港股** —
|
|
9
|
+
- **A股 & 港股** — 腾讯财经实时行情
|
|
79
10
|
- **股票搜索** — 按名称或代码搜索任意标的
|
|
80
11
|
|
|
81
|
-
|
|
12
|
+
## 工具列表
|
|
82
13
|
|
|
83
14
|
| 工具 | 说明 |
|
|
84
15
|
|------|------|
|
|
85
|
-
| `get_quote` |
|
|
86
|
-
| `get_kline` | K
|
|
16
|
+
| `get_quote` | 实时报价(美股 / 加密货币 / A股 / 港股) |
|
|
17
|
+
| `get_kline` | K线数据,支持日线 / 周线 / 月线 |
|
|
87
18
|
| `search_stock` | 按关键词搜索股票和加密货币 |
|
|
88
19
|
| `get_us_indices` | 美国主要市场指数 |
|
|
89
|
-
| `get_stock_profile` |
|
|
20
|
+
| `get_stock_profile` | 公司基本面信息 |
|
|
90
21
|
| `get_crypto_overview` | 全球加密市场总市值 + 恐惧贪婪指数 |
|
|
91
22
|
| `get_crypto_top` | 按市值排名的 Top N 币种 |
|
|
92
23
|
| `get_crypto_categories` | 加密货币赛道分类(DeFi、Layer1、AI、GameFi…) |
|
|
93
24
|
| `get_funding_rate` | Binance 永续合约资金费率 |
|
|
94
25
|
|
|
95
|
-
|
|
26
|
+
## 使用方法
|
|
96
27
|
|
|
97
|
-
|
|
98
|
-
npx stock-mcp
|
|
99
|
-
```
|
|
28
|
+
### Claude Desktop
|
|
100
29
|
|
|
101
|
-
|
|
30
|
+
编辑配置文件:
|
|
31
|
+
- macOS:`~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
32
|
+
- Windows:`%APPDATA%\Claude\claude_desktop_config.json`
|
|
102
33
|
|
|
103
|
-
|
|
104
|
-
npm install -g stock-mcp
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
### Claude Desktop 配置
|
|
108
|
-
|
|
109
|
-
在 `claude_desktop_config.json` 中添加:
|
|
34
|
+
添加以下内容:
|
|
110
35
|
|
|
111
36
|
```json
|
|
112
37
|
{
|
|
113
38
|
"mcpServers": {
|
|
114
|
-
"
|
|
39
|
+
"xstock-mcp": {
|
|
115
40
|
"command": "npx",
|
|
116
|
-
"args": ["-y", "
|
|
41
|
+
"args": ["-y", "xstock-mcp"]
|
|
117
42
|
}
|
|
118
43
|
}
|
|
119
44
|
}
|
|
120
45
|
```
|
|
121
46
|
|
|
122
|
-
|
|
47
|
+
保存后重启 Claude Desktop 即可使用。
|
|
48
|
+
|
|
49
|
+
### 其他支持 MCP 的客户端(Cursor、OpenClaw 等)
|
|
50
|
+
|
|
51
|
+
配置方式相同,将上面的 JSON 添加到对应客户端的 MCP 配置文件中。
|
|
52
|
+
|
|
53
|
+
## 本地开发
|
|
123
54
|
|
|
124
55
|
```bash
|
|
125
56
|
git clone https://github.com/gxz2019/stock-mcp.git
|