Skip to main content
Glama

📊 a-share-mcp 📈

License Python Package Manager MCP

A股 MCP 服务器,支持实时行情与历史数据查询。

本项目是一个专注于 A 股市场的 MCP 服务器,提供盘中实时行情、股票基本信息、历史 K 线数据、财务指标、宏观经济数据等多种查询功能。支持实时K线、技术指标计算(MACD/KDJ/RSI/BOLL等),理论上可以回答有关 A 股市场的任何问题,无论是针对大盘还是特定股票。

项目结构

a_share_mcp/
│
├── mcp_server.py           # 主服务器入口文件
├── pyproject.toml          # 项目依赖配置
├── README.md               # 项目说明文档
│
├── src/                    # 源代码目录
│   ├── __init__.py
│   ├── baostock_data_source.py   # Baostock数据源实现
│   ├── ashare_data_source.py     # Sina/Tencent数据源实现 (新增)
│   ├── data_source_interface.py  # 数据源接口定义
│   ├── utils.py                  # 通用工具函数
│   │
│   ├── formatting/         # 数据格式化模块
│   │   ├── __init__.py
│   │   └── markdown_formatter.py  # Markdown格式化工具
│   │
│   ├── use_cases/          # 业务逻辑层
│   │   ├── stock_market.py        # 股票市场业务逻辑
│   │   ├── realtime_market.py     # 实时行情业务逻辑 (重构)
│   │   ├── market_data.py         # 市场数据业务逻辑 (新增)
│   │   └── ...
│   │
│   └── tools/              # MCP工具模块
│       ├── __init__.py
│       ├── base.py                # 基础工具函数
│       ├── stock_market.py        # 股票市场数据工具
│       ├── realtime_market.py     # 实时行情数据工具 (重构)
│       ├── market_data.py         # 市场数据工具 (新增)
│       ├── financial_reports.py   # 财务报表工具
│       ├── indices.py             # 指数相关工具
│       ├── market_overview.py     # 市场概览工具
│       ├── macroeconomic.py       # 宏观经济数据工具
│       ├── date_utils.py          # 日期工具
│       └── analysis.py            # 分析工具
│
└── resource/               # 资源文件
    └── img/                # 图片资源
        ├── img_1.png       # CherryStudio配置示例
        └── img_2.png       # CherryStudio配置示例

Related MCP server: A股实时行情MCP服务器

功能特点

🆕 实时行情数据

  • 实时行情快照: 用分钟K线聚合今日数据,日期和涨跌幅语义正确

  • 当日分钟K线: 获取今日 1/5/15/30/60 分钟K线数据

  • 批量查询: 一次查询多只股票,按涨跌幅排序

  • 实时K线: 支持历史 K 线数据,包括 1/5/15/30/60 分钟线、日线、周线、月线

  • 技术指标: MACD, KDJ, RSI, BOLL, MA 等 12+ 种技术指标实时计算

  • 市场数据: 热点板块、大盘指数、龙虎榜、北向资金、涨跌停统计等

  • 数据源: Sina/Tencent 双核心封装,无需登录,盘中即时更新

先决条件

  1. Python 环境: Python 3.12+

  2. 依赖管理: 使用 uv 包管理器安装依赖

  3. 数据来源: 基于 Baostock 数据源 + 腾讯/新浪实时数据源,无需付费账号

数据更新时间

📊 Baostock 历史数据(延迟数据)

以下是 Baostock 官方数据更新时间,请注意查询最新数据时的时间点 Baostock 官网

每日数据更新时间:

  • 当前交易日 17:30,完成日 K 线数据入库

  • 当前交易日 18:00,完成复权因子数据入库

  • 第二自然日 11:00,完成分钟 K 线数据入库

  • 第二自然日 1:30,完成前交易日"其它财务报告数据"入库

  • 周六 17:30,完成周线数据入库

每周数据更新时间:

  • 每周一下午,完成上证 50 成份股、沪深 300 成份股、中证 500 成份股信息数据入库

所以说,在交易日的当天,如果是在 17:30 之前询问当天的数据,是无法获取到的。

🟢 实时行情数据(盘中即时)

新增的实时行情工具使用腾讯/新浪数据源,盘中即时更新,无需等待。

实时数据特点:

  • 盘中即时: 交易时间内数据实时更新

  • 无需登录: 直接通过公开 API 获取

  • 支持分钟线: 1/5/15/30/60 分钟 K 线盘中可用

  • 技术指标: 基于实时数据计算,盘中可分析

