Skip to main content
Glama
Xueqiu MCP

Xueqiu MCP

by liqiongyu

Xueqiu MCP

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

项目简介

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

Related MCP server: AI-Kline MCP Server

安装方法

本项目使用uv进行依赖管理。请按照以下步骤进行安装:

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

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

配置

配置雪球Token

  1. 在项目根目录创建.env文件

  2. 添加以下内容:

XUEQIU_TOKEN=您的雪球token
  • 快捷方式:

echo 'XUEQIU_TOKEN="xq_a_token=xxxxx;u=xxxx"' > .env

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

运行服务

使用以下命令启动MCP服务:

uv --directory /path/to/xueqiu_mcp run main.py

或者,如果您已经配置了Claude Desktop:

"xueqiu-mcp": {
  "args": [
    "--directory",
    "/path/to/xueqiu_mcp",
    "run",
    "main.py"
  ],
  "command": "uv"
}

功能特性

  • 获取股票实时行情

  • 查询指数收益

  • 获取深港通/沪港通北向数据

  • 基金相关数据查询

  • 关键词搜索股票代码

展示图

image

image

致谢

许可证

MIT License

Available Tools

45 tools
balanceB

获取资产负债表数据

Args:
    stock_code: 股票代码
    is_annals: 只获取年报,默认为1
    count: 返回数据数量,默认5条

Inputs: stock_code, is_annals, count.

blocktransC

获取大宗交易数据

Inputs: stock_code.

bonusC

获取F10分红融资数据

Args:
    stock_code: 股票代码
    page: 第几页 默认1
    size: 每页含有多少数据 默认10

Inputs: stock_code, page, size.

businessC

获取主营业务构成数据

Args:
    stock_code: 股票代码
    count: 返回数据数量,默认5条

Inputs: stock_code, count.

capital_assortC

获取资金成交分布数据

Inputs: stock_code.

capital_flowC

获取当日资金流如流出数据,每分钟数据

Inputs: stock_code.

capital_historyC

获取历史资金流如流出数据,每日数据

Inputs: stock_code.

cash_flowC

获取现金流量表数据

Args:
    stock_code: 股票代码
    is_annals: 只获取年报,默认为1
    count: 返回数据数量,默认5条

Inputs: stock_code, is_annals, count.

convertible_bondC

获取可转债信息

Args:
    page_size: 每页显示数量
    page_count: 页码

Inputs: page_size, page_count.

earningforecastC

按年度获取业绩预告数据

Inputs: stock_code.

fund_achievementC

获取基金业绩表现数据

Args:
    fund_code: 基金代码

Inputs: fund_code.

fund_assetC

获取基金资产配置数据

Args:
    fund_code: 基金代码

Inputs: fund_code.

fund_derivedC

获取基金衍生数据

Args:
    fund_code: 基金代码

Inputs: fund_code.

fund_detailC

获取基金详细信息

Args:
    fund_code: 基金代码

Inputs: fund_code (required).

fund_growthC

获取基金增长数据

Args:
    fund_code: 基金代码

Inputs: fund_code.

fund_infoC

获取基金基本信息

Args:
    fund_code: 基金代码

Inputs: fund_code.

fund_managerC

获取基金经理信息

Args:
    fund_code: 基金代码

Inputs: fund_code.

fund_nav_historyC

获取基金历史净值数据

Args:
    fund_code: 基金代码

Inputs: fund_code.

fund_trade_dateC

获取基金交易日期信息

Args:
    fund_code: 基金代码

Inputs: fund_code.

holdersC

获取F10股东人数数据

Inputs: stock_code.

incomeB

获取利润表数据

Args:
    stock_code: 股票代码
    is_annals: 只获取年报,默认为1
    count: 返回数据数量,默认5条

Inputs: stock_code, is_annals, count.

index_basic_infoC

获取指数基本信息

Args:
    index_code: 指数代码

Inputs: index_code.

index_details_dataC

获取指数详细信息

Args:
    index_code: 指数代码

Inputs: index_code.

index_perf_30C

获取指数最近30天收益数据

Args:
    index_code: 指数代码

Inputs: index_code.

index_perf_7C

获取指数最近7天收益数据

Args:
    index_code: 指数代码

