Metadata-Version: 2.4
Name: xueqiu-stock-mcp
Version: 0.1.2
Summary: 基于雪球数据源的 MCP 服务器，提供 A 股行情查询、K 线数据和技术指标计算
License-Expression: MIT
License-File: LICENSE
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27.0
Requires-Dist: mcp[cli]>=1.0.0
Requires-Dist: playwright>=1.40.0
Requires-Dist: pydantic>=2.0.0
Description-Content-Type: text/markdown

# 雪球 A 股 MCP 服务器

基于雪球(Xueqiu)数据源的 MCP 服务器，提供 A 股实时行情、K 线技术指标、盘口、财务数据查询。

## 安装

```bash
pip install xueqiu-stock-mcp
python3 -m playwright install chromium  # 首次需要安装浏览器
```

## 配置

### 通用 MCP 客户端（Claude Desktop / Cursor / VS Code）

在 MCP 配置文件中添加：

```json
{
  "mcpServers": {
    "xueqiu-stock": {
      "command": "xueqiu-stock",
      "args": [],
      "env": {}
    }
  }
}
```

### QwenPaw

在 `~/.qwenpaw/config.json` 的 `mcp.clients` 中添加：

```json
{
  "xueqiu_stock": {
    "name": "xueqiu_stock",
    "description": "A股行情数据（雪球源）",
    "enabled": true,
    "transport": "stdio",
    "command": "xueqiu-stock",
    "args": [],
    "env": {},
    "cwd": ""
  }
}
```

## 提供的工具

| 工具 | 功能 |
|------|------|
| `get_stock_quote` | 实时行情（价格、涨跌幅、PE/PB、市值等） |
| `get_kline_data` | K 线数据 + 技术指标（MA/MACD/RSI/BOLL/KDJ） |
| `get_minute_data` | 分时走势（逐分钟价格和成交量） |
| `get_pankou_data` | 五档盘口（买卖五档价格和数量） |
| `get_financial` | 财务报表（利润表/资产负债表/现金流量表） |

## 使用示例

```
# 查实时行情
get_stock_quote("600160")

# 查 K 线 + MACD + KDJ
get_kline_data("SH600519", "day", -60, "MA,MACD,KDJ")

# 查财务报表
get_financial("000001", "income", 4)
```

## 依赖

- Python >= 3.10
- mcp[cli] >= 1.0.0
- httpx >= 0.27.0
- pydantic >= 2.0.0
- playwright >= 1.40.0

首次启动会自动通过 Playwright 获取雪球 Cookie。