适用场景:

  • 需要当日盘中实时价格

  • 需要分钟级别 K 线数据

  • 需要实时技术指标分析

安装环境

在项目根目录下执行:

# 1. 创建虚拟环境
uv venv

# 2. 激活虚拟环境
source .venv/bin/activate

# 3. 安装所有依赖
uv sync

使用:在 MCP 客户端中配置服务器

在支持 MCP 的客户端(如 Chatbox、VS Code 插件、CherryStudio 等)中,你需要配置如何启动此服务器。 推荐使用 uv。

方法一:使用 JSON 配置的 IDE (例如 Cursor、VSCode、Trae 等)

对于需要编辑 JSON 文件来配置 MCP 服务器的客户端,你需要找到对应的能配置 MCP 的地方(各个 IDE 和桌面 MCP Client 可能都不一样),并在 mcpServers 对象中添加一个新的条目。

JSON 配置示例 (请将路径替换为你的实际绝对路径):

{
  "mcpServers": {
    "a-share-mcp": {
      "command": "uv",
      "args": [
        "--directory",
        "/Users/YourName/Projects/a-share-mcp",
        "run",
        "python",
        "mcp_server.py"
      ],
      "transport": "stdio"
    }
  }
}

注意事项:

  • command: 确保 uv 命令可以正常执行(可通过 which uv 检查路径)

  • args: 确保参数列表完整且顺序正确

  • 路径: macOS/Linux 使用正斜杠 / 作为目录分隔符

方法二:在 Chatbox 中配置 (推荐)

Chatbox 也支持通过 stdio 启动本地 MCP 服务器,不过 没有“命令”和“参数”两个字段,只有一个命令字段,所以需要把整条命令写在一起。

  • 传输方式:stdio

  • 命令字段中直接写整条命令(请替换路径):

uv --directory "/Users/YourName/Projects/a-share-mcp" run python mcp_server.py

在 Chatbox 的 MCP 配置界面中:

  • 新增一个 MCP 服务器,名称例如:a-share-mcp

  • 选择 Transport / 传输方式 为 stdio

  • 在唯一的 Command 输入框中,粘贴上面的整条命令(记得把路径改成你本地的实际路径)

如果你已经在 Chatbox 中配置了其他 MCP(例如 cherrystudio),建议把 a-share-mcp 这一条放在它们前面,这样在问 A 股相关问题时,更优先使用本地的 a-share 数据源。

方法三:使用 CherryStudio

在 CherryStudio 的 MCP 服务器配置界面中,按如下方式填写:

  • 名称: a-share-mcp (或自定义)

  • 描述: 本地 A 股 MCP 服务器 (或自定义)

  • 类型: 选择 标准输入/输出 (stdio)

  • 命令: uv

  • 包管理源: 默认

  • 参数:

    1. --directory

    2. /Users/YourName/Projects/a-share-mcp

    3. run

    4. python

    5. mcp_server.py

  • 环境变量: (通常留空)

CherryStudio 使用示例:

CherryStudio配置示例1

CherryStudio配置示例2

常用数据能力入口

功能

MCP工具

参数与边界

历史K线与显式复权

get_price_history

adjust=raw/qfq/hfq,no_cache;与skill共用口径

财务指标与公告日期过滤

get_financials

kind、start/end、as_of;不是完整PIT

个股行业归属

get_industry_info

东财公司行业;旧get_stock_industry使用不同分类

行业目录、真实成员、行业指数历史

get_industry_data

action、taxonomy、level、symbol、start/end、no_cache

热门板块与groupKey成员

get_boards_summary、get_board_members

保留stale,require_fresh可拒绝旧快照

公司资讯和市场快讯

get_company_news、get_market_news

原始候选与来源诊断,不做语义筛选

完整参数和示例见 数据工具说明。缓存/并发由服务内部处理,使用MCP工具无需另外部署缓存服务。

工具列表

该 MCP 服务器目前提供 67 个工具,覆盖股票、财报、宏观、日期分析、实时行情等全方位数据。以下列出原有工具分组;与skill对齐的新增工具见上方入口表:

贡献指南

欢迎提交 Issue 或 Pull Request 来帮助改进项目。贡献前请先查看现有 Issue 和文档。

许可证

本项目采用 MIT 许可证 - 详情请查看 LICENSE 文件

数据修复与原始新闻(2026-10-11)