Inputs: index_code.

index_perf_90C

获取指数最近90天收益数据

Args:
    index_code: 指数代码

Inputs: index_code.

index_weight_top10C

获取指数权重股前十

Args:
    index_code: 指数代码

Inputs: index_code.

indicatorC

按年度、季度获取业绩报表数据

Args:
    stock_code: 股票代码
    is_annals: 只获取年报,默认为1
    count: 返回数据数量,默认5条

Inputs: stock_code, is_annals, count.

industry_compareC

获取F10行业对比数据

Inputs: stock_code.

klineC

获取K线数据。第二参数可制定从现在到N天前,默认100

Inputs: stock_code, days.

main_indicatorC

获取F10主要指标数据

Inputs: stock_code.

marginC

获取融资融券数据

Inputs: stock_code.

northbound_shareholding_shB

获取深港通北向数据

Args:
    date: 日期,默认当天,格式:'2022/01/19'

Inputs: date.

northbound_shareholding_szC

获取沪港通北向数据

Args:
    date: 日期,默认当天,格式:'2022/01/19'

Inputs: date.

org_holding_changeC

获取F10机构持仓数据

Inputs: stock_code.

pankouC

获取实时分笔数据,可以实时取得股票当前报价和成交信息

Inputs: stock_code.

quotecC

获取某支股票的行情数据

Inputs: stock_code.

quote_detailC

获取某支股票的行情数据-详细

Inputs: stock_code.

rebalancing_historyC

获取组合历史交易信息

Args:
    cube_symbol: 组合代码

Inputs: cube_symbol.

reportC

获取机构评级数据

Inputs: stock_code.

suggest_stockC

关键词搜索股票代码

Args:
    keyword: 关键词

Inputs: keyword.

top_holdersB

获取十大股东数据

Args:
    stock_code: 股票代码
    circula: 只获取流通股,默认为1

Inputs: stock_code, circula.

watch_listC

获取用户自选列表

Inputs: no named parameters.

watch_stockC

获取用户自选列表详情

Args:
    pid: 自选列表ID

Inputs: pid (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.8/5.0

    Scored across 45 tools

    Disambiguation3/5

    Most tools have distinct purposes targeting specific financial data types (e.g., balance sheet, cash flow, fund info), but there is some overlap in tools like quotec and quote_detail for stock quotes, and multiple fund tools (fund_info, fund_detail) could be confusing. The descriptions help differentiate, but the sheer number increases potential for misselection.

    Naming Consistency4/5

    Naming is mostly consistent with snake_case and descriptive nouns (e.g., capital_flow, income, fund_manager), with clear patterns for related tools (e.g., index_perf_30, index_perf_90). Minor deviations exist, such as pankou (non-English) and quotec (abbreviated), but overall the conventions are readable and predictable.

    Tool Count2/5

    With 45 tools, the count is excessive for a financial data server, making it heavy and potentially overwhelming. While the domain is broad (stocks, funds, indices, etc.), many tools could be consolidated (e.g., multiple fund tools, index performance periods), indicating poor scoping and unnecessary fragmentation.

    Completeness4/5

    The tool set covers a wide range of financial data, including stocks, funds, indices, and market metrics, with good CRUD-like coverage for key entities (e.g., financial statements, fund details). Minor gaps exist, such as limited update/delete operations typical for read-only data, but agents can likely access most needed information without major dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      D
      maintenance
      The MCP provides comprehensive financial data and analytical tool support for AI large language models, specifically including the following five core data capabilities: Stock Analysis/ETF Analysis/Public Funds/News & Information/General Tools More Info: https://github.com/shenqingtech/deepq-finan
      44
      8
      ISC
    • F
      license
      Not graded
      quality
      D
      maintenance
      MCP server adapter that exposes A-share stock data tools, prompts, and resources via FastMCP, enabling querying of stocks, K-lines, financials, sectors, and market hot spots through natural language.
      -
    • A
      license
      A
      quality
      C
      maintenance
      An MCP server for Xueqiu (Snowball) that exposes community posts, stock quotes, watchlists, portfolios, and market news to AI assistants through standard Model Context Protocol tools.
      32
      1
      MIT

    Appeared in Searches