xstock-mcp 1.0.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/LICENSE +21 -0
- package/README.md +129 -0
- package/dist/index.js +827 -0
- package/package.json +27 -0
- package/src/data/binance.ts +87 -0
- package/src/data/coingecko.ts +113 -0
- package/src/data/tencent.ts +187 -0
- package/src/data/yahoo.ts +139 -0
- package/src/index.ts +7 -0
- package/src/server.ts +40 -0
- package/src/tools/crypto.ts +145 -0
- package/src/tools/index.ts +24 -0
- package/src/tools/kline.ts +91 -0
- package/src/tools/quotes.ts +52 -0
- package/src/tools/search.ts +54 -0
- package/src/tools/types.ts +44 -0
- package/src/tools/us-market.ts +73 -0
- package/src/utils/indicators.ts +0 -0
- package/src/utils/symbol.ts +0 -0
- package/test/data-binance.ts +68 -0
- package/test/data-coingecko.ts +71 -0
- package/test/data-tencent.ts +90 -0
- package/test/data-yahoo.ts +84 -0
- package/tsconfig.json +14 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 gxz2019
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
<div align="right">
|
|
2
|
+
<a href="#english">English</a> | <a href="#中文">中文</a>
|
|
3
|
+
</div>
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## English
|
|
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
|
+
### 功能特性
|
|
75
|
+
|
|
76
|
+
- **美股** — 实时行情、K线数据、公司简介、主要指数(标普500、纳斯达克、道琼斯、罗素2000、VIX)
|
|
77
|
+
- **加密货币** — 市场概况、恐惧贪婪指数、市值排名、赛道分类、永续合约资金费率
|
|
78
|
+
- **A股 & 港股** — 通过腾讯财经获取实时行情
|
|
79
|
+
- **股票搜索** — 按名称或代码搜索任意标的
|
|
80
|
+
|
|
81
|
+
### 工具列表
|
|
82
|
+
|
|
83
|
+
| 工具 | 说明 |
|
|
84
|
+
|------|------|
|
|
85
|
+
| `get_quote` | 美股、加密货币、A股、港股实时报价 |
|
|
86
|
+
| `get_kline` | K线数据(OHLCV),支持日线/周线/月线 |
|
|
87
|
+
| `search_stock` | 按关键词搜索股票和加密货币 |
|
|
88
|
+
| `get_us_indices` | 美国主要市场指数 |
|
|
89
|
+
| `get_stock_profile` | 公司基本面和简介 |
|
|
90
|
+
| `get_crypto_overview` | 全球加密市场总市值 + 恐惧贪婪指数 |
|
|
91
|
+
| `get_crypto_top` | 按市值排名的 Top N 币种 |
|
|
92
|
+
| `get_crypto_categories` | 加密货币赛道分类(DeFi、Layer1、AI、GameFi…) |
|
|
93
|
+
| `get_funding_rate` | Binance 永续合约资金费率 |
|
|
94
|
+
|
|
95
|
+
### 安装
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
npx stock-mcp
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
或全局安装:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
npm install -g stock-mcp
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Claude Desktop 配置
|
|
108
|
+
|
|
109
|
+
在 `claude_desktop_config.json` 中添加:
|
|
110
|
+
|
|
111
|
+
```json
|
|
112
|
+
{
|
|
113
|
+
"mcpServers": {
|
|
114
|
+
"stock-mcp": {
|
|
115
|
+
"command": "npx",
|
|
116
|
+
"args": ["-y", "stock-mcp"]
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### 本地开发
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
git clone https://github.com/gxz2019/stock-mcp.git
|
|
126
|
+
cd stock-mcp
|
|
127
|
+
npm install
|
|
128
|
+
npm run build
|
|
129
|
+
```
|