依赖使用MCP v1(mcp<2)并显式声明MyTT,无需旁目录Ashare。get_company_news(code, name="", days=7, limit=100, scope="all", no_cache=False)提供未分类新闻/公告及来源诊断。港美新闻由港美数据仓库提供。

修复了JSON日志污染、日期/NaN、OHLC列映射、休市涨跌幅与批量等待。完整实测、坏源及原始输出位置见体检报告。

与 a-share-skill 对齐

常规数据优先 get_price_history、get_financials、get_industry_info、get_boards_summary、get_board_members、get_company_news、get_market_news。它们参照a-share-data同函数/数据源,保留原始字段及stale。旧Baostock接口保留复权、完整财务维度和证监会分类语义。

对齐矩阵、同步维护与逐项输出对比。

数据口径与行业扩展

get_price_history(adjust="raw"|"qfq"|"hfq", no_cache=...)与canonical skill保持同口径降级;默认raw,缓存300秒。get_financials(as_of=...)按公告日期过滤,缺日期拒绝推断,不能声称完整PIT。get_industry_data(action="directory"|"members"|"history", taxonomy="sw"|"eastmoney_industry"|"eastmoney_concept")提供独立行业目录、真实成分与指数历史。板块/快讯facade支持require_fresh,默认保留旧快照原始数据。工具和源分别使用有上限的后台工作线程。

同步命令仍为 python scripts/sync_skill_reference.py --source ../a-share-skill;生成器保留条件导入,记录复制模块SHA256及source_worktree_dirty。只有数据内容、参数语义对齐,不能把当前成员称为历史成员。

验证报告。参考stock-api的API协议与诊断方法,未增加对父目录或Node的运行时依赖。

概念、公司事件、池详情与席位

数据

原始数据工具

公司全部展示概念及供应商入选理由

get_stock_concepts

解禁、回购计划/进展、已披露股东增减持

get_corporate_actions

涨停/炸板详情、真实交易日与市场范围

get_market_pool_details

指定股票/日期的龙虎榜买卖席位

get_lhb_seats

参数、JSON示例、原始字段单位、分页、缓存及能力边界见数据工具使用说明。这些工具与A股skill共享同一份同步代码,运行无需相邻仓库或stock-sdk服务。

Available Tools

67 tools
get_adjust_factor_dataA
    Fetches adjustment factor data for a given stock code and date range.
    Uses Baostock's "涨跌幅复权算法" factors. Useful for calculating adjusted prices.

    Args:
        code: The stock code in Baostock format (e.g., 'sh.600000', 'sz.000001').
        start_date: Start date in 'YYYY-MM-DD' format.
        end_date: End date in 'YYYY-MM-DD' format.

    Returns:
        Adjustment factors table.
    

Inputs: code (required), end_date (required), start_date (required), limit, +1 more.

get_all_stockC
    Fetch a list of all stocks (A-shares and indices) and their trading status for a date.

    Args:
        date: Optional. The date in 'YYYY-MM-DD' format. If None, uses the current date.

    Returns:
        Markdown table listing stock codes and trading status (1=trading, 0=suspended).
    

Inputs: date, limit, format.

get_balance_dataC

Quarterly balance sheet data.

Inputs: code (required), year (required), quarter (required), limit, +1 more.

get_board_membersD

Same DangInvest board-detail query as the skill; use groupKey from summary.

Inputs: group_key (required), mode, sort, limit, +4 more.

get_boards_summaryC

Same DangInvest industry/concept heatmap as a-share-data fetch_danginvest --summary.

    mode=major/sub/concept. Preserve tradeDate/snapshotTsMs/stale; stale is not today's data.
    

Inputs: mode, sort, limit, format, +2 more.

get_cash_flow_dataD

Quarterly cash flow data.

Inputs: code (required), year (required), quarter (required), limit, +1 more.

get_company_newsB

Return unclassified company news/disclosures with source/time/link diagnostics.

    code is a six-digit A-share code; scope is all/news/announcements.
    limit controls returned records, no_cache forces fresh source queries.
    

Inputs: code (required), days, name, limit, +2 more.

get_consecutive_limit_upA
    Fetches consecutive limit up stocks (连板股).
    
    Returns stocks that have been limit up for consecutive days.
    Data source: Eastmoney via Akshare.

    Args:
        date: Date in format 'YYYYMMDD'. Defaults to today.
        top_n: Number of stocks to return. Defaults to 30.
        format: Output format: 'markdown' | 'json' | 'csv'. Defaults to 'markdown'.

    Returns:
        Consecutive limit up stocks with: 代码, 名称, 连板数, 涨停统计, 所属行业
    

