PandaStock MCP

A股实时数据 MCP Server。NATS 推送行情/Level2/DDX 大单/资金流,22 个工具,免注册公共测试账号

Documentation

pandaData — A 股实时数据 SDK + MCP Server

PyPI version Python 3.10+ License: MIT

A 股数据 API + AI 选股 · 开源客户端

基于 NATS 的 A 股实时数据通道 —— 行情、Level2、DDX 大单、资金流、选股信号主动推给你,不是让你轮询 REST。

⚡ 30 秒上手

免注册:内置公共测试账号,装完直接跑,无需申请。

pip install pandastock-mcp
from panda_stock import PandaStock

# 公共测试账号(配额说明见下方「公共测试账号」)
ps = PandaStock(phone="pandastock", nid="pandastock")
ps.connect_server()

print(ps.get_ch_stock())                  # 全市场股票列表
print(ps.get_ch_one_stock_real("600519")) # 单只实时行情
print(ps.get_ch_select_stock())           # AI 选股

🤖 MCP 接入(Claude / Cursor / OpenClaw)

pip install pandastock-mcp
{
  "mcpServers": {
    "panda-stock": {
      "command": "pandastock-mcp",
      "env": {
        "PANDA_PHONE": "pandastock",
        "PANDA_NID": "pandastock"
      }
    }
  }
}

升级:pip install --upgrade pandastock-mcp · 详见 mcp/config_example.json

📞 接口咨询 / 专属 key 申请:加微信 onestock188 或 pandastock888 📅 最后更新:2026-09-26

✨ 特性

  • 免注册试用:公共测试账号装完即可调用,先验证再申请专属 key
  • 实时快照(请求/响应):4 个 CurReal 主题通过请求获取 A 股实时行情 / 指数 / 概念 / 行业,无需订阅
  • AI 选股:get_ch_select_stock() 等 AI 选股接口
  • 22 个开放接口:全部为请求/响应接口;服务端共 176 个接口覆盖全量数据(完整清单见 INTERFACES.md)
  • MCP ready:本地 stdio MCP Server 暴露 22 个工具,Claude / Cursor / OpenClaw 直接调用

📡 实时快照(请求/响应)

4 个 CurReal 主题通过请求方式获取实时快照,无需订阅:

# A股实时行情
print(ps.get_ch_stock_real())

# 指数实时
print(ps.get_ch_market_real())

# 概念板块实时
print(ps.get_ch_concept_real())

# 行业板块实时
print(ps.get_ch_industry_real())

🎁 公共测试账号

开放一个公共测试账号,无需申请即可直接试玩:

字段值
phonepandastock
nidpandastock

公共账号按来源 IP 限频、限接口、含全局日上限,仅供评估试玩。 正式 / 高频 / 全量接口,请申请专属 phone/nid:加微信 onestock188 或 pandastock888

  • 初始化示例:PandaStock(phone="pandastock", nid="pandastock")(与专属账号同一套服务端鉴权,仅配额不同)

🔑 测试账号可调用的 22 个接口(服务端共 176 个,完整清单 + 返回字段见 INTERFACES.md)

接口按成本/价值分档,客户端不含限制逻辑,鉴权/配额/频率/分级全部在服务端(NATS 网关)执行。

18 个请求/响应接口:

主题方法说明
chStockListget_ch_stock()股票列表
chConceptListget_ch_concept()概念板块列表
chIndustryListget_ch_industry()行业板块列表
ChStockCurRealget_ch_stock_real()A股实时快照
ChMarketCurRealget_ch_market_real()指数实时快照
ChConceptCurRealget_ch_concept_real()概念板块实时快照
ChIndustryCurRealget_ch_industry_real()行业板块实时快照
ChOneStockRealget_ch_one_stock_real(code)单只股票实时
chStockFrontDayHistoryget_ch_stock_front_day_history(code)个股前复权日线
chConceptDayHistoryget_ch_concept_day_history(code)概念日线
chIndustryDayHistoryget_ch_industry_day_history(code)行业日线
chStockMinuteHistoryget_ch_stock_minute_history(code, minute, date)分钟历史
ChMarketDayHistoryget_ch_market_day_history(code)指数日线
ChCoreNewsget_core_new(date)核心资讯
ChDomesticNewsget_domestic_financial_news(date)国内要闻
ChGlobalNewsget_global_financial_news(date)全球要闻
ChOptionNewsget_options_news(date)期权资讯
ChLimitUpDownget_ch_limit_up_down()涨跌停统计
ChLhbDataget_lhb_data(date)龙虎榜
ChMarketFundFlowget_ch_market_fund_flow()市场资金流
chAllMarketBearCompareget_ch_all_market_bear_compare()全市场多空对比
chDdxStockDataget_ch_stock_ddx_data(code)个股 DDX

