基于雪球数据源的 MCP 服务器,提供 A 股行情查询、K 线数据和技术指标计算
Project description
雪球 A 股 MCP 服务器
基于雪球(Xueqiu)数据源的 MCP 服务器,提供 A 股实时行情、K 线技术指标、盘口、财务数据查询。
一键安装
bash <(curl -sL https://raw.githubusercontent.com/user/mcp-xueqiu-stock/main/install.sh)
或手动安装:
pip install xueqiu-stock-mcp
python3 -m playwright install chromium
前置依赖
| 依赖 | 说明 | 安装方式 |
|---|---|---|
| Python >= 3.10 | 运行环境 | brew install python3 / sudo apt install python3 |
| Playwright | 浏览器自动化(获取雪球 Cookie) | pip install playwright |
| Chromium | 浏览器引擎(Playwright 使用) | python3 -m playwright install chromium |
为什么需要 Chromium? 雪球使用阿里云 WAF 保护 API,需要通过浏览器执行 JavaScript 获取认证 Cookie。Playwright + Chromium 是当前唯一可靠的方案。
MCP 配置
{
"mcpServers": {
"xueqiu-stock": {
"command": "xueqiu-stock",
"args": []
}
}
}
配置文件位置:
- Claude Desktop:
~/.claude/claude_desktop_config.json - Cursor: 项目根目录
/.cursor/mcp.json - VS Code: 项目根目录
/.vscode/mcp.json - QwenPaw:
~/.qwenpaw/config.json→mcp.clients
提供的工具
| 工具 | 功能 |
|---|---|
get_stock_quote |
实时行情(价格、涨跌幅、PE/PB、市值等) |
get_kline_data |
K 线数据 + 技术指标(MA/MACD/RSI/BOLL/KDJ) |
get_minute_data |
分时走势(逐分钟价格和成交量) |
get_pankou_data |
五档盘口(买卖五档价格和数量) |
get_financial |
财务报表(利润表/资产负债表/现金流量表) |
故障排除
首次启动很慢?
Playwright 首次获取 Cookie 需要 ~10 秒,后续请求 < 1 秒。
报错 "缺少 playwright"?
pip install playwright
python3 -m playwright install chromium
报错 "Cookie 获取失败"?
可能是网络问题,服务会自动重试。如持续失败,检查是否能访问 xueqiu.com。
PyPI
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
xueqiu_stock_mcp-0.1.3.tar.gz
(73.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xueqiu_stock_mcp-0.1.3.tar.gz.
File metadata
- Download URL: xueqiu_stock_mcp-0.1.3.tar.gz
- Upload date:
- Size: 73.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.10 {"installer":{"name":"uv","version":"0.11.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
daa0a590e17c1e7d03b40be55fca07868ac9159a3129b62d9b66c1aca1d74417
|
|
| MD5 |
3a6531d91feea7f848c5d3c87c1fe943
|
|
| BLAKE2b-256 |
38e41bb8bd7283ad170795037ede57ae277f6668ea2e19ad52647fe7ff759118
|
File details
Details for the file xueqiu_stock_mcp-0.1.3-py3-none-any.whl.
File metadata
- Download URL: xueqiu_stock_mcp-0.1.3-py3-none-any.whl
- Upload date:
- Size: 23.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.10 {"installer":{"name":"uv","version":"0.11.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3a2a8fc12f21d6179009c4400238b8e223ba7835fff2d462915ccbf43e01378
|
|
| MD5 |
8d9849628da316060bd03dacf0796ee9
|
|
| BLAKE2b-256 |
737b0d1b990a8f158c92f81f28fa362a9c84f287a01152b09afb018e3b8d119b
|