Inputs: date, top_n, format.

get_corporate_actionsA

Raw unlock schedules, repurchase progress or disclosed holder changes. kind=unlock/repurchase/holder_changes. Dates use FREE_DATE/UPDATEDATE/NOTICE_DATE respectively, inclusive. Without code require bounded start/end (up to366 days), except unlock defaults to next30 calendar days including today. days=1..366; direction=all/increase/decrease (holders only); limit=1..5000; max_pages=1..50; max_seconds=1..30. Partial pagination is explicit. Planned and actual amounts remain separate; holder changes do not establish complete future reduction plans.

Inputs: end, code, days, kind, +7 more.

get_deposit_rate_dataD

Benchmark deposit rates.

Inputs: limit, format, end_date, start_date.

get_dividend_dataC
    Fetches dividend information for a given stock code and year.

    Args:
        code: The stock code in Baostock format (e.g., 'sh.600000', 'sz.000001').
        year: The year to query (e.g., '2023').
        year_type: Type of year. Valid options (from Baostock):
                     'report': Announcement year (预案公告年份)
                     'operate': Ex-dividend year (除权除息年份)
                   Defaults to 'report'.

    Returns:
        Dividend records table.
    

Inputs: code (required), year (required), limit, format, +1 more.

get_dupont_dataC

Quarterly Dupont analysis data.

Inputs: code (required), year (required), quarter (required), limit, +1 more.

get_fina_indicatorA
    Aggregated financial indicators from 6 Baostock APIs into one convenient query.

    **Data is returned by QUARTER** (Q1, Q2, Q3, Q4) based on financial report dates.
    Input date range determines which quarters to fetch.

    Combines data from:
    - 盈利能力 (Profitability): roeAvg, npMargin, gpMargin, epsTTM
    - 营运能力 (Operation): NRTurnRatio, INVTurnRatio, CATurnRatio
    - 成长能力 (Growth): YOYNI, YOYEquity, YOYAsset
    - 偿债能力 (Solvency): currentRatio, quickRatio, liabilityToAsset
    - 现金流量 (Cash Flow): CFOToOR, CFOToNP, CAToAsset
    - 杜邦分析 (DuPont): dupontROE, dupontAssetTurn, dupontPnitoni

    Output columns include prefixes: profit_*, operation_*, growth_*,
    balance_*, cashflow_*, dupont_* to distinguish data sources.
    

Inputs: code (required), end_date (required), start_date (required), limit, +1 more.

get_financialsC

Same current Eastmoney/Sina indicators and period filters as a-share-data fetch_history.

    kind=financials/profit/growth/balance/cashflow/dupont. Cashflow/DuPont are related indicators,
    not a full statement or a verified decomposition. Legacy Baostock tools remain available.
    

Inputs: code (required), end, kind, year, +5 more.

get_forecast_reportC

Earnings forecast report within date range.

Inputs: code (required), end_date (required), start_date (required), limit, +1 more.

get_growth_dataD

Quarterly growth capability data.

Inputs: code (required), year (required), quarter (required), limit, +1 more.

get_historical_k_dataA
    Fetches historical K-line (OHLCV) data for a Chinese A-share stock.

    Args:
        code: The stock code in Baostock format (e.g., 'sh.600000', 'sz.000001').
        start_date: Start date in 'YYYY-MM-DD' format.
        end_date: End date in 'YYYY-MM-DD' format.
        frequency: Data frequency. Valid options (from Baostock):
                     'd': daily
                     'w': weekly
                     'm': monthly
                     '5': 5 minutes
                     '15': 15 minutes
                     '30': 30 minutes
                     '60': 60 minutes
                   Defaults to 'd'.
        adjust_flag: Adjustment flag for price/volume. Valid options (from Baostock):
                       '1': Forward adjusted (后复权)
                       '2': Backward adjusted (前复权)
                       '3': Non-adjusted (不复权)
                     Defaults to '3'.
        fields: Optional list of specific data fields to retrieve (must be valid Baostock fields).
                If None or empty, default fields will be used (e.g., date, code, open, high, low, close, volume, amount, pctChg).
        limit: Max rows to return. Defaults to 250.
        format: Output format: 'markdown' | 'json' | 'csv'. Defaults to 'markdown'.

        Returns:
            A Markdown formatted string containing the K-line data table, or an error message.
            The table might be truncated if the result set is too large.
        

Inputs: code (required), end_date (required), start_date (required), limit, +4 more.

