Skip to main content

Snowball MCP (雪球 MCP)

基于雪球API的MCP服务,让您通过Claude或其他AI助手轻松获取股票数据。

项目简介

本项目基于pysnowball封装了雪球API,并通过MCP协议提供服务,使您能够在Claude等AI助手中直接查询股票数据。

安装方法

方式一:在线安装(推荐)✨

无需克隆仓库,直接使用 uvx 运行:

# 设置环境变量
export XUEQIU_TOKEN="xq_a_token=xxxxx;u=xxxx"

# 直接运行
uvx snowball-mcp

方式二:Claude Desktop / Cursor / MCPHub 配置

在 MCP 客户端配置文件中添加:

{
  "mcpServers": {
    "snowball-mcp": {
      "command": "uvx",
      "args": ["snowball-mcp"],
      "env": {
        "XUEQIU_TOKEN": "xq_a_token=xxxxx;u=xxxx"
      }
    }
  }
}

方式三:本地开发安装

# 克隆仓库
git clone https://github.com/xunzhimeng/xueqiu_mcp.git
cd xueqiu_mcp

# 使用uv安装依赖
uv pip install -e .

# 创建 .env 文件配置 token
echo 'XUEQIU_TOKEN="xq_a_token=xxxxx;u=xxxx"' > .env

# 运行
snowball-mcp

配置雪球Token

关于如何获取雪球token,请参考pysnowball文档。

多 Token 配置(可选)

为了分散请求压力、减少限流错误,支持配置多个 Token:

# 方式一:逗号分隔
XUEQIU_TOKEN="token1,token2,token3"

# 方式二:多个环境变量
XUEQIU_TOKEN_1="token1"
XUEQIU_TOKEN_2="token2"
XUEQIU_TOKEN_3="token3"

多 Token 会自动轮换使用,当某个 Token 连续失败时会临时禁用并切换到下一个。

功能特性

  • 获取股票实时行情
  • 获取K线数据(支持日/周/月/季/年线和分钟级数据)
  • 查询指数收益
  • 获取深港通/沪港通北向数据
  • 基金相关数据查询
  • 关键词搜索股票代码
  • 财务报表数据(利润表、资产负债表、现金流量表等)
  • 资金流向数据
  • 融资融券数据
  • 大宗交易数据
  • 机构评级和持仓数据

无需登录的功能

以下功能无需配置 Token 即可使用:

  • suggest_stock - 股票搜索
  • quotec - 基础行情
  • pankou - 盘口数据

展示图

image

image

致谢

本项目 fork 自 liqiongyu/xueqiu_mcp,在此基础上进行了改进和优化。

许可证

MIT License

Metadata

Release files for snowball-mcp 0.2.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for snowball-mcp 0.2.8
File Size Uploaded Provenance
snowball_mcp-0.2.8.tar.gz 496.6 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for snowball-mcp 0.2.8
File Interpreter ABI Platform
snowball_mcp-0.2.8-py3-none-any.whl Python 3 none any Details

Total release size: 513.6 kB

Release files / snowball_mcp-0.2.8.tar.gz

Download URL snowball_mcp-0.2.8.tar.gz
Size 496.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5f2fc5fd564ab4432d4acba1730bbeb5cfa0cf7c783386440c409c90acdee390
BLAKE2b-256 checksum
How to use checksums
0d5bcb5fe83733fdca676aeac9bfa3ebad008f5e44b1f76bdc6b1258498654b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 7, 2026.

Transparency log

Release files / snowball_mcp-0.2.8-py3-none-any.whl

Download URL snowball_mcp-0.2.8-py3-none-any.whl
Size 17.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
738c9374cbbc001efb1b60c36b9d1be3be90ec3da1423134d57280ee730e5bb9
BLAKE2b-256 checksum
How to use checksums
8478f045861be271d36108e0868a233043a0159a107e0a800a5f9164d4715b97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 7, 2026.

Transparency log

Security for snowball-mcp 0.2.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for snowball_mcp-0.2.8.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 7, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page