服务端共 176 个接口,完整清单(含「是否可测试」+ 每个接口返回的字段明细)见 INTERFACES.md(「接口返回字段详情」一节)。上表 22 个为已对公开 key 开放的请求接口。

全部 176 个接口一览(测试账号可调用标记)

完整返回字段见 INTERFACES.md 的「接口返回字段详情」。标 ✅ 可调用 的即上方 22 个公开测试账号可调用接口;其余需专属 key 后使用。

分类接口名称方法(function)测试账号
Levle2和大单订阅Level2实时数据通道subscribe_ch_l2_data_real—
Levle2和大单获取Level2实时数据get_ch_l2_data_cur_real—
Levle2和大单订阅大单数据(DDE)通道subscribe_ch_ddx_data_real—
Levle2和大单获取大单数据(DDE)get_ch_ddx_data_cur_real—
Levle2和大单获取个股历史大单历史数据get_ch_stock_ddx_history—
Levle2和大单个股千档数据get_ch_stock_thousand_level_order—
Levle2和大单个股实时资金流数据get_ch_stock_l2_fund_flow_sa—
Levle2和大单获取个股最新逐笔成交get_ch_stock_l2_laster_transactions_sa—
Levle2和大单获取个股全部逐笔成交数据get_ch_stock_l2_all_transactions_sa—
Levle2和大单市场实时资金流数据get_ch_all_market_l2_fund_flow—
Levle2和大单上证指数实时资金流数据get_ch_sh_market_l2_fund_flow—
Levle2和大单深圳市场实时资金流数据get_ch_sz_market_l2_fund_flow—
Levle2和大单创业板实时资金流数据get_ch_cyb_market_l2_fund_flow—
Levle2和大单科创板实时资金流数据get_ch_kcb_market_l2_fund_flow—
Levle2和大单个股实时大单成交明细get_ch_stock_big_order—
Levle2和大单订阅Level2单只股成交明细subscribe_ch_l2_transaction_single—
Levle2和大单订阅Level2多只股成交明细subscribe_ch_l2_transaction_batch—
Levle2和大单订阅Level2所有股成交明细subscribe_ch_l2_transaction_all—
Levle2和大单个股l2分价成交明细get_ch_stock_price_summarize—
Levle2和大单订阅l2单只股十档行情通道subscribe_ch_l2_deep_single—
Levle2和大单订阅l2多只股十档行情通道subscribe_ch_l2_depth_batch—
Levle2和大单订阅l2所有股票十档行情通道subscribe_ch_l2_depth_all—
Levle2和大单订阅l2单只个股买 一卖一明细subscribe_ch_l2_orders_single—
Levle2和大单订阅l2多只个股买 一卖一明细subscribe_ch_l2_orders_batch—
Levle2和大单订阅l2所有股票买 一卖一明细subscribe_ch_l2_orders_all—
Levle2和大单日内实时暗盘资金get_ch_stock_dark_rank—
Levle2和大单历史暗盘资金get_ch_stock_dark_rank_history—
Levle2和大单个股DDE实时数据get_ch_stock_ea_dde—
新闻资讯重点资讯新闻get_core_new✅ 可调用
新闻资讯国内主要新闻get_domestic_financial_news✅ 可调用
新闻资讯国际主要新闻get_global_financial_news✅ 可调用
新闻资讯时评类新闻get_options_news✅ 可调用
新闻资讯个股新闻get_ch_stock_month_news—
新闻资讯财经快讯(数据源sn)get_ch_sn_kx—
新闻资讯财经快讯(数据源SA)get_ch_sa_kx—
新闻资讯个股公告get_ch_stock_announce—
新闻资讯个股研报get_ch_stock_research_report—
特色数据每日ST股信息get_ch_stock_st_history—
特色数据沪深300成分股权重get_ch_hs300_constituent_weight_history—
特色数据上证50成分股权重get_ch_sz50_constituent_weight_history—
特色数据中证500成分股权重get_ch_zz500_constituent_weight_history—
特色数据中证1000成分股权重get_ch_zz1000_constituent_weight_history—
特色数据个股除权除息历史get_ch_stock_dividend_history—
特色数据年度高送转/分红get_ch_year_high_stock_dividend—
特色数据个股股本变化历史get_ch_stock_share_capital—
特色数据个股资金流明细历史get_ch_stock_fund_flow_detail_history—
特色数据年度解禁数据get_ch_year_stock_lock_up—
特色数据1日融资买入排行get_ch_rz_buy_1_day—
特色数据5日融资买入排行get_ch_rz_buy_5_day—
特色数据20日融资买入排行get_ch_rz_buy_20_day—
特色数据个股一致行动人信息get_ch_stock_pacs—
特色数据市场每个交易日涨跌平数量get_ch_day_zd_count_history—
特色数据上证A股每个交易日涨跌平数量get_ch_sh_day_zd_count_history—
特色数据深圳A股每个交易日涨跌平数量get_ch_sz_day_zd_count_history—
特色数据创业板每个交易日涨跌平数量get_ch_cyb_day_zd_count_history—
特色数据科创板每个交易日涨跌平数量get_ch_kcb_day_zd_count_history—
特色数据北证每个交易日涨跌平数量get_ch_bj_day_zd_count_history—
特色数据市场每个交易周涨跌平数量get_ch_week_zd_count_history—
特色数据上证A股每个交易周涨跌平数量get_ch_sh_week_zd_count_history—
特色数据深圳A股每个交易周涨跌平数量get_ch_sz_week_zd_count_history—
特色数据创业板每个交易周涨跌平数量get_ch_cyb_week_zd_count_history—
特色数据科创板每个交易周涨跌平数量get_ch_kcb_week_zd_count_history—
特色数据北证每个交易周涨跌平数量get_ch_bj_week_zd_count_history—
特色数据市场每个交易月涨跌平数量get_ch_month_zd_count_history—
特色数据上证A股每个交易月涨跌平数量get_ch_sh_month_zd_count_history—
特色数据深圳A股每个交易月涨跌平数量get_ch_sz_month_zd_count_history—
特色数据创业板每个交易月涨跌平数量get_ch_cyb_month_zd_count_history—
特色数据科创板每个交易月涨跌平数量get_ch_kcb_month_zd_count_history—
特色数据北证每个交易月涨跌平数量get_ch_bj_month_zd_count_history—
特色数据中国全社会用电量同比get_ch_electricity_use_history—
特色数据全市场PE/PB 月数据历史get_ch_market_pe_pb_month_history—
特色数据全市场PE/PB 日数据历史get_ch_market_pe_pb_day_history—
特色数据中国年度GDP同比增长率get_ch_gdp_yearly_growth—
特色数据中国季度GDP同比增长率get_ch_gdp_quarter_rate—
特色数据中国季度GDP环比增长率get_ch_gdp_qoq_rate—
特色数据个股l2分价成交明细历史get_ch_stock_price_summarize_history—
特色数据交易日涨跌停时序数据get_ch_limit_up_down_history—
特色数据交易日涨跌分布时序数据get_ch_zd_map_history—
特色数据交易日涨停股信息get_ch_lb_stock_history_history—
特色数据交易日全天成交额数据get_ch_market_amount_curve_history—
特色数据中国GDP 季度数据get_ch_gdp_quarter_value—
港股行情订阅港股实时行情通道subscribe_hk_stock_real—
港股行情获取港股实时行情get_hk_stock_real—
港股行情订阅港股指数实时行情通道subscribe_hk_market_real—
港股行情获取港股指数实时行情get_hk_market_real—
港股行情港股股票列表get_hk_stock—
港股行情港股个股历史日线get_hk_stock_day_history—
港股行情港股个股历史周线get_hk_stock_week_history—
港股行情港股个股历史月线get_hk_stock_month_history—
港股行情港股指数历史日线get_hk_market_history—
港股行情港股指数历史周线get_hk_market_week_history—
港股行情港股指数历史月线get_hk_market_month_history—
港股行情港股主要财务指标get_hk_stock_main_fin_data—
港股行情港股资产负债表get_hk_stock_balance_sheet—
港股行情港股利润表get_hk_stock_profit_statement—
港股行情港股现金流表get_hk_stock_cash_flow—
个股数据获取股票列表get_ch_stock✅ 可调用
个股数据订阅实时行情通道subscribe_ch_stock_real—
个股数据获取所有个股实时行情get_ch_stock_real✅ 可调用
个股数据获取单只个股实时行情get_ch_one_stock_real✅ 可调用
个股数据个股实时分钟K线get_ch_stock_minute_real—
个股数据个股实时逐笔成交get_ch_stock_transaction_real—
个股数据前复权日线get_ch_stock_front_day_history✅ 可调用
个股数据前复权周线get_ch_stock_front_week_history—
个股数据前复权月线get_ch_stock_front_month_history—
个股数据后复权日线get_ch_stock_back_day_history—
个股数据后复权周线get_ch_stock_back_week_history—
个股数据后复权月线get_ch_stock_back_month_history—
个股数据历史分笔get_ch_stock_transaction_history—
个股数据主力评分数据get_ch_stock_primer_info—
个股数据个股资金流get_ch_stock_fund_flow—
个股数据人气排名数据get_ch_stock_attention_tank—
个股数据股东人数历史get_ch_stock_share_holder—
个股数据大宗交易历史get_ch_stock_block_trading—
个股数据增减持历史get_ch_stock_inc_or_dec—
个股数据等比前复权日线get_ch_stock_front_ratio_history—
个股数据等比前复权周线get_ch_stock_front_ratio_week_history—
个股数据等比前复权月线get_ch_stock_front_ratio_month_history—
个股数据等比后复权日线get_ch_stock_back_ratio_history—
个股数据历史分钟数据get_ch_stock_minute_history✅ 可调用
个股数据个股分时图get_ch_stock_time_line—
个股数据个股昨日分时图get_ch_stock_time_line_yes—
个股数据个股五日分时get_ch_stock_five_days_time_line—
个股数据个股竞价分时数据get_ch_stock_auction_time_line—
板块数据获取概念板块列表get_ch_concept✅ 可调用
板块数据获取行业板块列表get_ch_industry✅ 可调用
板块数据订阅概念板块实时行情通道subscribe_ch_concept_real—
板块数据获取概念板块实时行情get_ch_concept_real✅ 可调用
板块数据订阅行业板块实时行情通道subscribe_ch_industry_real—
板块数据获取行业板块实时行情get_ch_industry_real✅ 可调用
板块数据概念板块日线get_ch_concept_day_history✅ 可调用
板块数据概念板块周线get_ch_concept_week_history—
板块数据概念板块月线get_ch_concept_month_history—
板块数据行业板块日线get_ch_industry_day_history✅ 可调用
板块数据行业板块周线get_ch_industry_week_history—
板块数据行业板块月线get_ch_industry_month_history—
市场数据获取融资融券余额get_rzrq_balance—
市场数据上交所每日统计信息get_sh_market_daily_info—
市场数据上交所每周统计信息get_sh_market_week_info—
市场数据上交所每月统计信息get_sh_market_month_info—
市场数据订阅指数实时行情通道subscribe_ch_market_real—
市场数据获取指数实时行情get_ch_market_real✅ 可调用
市场数据涨跌停数量历史get_ch_limit_up_down✅ 可调用
市场数据指数日线get_ch_market_day_history✅ 可调用
市场数据指数周线get_ch_market_week_history—
市场数据指数月线get_ch_market_month_history—
市场数据龙虎榜数据get_lhb_data✅ 可调用
市场数据市场资金流历史get_ch_market_fund_flow✅ 可调用
市场数据全市场买卖对比get_ch_all_market_bear_compare✅ 可调用
市场数据上证买卖对比get_ch_sh_market_bear_compare—
市场数据深证买卖对比get_ch_sz_market_bear_compare—
市场数据创业板买卖对比get_ch_cyb_market_bear_compare—
市场数据科创板买卖对比get_ch_kcb_market_bear_compare—
市场数据北证买卖对比get_ch_bj_market_bear_compare—
市场数据市场实时涨跌分布时序数据get_ch_market_zd_map—
市场数据市场实时涨跌停数量get_ch_today_limit_up_down—
市场数据市场实时涨停股列表get_ch_today_lb_stock—
市场数据市场全天实时成交额get_ch_market_amount_curve—
财务数据利润表get_ch_stock_income_statement—
财务数据现金流表get_ch_stock_cash_flow_statement—
财务数据财务主表get_ch_stock_financial_indicators—
财务数据资产负债表get_ch_stock_balance_sheet—
财务数据财务辅助表get_ch_stock_auxiliary_data—
财务数据股东表get_ch_stock_share_capital_and_shareholders—
财务数据业绩预告get_ch_stock_net_profit—
财务数据财务核心指标(数据源SI)get_ch_si_stock_fin_key_indicators—
财务数据利润表(数据源SI)get_ch_si_stock_fin_income_statements—
财务数据资产负债表(数据源SI)get_ch_si_stock_fin_balance_sheet—
财务数据现金流表(数据源SI)get_ch_si_stock_fin_cash_flow—
财务数据个股财务核心指标(数据源Ea)get_ch_ea_stock_fin_key_indicators—
财务数据个股资产负债表(数据源Ea)get_ch_ea_stock_fin_balance_sheet—
财务数据个股利润表(数据源Ea)get_ch_ea_stock_fin_income_statements—
财务数据个股现金流量表(数据源Ea)get_ch_ea_stock_fin_cash_flow—
可转债订阅可转债实时行情通道subscribe_ch_kzz_stock_real—
可转债获取可转债实时行情get_ch_kzz_cur_real—
可转债获取可转债列表get_ch_kzz_stock—