get_hot_sectorsA
    Fetches hot concept sectors with top gains.
    
    Returns top gaining concept sectors with leading stocks and trading volume.
    Data source: Eastmoney (东方财富).

    Args:
        top_n: Number of top sectors to return. Defaults to 20.
        format: Output format: 'markdown' | 'json' | 'csv'. Defaults to 'markdown'.

    Returns:
        Hot sectors data with: 板块名称, 涨跌幅, 龙头股, 龙头涨幅, 成交额
    

Inputs: top_n, format.

get_hs300_stocksD

CSI 300 constituents.

Inputs: date, limit, format.

get_index_constituentsC

Generic index constituent fetch (hs300/sz50/zz500).

Inputs: index (required), date, limit, format.

get_industry_dataC

Canonical skill industry directory/members/index history. Explicit SW/Eastmoney taxonomies; current constituents, not historical membership.

Inputs: end, level, start, action, +3 more.

get_industry_infoC

Same Eastmoney company/industry query as a-share-data fetch_history --industry.

    Legacy get_stock_industry uses Baostock's CSRC taxonomy; standards are not interchangeable.
    

Inputs: code (required), format, with_boards.

get_industry_membersC

Get all stocks in a given industry on a date.

Inputs: industry (required), date, limit, format.

get_intraday_minute_klineA
    Fetches intraday minute K-line data for a Chinese A-share stock (today only).
    
    Returns minute-level K-line data for the current trading day.
    Data source: Sina/Tencent via AshareDataSource.

    Args:
        code: The stock code. Supports multiple formats (same as get_realtime_quote).
        frequency: Minute frequency. Valid options:
                   '1m': 1 minute
                   '5m': 5 minutes (default)
                   '15m': 15 minutes
                   '30m': 30 minutes
                   '60m': 60 minutes
        format: Output format: 'markdown' | 'json' | 'csv'. Defaults to 'markdown'.

    Returns:
        Today's minute K-line data with: 时间, 开盘, 最高, 最低, 收盘, 成交量
    

Inputs: code (required), format, frequency.

get_last_n_trading_daysC

Return the last N trading dates.

Inputs: days.

get_latest_trading_dateB

Get the latest trading date up to today.

Inputs: no named parameters.

get_lhb_detailA
    Fetches Long-Hu-Bang (龙虎榜) detail data.
    
    Long-Hu-Bang shows stocks with significant trading activity by institutional investors.
    Data source: Eastmoney via Akshare.

    Args:
        start_date: Start date in format 'YYYYMMDD'. Defaults to 3 days ago.
        end_date: End date in format 'YYYYMMDD'. Defaults to today.
        top_n: Number of records to return. Defaults to 20.
        format: Output format: 'markdown' | 'json' | 'csv'. Defaults to 'markdown'.

    Returns:
        Long-Hu-Bang data with: 代码, 名称, 上榜日期, 收盘价, 涨跌幅, 净买额, 买入额, 卖出额, 上榜原因, 解读
    

Inputs: top_n, format, end_date, start_date.

get_lhb_seatsB

Dragon-Tiger buy/sell seats for an exact stock/date using current BUY/SELL protocol. Preserve raw BUY/SELL/NET (CNY), percentage ratios, EXPLANATION and TRADE_ID; no cross-reason seat deduplication. Each side has pagination/error diagnostics. max_pages=1..50; max_seconds=1..30.

Inputs: code (required), date (required), format, no_cache, +2 more.

get_limit_down_poolA
    Fetches limit down stocks pool (跌停股池).
    
    Returns detailed list of stocks hitting daily lower price limit.
    Data source: Eastmoney via Akshare.

    Args:
        date: Date in format 'YYYYMMDD'. Defaults to today.
        top_n: Number of stocks to return. Defaults to 30.
        format: Output format: 'markdown' | 'json' | 'csv'. Defaults to 'markdown'.

    Returns:
        Limit down stocks with: 代码, 名称, 涨跌幅, 最新价, 成交额, 流通市值
    

Inputs: date, top_n, format.

get_limit_up_downC
    Fetches daily limit up and limit down stock statistics (涨跌停统计).
    
    Shows count of stocks hitting daily price limit (up or down).
    Data source: Eastmoney via Akshare.

    Args:
        format: Output format: 'markdown' | 'json' | 'csv'. Defaults to 'markdown'.

    Returns:
        Statistics with: 日期, 涨停数量, 跌停数量
    

Inputs: format.

