mcpField
C
cn-stock

cn-stock

github.com/starchild-ai-agent数据与数据库30154 次安装6 天前更新
代码仓库

关于 cn-stock

cn-stock 是面向中国 A 股数据查询的技能,通过 sc-proxy 调用 Tushare Pro,覆盖行情、财务、股东及市场数据。

主要功能

  1. 01实时行情与日周月 K 线
  2. 02公司资料与股票列表
  3. 03财务报表及业绩数据
  4. 04股东、资金流与概念板块
  5. 05指数与市场涨跌停数据

适用场景

  1. 01查询 A 股个股行情和公司资料
  2. 02查看财报、分红及股东变动
  3. 03分析资金流、概念和指数数据

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/starchild-ai-agent/official-skills --skill cn-stock

安装后在 Claude Code 中输入/cn-stock确认已加载。

附带文件exports.py

详细介绍

🇨🇳 cn-stock — 中国 A 股数据(通过 sc-proxy 使用 Tushare)

全面的 A 股技能,使用 Tushare Pro 作为唯一上游数据源。 所有 API 调用均通过 sc-proxy(透明代理 tushare 插件)路由, 由服务端注入真实 API 令牌,并按次调用计费。 无需设置本地 TUSHARE_TOKEN 环境变量——该技能会发送虚假令牌, sc-proxy 会在请求到达 Tushare 前将其替换。

数据源策略

your call → exports.py (cn-stock)
            └─ proxied_post → sc-proxy (tushare plugin) → http://api.tushare.pro/
  • 不提供 Sina / Eastmoney / akshare 抓取回退方案。
  • 无需本地 API 密钥。
  • 通过 sc-proxy 按请求计费。

输出约定

大多数函数返回:

{"ok": bool, "source": str, "data": <payload>, "error": str|None, "ts": int}

例外:

  • get_full_report(code) 返回由子结果组成的合并字典。

代码格式

接受:

  • 000001 / 603186 / 300476(推荐)
  • 000001.SZ / 600000.SH / 830799.BJ(也接受)

6 位代码的自动映射:

  • 60/68/90 → SH
  • 00/20/30 → SZ
  • 4/8 → BJ

函数映射

报价 / 公司 / K 线
函数返回内容Tushare 端点
get_realtime_quote(code)最新报价快照及估值daily + daily_basic
get_company_info(code)上市公司简介stock_company
get_kline(code, period, start, end, adjust, limit)日/周/月 K 线(未复权)daily/weekly/monthly
get_adj_factor(code, days)复权因子序列(用于手动计算前复权/后复权)adj_factor
get_bid_ask(code)L1-L5 订单簿基础权限中不可用
get_stock_list(market, industry, list_status, limit)可选筛选条件的上市股票全集stock_basic
get_trade_calendar(start, end, exchange, open_only)交易日历trade_cal
财务数据
函数返回内容Tushare 端点
get_financial(code, max_periods)按期间列出的关键财务指标fina_indicator
get_income_statement(code, max_periods, period)利润表income
get_balance_sheet(code, max_periods, period)资产负债表balancesheet
get_cashflow_statement(code, max_periods, period)现金流量表cashflow
get_earnings_forecast(code, limit)业绩预告forecast
get_earnings_express(code, limit)业绩快报express
get_dividends(code, limit)分红送股dividend
股东与持股
函数返回内容Tushare 端点
get_holders(code, top)最新前十大股东top10_holders
get_shareholder_count(code, periods)股东户数变化stk_holdernumber
get_shareholder_trades(code, days)重要股东增减持stk_holdertrade
get_block_trades(code, days)大宗交易block_trade
资金流与北向资金
函数返回内容Tushare 端点
get_fund_flow(code, days)近期资金流向moneyflow
get_margin_detail(code, days)融资融券明细margin_detail
get_north_holdings(code, days)沪深股通持股明细(北向资金)hk_hold
get_north_flow(days)沪深港通每日资金流向moneyflow_hsgt
概念 / 行业 / 龙虎榜 / 全市场
函数返回内容Tushare 端点
get_concept_boards(top, sort_by)概念板块列表ths_index
get_stock_concepts(code)股票所属概念ths_member
get_lhb(code, days)个股龙虎榜记录top_list(扫描近期日期)
get_top_movers(direction, limit)全市场涨跌幅排行daily(+ daily_basic)
get_limit_prices(code, trade_date, days)每日涨跌停价stk_limit
get_limit_board(trade_date, limit_type)当日涨停/跌停/炸板股票limit_list_d
get_suspended(trade_date)每日停复牌情况suspend_d
指数数据
函数返回内容Tushare 端点
get_index_basic(market)指数列表(SSE/SZSE/MSCI/CSI/SW/...)index_basic
get_index_kline(index_code, period, start, end, limit)指数 K 线(含沪深 300、上证、创业板等)index_daily/weekly/monthly
一键汇总
功能返回内容
get_full_report(code)行情 + 公司 + 持有人 + 资金流组合

此技能明确不涵盖的内容

  • 新闻。 股票相关新闻、公告和文章请使用常规网页搜索(例如 web_search)。Tushare 新闻的频率限制很严格,且与一般网络报道重叠;通过付费代理获取并无额外价值。
  • 复权 K 线(qfq/hfq)。 HTTP 路径只返回未复权的 K 线。如需复权价格,请结合 get_adj_factor 和 get_kline 返回的未复权 K 线。
  • 盘中逐笔/买卖盘 L1-L5。 需要上游单独开通实时权限,基础权限不包含此项。
  • 分钟线。 需要上游单独开通权限;此处未提供。日终数据请使用 get_kline。

面向用户的回复指南

回答用户时:

  • 使用易读的中文市场单位(亿、%)展示数值。
  • 明确标注数据为日终数据,而非盘中逐笔数据。
  • 如果某项功能不可用,请直接说明。
  • 添加来源说明:数据来源:Tushare Pro,非投资建议

维护说明

  • 所有请求均通过 POST 发送至 http://api.tushare.pro/,请求体为 {api_name, token, params, fields}。
  • token 字段设置为一个伪造的密钥;sc-proxy 的 tushare 插件会在上游调用前替换它。
  • 如需修改价格或频率限制,请编辑代理的 tushare 插件(参见 transparent-proxy-maintenance 技能),而不是此技能。
  • 添加新的 Tushare 端点 = 添加一个调用 _call(api_name, **params) 的轻量封装。

评论

支持 Markdown