Tools

本地 MCP Server(mcp/server.py)暴露 22 个请求/响应工具,与公开测试账号的 22 个开放接口一一对应。

ToolDescription
ChStockCurRealA股实时行情快照 / Realtime snapshot of ALL A-share stocks
ChMarketCurReal指数实时快照 / Realtime snapshot of market indices
ChConceptCurReal概念板块实时快照 / Realtime snapshot of concept sectors
ChIndustryCurReal行业板块实时快照 / Realtime snapshot of industry sectors
chStockList股票列表 / List of all A-share stocks
chConceptList概念板块列表 / List of concept sectors
chIndustryList行业板块列表 / List of industry sectors
ChOneStockReal单只股票实时行情 / Realtime quote for ONE stock (e.g. "600519")
chStockFrontDayHistory个股前复权日线 / Forward-adjusted daily K-line for one stock
chConceptDayHistory概念板块日线 / Concept sector daily K-line
chIndustryDayHistory行业板块日线 / Industry sector daily K-line
chStockMinuteHistory个股分钟历史 / Minute-level K-line (1/5/15/30/60)
ChMarketDayHistory指数日线 / Index daily K-line
ChCoreNews核心资讯 / Core market news
ChDomesticNews国内财经要闻 / Domestic financial news
ChGlobalNews全球财经要闻 / Global financial news
ChOptionNews期权资讯 / Options-related news
ChLimitUpDown涨跌停统计 / Limit-up & limit-down statistics
ChLhbData龙虎榜数据 / Dragon-Tiger list data
ChMarketFundFlow市场资金流向 / Whole-market capital flow
chAllMarketBearCompare全市场多空对比 / Bull/bear comparison of the whole market
chDdxStockData个股DDX / DDX large-order tracking for one stock

🤖 SKILL.md

仓库根目录 SKILL.md 供 Claude Code / OpenClaw 直接激活。

⚖️ 许可证

MIT(见 LICENSE)。客户端开源,调用后端需有效 phone/nid,按量计费。

📰 已收录渠道

SeekTool.ai Tools Directory

Featured on ToolPilot