get_limit_up_poolB
    Fetches limit up stocks pool (涨停股池).
    
    Returns detailed list of stocks hitting daily upper price limit.
    Data source: Eastmoney via Akshare.

    Args:
        date: Date in format 'YYYYMMDD'. Defaults to today.
        top_n: Number of stocks to return. Defaults to 30.
        format: Output format: 'markdown' | 'json' | 'csv'. Defaults to 'markdown'.

    Returns:
        Limit up stocks with: 代码, 名称, 涨跌幅, 最新价, 封板资金, 连板数, 首次封板时间, 所属行业
    

Inputs: date, top_n, format.

get_loan_rate_dataD

Benchmark loan rates.

Inputs: limit, format, end_date, start_date.

get_market_analysis_timeframeC

Return a human-friendly timeframe label.

Inputs: period.

get_market_indexA
    Fetches realtime market index data for major Chinese stock indices.
    
    Returns realtime data for: 上证指数, 深证成指, 创业板指, 科创50.
    Data source: Sina Finance (新浪财经).

    Args:
        format: Output format: 'markdown' | 'json' | 'csv'. Defaults to 'markdown'.

    Returns:
        Market index data with: 指数名称, 当前点位, 涨跌点数, 涨跌幅, 成交量, 成交额
    

Inputs: format.

get_market_newsD

Same DangInvest market-news JSON/freshness as a-share-data fetch_danginvest --news.

Inputs: limit, format, offset, retries, +1 more.

get_market_pool_detailsA

Raw limit-up/broken-board pool with seal times, open counts, funds and provider fields. kind=up/broken; source=auto/eastmoney/ths; market=all/shsz. Omitted date allows latest returned snapshot, but explicit mismatched dates require allow_date_fallback. THS excludes Beijing; all-market fallback requires allow_partial_scope and returns partial. limit=1..5000; max_pages=1..50; max_seconds=1..30. Always preserve actual trade_date and source attempts; no snapshot does not prove no limit-ups.

Inputs: date, kind, limit, format, +7 more.

get_money_supply_data_monthC

Monthly money supply data.

Inputs: limit, format, end_date, start_date.

get_money_supply_data_yearC

Yearly money supply data.

Inputs: limit, format, end_date, start_date.

get_month_end_trading_datesC

Return month-end trading dates for a given year.

Inputs: year (required).

get_north_moneyA
    Fetches northbound money flow data (北向资金).
    
    Northbound money refers to foreign capital flowing into A-shares via Hong Kong.
    Data source: Eastmoney via Akshare.

    Args:
        format: Output format: 'markdown' | 'json' | 'csv'. Defaults to 'markdown'.

    Returns:
        Northbound money flow data with: 日期, 当日净买额, 当日资金流入, 当日资金余额
    

Inputs: format.

get_operation_dataD

Quarterly operation capability data.

Inputs: code (required), year (required), quarter (required), limit, +1 more.

get_performance_express_reportD

Performance express report within date range.

Inputs: code (required), end_date (required), start_date (required), limit, +1 more.

get_price_historyC

Same history route/fields as a-share-data fetch_history: Tencent, Sina and Eastmoney with explicit adjustment support.

    Explicit raw/qfq/hfq contract matches the skill; unsupported sources are skipped.
    Legacy get_historical_k_data retains Baostock's explicit adjustment semantics.
    

Inputs: code (required), end, count, start, +4 more.

get_profit_dataC

Quarterly profitability data.

Inputs: code (required), year (required), quarter (required), limit, +1 more.

get_realtime_klineA
    Fetches realtime K-line (OHLCV) data for a Chinese A-share stock.
    
    This tool uses Ashare library which fetches live data from Tencent/Sina APIs.
    No login required, supports intraday data during trading hours.

    Args:
        code: The stock code. Supports multiple formats:
              - 'sh600000' or 'sz000001' (Tongdaxin format)
              - '600000' or '000001' (pure number, auto-detect exchange)
              - 'sh.600000' or 'sz.000001' (Baostock format)
              - '600519.XSHG' or '000001.XSHE' (JoinQuant format)
        frequency: K-line frequency. Valid options:
                   '1m': 1 minute
                   '5m': 5 minutes
                   '15m': 15 minutes
                   '30m': 30 minutes
                   '60m': 60 minutes
                   '1d': daily (default)
                   '1w': weekly
                   '1M': monthly
        count: Number of K-line bars to fetch. Defaults to 60.
        format: Output format: 'markdown' | 'json' | 'csv'. Defaults to 'markdown'.

    Returns:
        K-line data table with columns: time, open, close, high, low, volume
    

Inputs: code (required), count, format, frequency.

get_realtime_multi_quoteA
    Batch query for realtime quotes (max 10 stocks).
    
    Returns realtime quotes for multiple stocks, sorted by change percentage (descending).
    Individual stock failures do not affect the overall result.

    Args:
        codes: List of stock codes (max 10). Supports multiple formats per code.
        format: Output format: 'markdown' | 'json' | 'csv'. Defaults to 'markdown'.

    Returns:
        Realtime quotes with: 代码, 名称, 最新价, 涨跌幅, 昨收, 状态
    

Inputs: codes (required), format.

get_realtime_quoteA
    Fetches realtime quote snapshot for a Chinese A-share stock.
    
    Returns the latest trading data with correct date and change calculation.
    Uses minute K-line aggregation for today's data instead of daily data.
    Quick overview of current stock status.

    Args:
        code: The stock code. Supports multiple formats:
              - 'sh600000' or 'sz000001' (Tongdaxin format)
              - '600000' or '000001' (pure number, auto-detect exchange)
              - 'sh.600000' or 'sz.000001' (Baostock format)
              - '600519.XSHG' or '000001.XSHE' (JoinQuant format)
        format: Output format: 'markdown' | 'json' | 'csv'. Defaults to 'markdown'.

    Returns:
        Latest quote data with: 日期, 最新价, 今开, 最高, 最低, 昨收, 涨跌额, 涨跌幅, 成交量, 市场状态
    

Inputs: code (required), format.

get_recent_trading_rangeC

Return a date range string covering the recent N trading days.

Inputs: days.

get_required_reserve_ratio_dataD

Required reserve ratio data.

Inputs: limit, format, end_date, year_type, +1 more.

get_stock_analysisB
    提供基于数据的股票分析报告,而非投资建议。

    Args:
        code: 股票代码,如'sh.600000'
        analysis_type: 'fundamental'|'technical'|'comprehensive'
    

Inputs: code (required), analysis_type.

get_stock_basic_infoA
    Fetches basic information for a given Chinese A-share stock.

    Args:
        code: The stock code in Baostock format (e.g., 'sh.600000', 'sz.000001').
        fields: Optional list to select specific columns from the available basic info
                (e.g., ['code', 'code_name', 'industry', 'listingDate']).
                If None or empty, returns all available basic info columns from Baostock.

    Returns:
        Basic stock information in the requested format.
    

Inputs: code (required), fields, format.

get_stock_conceptsA

Company concepts and provider-written reasons. THS includes all displayed regular/emerging/other categories; Eastmoney is IS_PRECISE=1 only. Preserve taxonomy, raw records and unknown evidence dates. source=all/ths/eastmoney; max_pages=1..20; max_seconds=1..30. No semantic filtering or cross-source deduplication.

Inputs: code (required), format, source, no_cache, +2 more.

get_stock_industryC

Get industry classification for a specific stock or all stocks on a date.

Inputs: code, date, limit, format.

get_stock_money_flowA
    Fetches individual stock money flow data (个股资金流向).
    
    Shows capital flow breakdown by investor size categories.
    Data source: Eastmoney via Akshare.

    Args:
        code: Stock code (e.g., '600519' or 'sh600519').
        top_n: Number of recent days to return. Defaults to 10.
        format: Output format: 'markdown' | 'json' | 'csv'. Defaults to 'markdown'.

    Returns:
        Money flow data with: 主力净流入, 超大单, 大单, 中单, 小单 净额和占比
    

Inputs: code (required), top_n, format.

get_suspensionsA
    List suspended stocks for a date.

    Args:
        date: Optional 'YYYY-MM-DD'. If None, uses current date.
        limit: Max rows to return. Defaults to 250.
        format: Output format: 'markdown' | 'json' | 'csv'. Defaults to 'markdown'.

    Returns:
        Table of stocks where tradeStatus==0.
    

Inputs: date, limit, format.

get_sz50_stocksC

SZSE 50 constituents.

Inputs: date, limit, format.

get_technical_indicatorsB
    Calculates technical indicators for a Chinese A-share stock.
    
    This tool fetches K-line data using Ashare and calculates indicators using MyTT library.
    Combines realtime data with technical analysis.

    Args:
        code: The stock code. Supports multiple formats (same as get_realtime_kline).
        frequency: K-line frequency. Valid options:
                   '1m', '5m', '15m', '30m', '60m', '1d', '1w', '1M'.
                   Defaults to '1d'.
        count: Number of K-line bars to fetch. Defaults to 120 for accurate indicator calculation.
        indicators: List of indicators to calculate. Valid options:
                    - 'MA': Moving Average (5, 10, 20日均线)
                    - 'EMA': Exponential Moving Average (12, 26日)
                    - 'MACD': Moving Average Convergence Divergence
                    - 'KDJ': Stochastic Oscillator
                    - 'RSI': Relative Strength Index
                    - 'WR': Williams %R
                    - 'BOLL': Bollinger Bands
                    - 'BIAS': Bias Ratio
                    - 'CCI': Commodity Channel Index
                    - 'ATR': Average True Range
                    - 'DMI': Directional Movement Index
                    - 'TAQ': Donchian Channel (唐安奇通道)
                    Defaults to ['MA', 'MACD', 'KDJ', 'BOLL', 'RSI'] if not specified.
        format: Output format: 'markdown' | 'json' | 'csv'. Defaults to 'markdown'.

    Returns:
        K-line data with calculated technical indicators.
    

Inputs: code (required), count, format, frequency, +1 more.

get_trade_datesB
    Fetch trading dates within a specified range.

    Args:
        start_date: Optional. Start date in 'YYYY-MM-DD' format. Defaults to 2015-01-01 if None.
        end_date: Optional. End date in 'YYYY-MM-DD' format. Defaults to the current date if None.

    Returns:
        Markdown table with 'is_trading_day' (1=trading, 0=non-trading).
    

Inputs: limit, format, end_date, start_date.

get_zz500_stocksD

CSI 500 constituents.

Inputs: date, limit, format.

is_trading_dayC

Check if a specific date is a trading day.

Inputs: date (required).

list_industriesC

List distinct industries for a given date.

Inputs: date, format.

list_tool_constantsB
    List valid constants for tool parameters.

    Args:
        kind: Optional filter: 'frequency' | 'adjust_flag' | 'year_type' | 'index'. If None, show all.
    

Inputs: kind.

next_trading_dayC

Get the next trading day after the given date.

Inputs: date (required).

normalize_index_codeC

Normalize common index codes to Baostock format.

Inputs: code (required).

normalize_stock_codeC

Normalize a stock code to Baostock format.

Inputs: code (required).

previous_trading_dayC

Get the previous trading day before the given date.

Inputs: date (required).

search_stocksA
    Search stocks by code substring on a date.

    Args:
        keyword: Substring to match in the stock code (e.g., '600', '000001').
        date: Optional 'YYYY-MM-DD'. If None, uses current date.
        limit: Max rows to return. Defaults to 50.
        format: Output format: 'markdown' | 'json' | 'csv'. Defaults to 'markdown'.

    Returns:
        Matching stock codes with their trading status.
    

Inputs: keyword (required), date, limit, format.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    C2.4/5.0

    Scored across 67 tools

    Disambiguation1/5

    Many tools appear to do the same thing: get_historical_k_data and get_price_history both fetch price history; get_realtime_kline and get_intraday_minute_kline overlap heavily; get_financials duplicates the many quarterly financial tools plus get_fina_indicator; and multiple limit-up/industry tools provide competing routes. The descriptions sometimes explain legacy vs new semantics, but an agent can easily misselect among near-duplicates.

    Naming Consistency4/5

    Almost all tools use snake_case and most follow a get_* pattern. A few helpers use non-get verbs (is_trading_day, previous_trading_day, next_trading_day, normalize_stock_code, list_industries), but the overall convention remains readable and predictable.

    Tool Count1/5

    With 67 tools, the surface is far too large for a coherent MCP server. Many tools are legacy duplicates or narrow variants, making the set unwieldy and increasing selection risk.

    Completeness4/5

    The server covers a broad A-share data domain: realtime quotes, historical K-lines, financial statements, indices, industry classifications, news, money flow, limit-up pools, corporate actions, and trading calendars. Minor gaps remain, but core data workflows are well represented.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      MCP server that wraps SFC financial data API into 32 tools for comprehensive A-share market data, including real-time quotes, rankings, limit-up statistics, news, themes, financials, charts, research reports, and watchlists.
      -
    • A
      license
      A
      quality
      D
      maintenance
      Provides access to Chinese A-share market financial data, including historical K-line, real-time quotes, financial statements, shareholder information, and technical indicators, via MCP protocol.
      12
      13 npm
      3
      MIT