Skip to main content

astock-mcp-cn

A 股行情 MCP 服务。5 个工具、纯 HTTP 取数,不依赖 akshare / pandas,冷启动 1 秒内,适合本地或云端托管。

工具

行情

工具 用途
quote(symbols) 实时报价,多只逗号分隔,代码或名称均可;含涨跌幅、换手率、量比、PE、PB、总市值
kline(symbol, period, limit, adjust) 日/周/月 K 线,含每日涨跌幅与换手率,末尾附 MA5 / MA20 / 区间涨跌
market_overview() 六大指数点位涨跌 + 全市场涨跌家数 + 涨停跌停家数
intraday(symbol) 当日分时要点:开高低现、均价、振幅、量能分布、尾盘 30 分钟、站上均价比例

情绪与资金

工具 用途
limit_up(limit) 涨停梯队:家数、最高连板、封单额占流通市值比、首封时间、炸板次数、所属行业、10天N板
money_flow(symbol, days) 个股近 N 日主力 / 超大单 / 大单 / 小单净额与主力净占比
sector_flow(limit, direction) 行业板块主力资金净流入/流出排行
dragon_tiger(limit) 最近交易日龙虎榜:净买入额、买卖额、上榜原因

筛股与基本面

工具 用途
screen(...) 条件选股:涨跌幅、换手率、PE、总市值
fundamental(symbol) 财务快照:加权 ROE、毛利率、资产负债率、营收及同比、EPS、BPS
announcements(symbol) 近期公告标题(不含正文)

判断"明天能不能上板"用哪些

limit_up 看封板质量(首封越早、封单占流通比越高、炸板越少越强)→ money_flow 看主力是否真进场 → dragon_tiger 看是游资还是机构 → intraday 看是否全天站上均价 → announcements 看消息催化 → market_overview 看情绪周期。

安装

pip install astock-mcp-cn
# 或
uvx astock-mcp-cn

接入 MCP 客户端

stdio 传输,命令即 astock-mcp:

{
  "mcpServers": {
    "astock": { "command": "uvx", "args": ["astock-mcp-cn@0.2.2"] }
  }
}

务必带版本号(@0.2.2 或 @latest)。uvx astock-mcp-cn 不带版本时会复用本地已缓存的 旧环境,即使 PyPI 上有新版本也不会升级——实测:缓存里是 0.2.0 时,跑一次无版本号的 uvx, 缓存中仍然只有 0.2.0。写 @0.2.2 可保证每次启动都是确定版本。

服务端会在 MCP 握手的 serverInfo.version 里返回自身版本,可用它确认客户端实际加载的是哪一版。

数据源

数据 主源 备源
实时报价 腾讯 qt.gtimg.cn 新浪 hq.sinajs.cn
K 线 东方财富 push2his 腾讯 web.ifzq.gtimg.cn
资金流 / 选股 / 涨跌家数 东方财富 push2 —

数据来自公开行情接口,可能存在延迟或口径差异,仅供信息参考。

说明

  • screen 从东财榜单前 300 只里筛选(接口单页上限 100 条,按 sort 字段排序后取头部),不是全市场扫描;适合快速看方向,不适合严谨回测。
  • 输出做了紧凑处理以节省上下文 token,默认条数克制。
  • 结果在进程内缓存 20–180 秒,避免重复请求。

免责声明

本项目仅提供公开行情数据的读取能力,不构成任何投资建议。投资有风险,决策需谨慎。

License

MIT

Metadata

Release files for astock-mcp-cn 0.2.6

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

Source distribution (sdist)

Source distribution for astock-mcp-cn 0.2.6
File Size Uploaded Provenance Actions
astock_mcp_cn-0.2.6.tar.gz 21.1 kB Without provenance Details for astock_mcp_cn-0.2.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for astock-mcp-cn 0.2.6
File Interpreter ABI Platform Actions
astock_mcp_cn-0.2.6-py3-none-any.whl Python 3 none any Details for astock_mcp_cn-0.2.6-py3-none-any.whl

Total release size: 43.7 kB

Release files / astock_mcp_cn-0.2.6.tar.gz

Download URL astock_mcp_cn-0.2.6.tar.gz
Size 21.1 kB
Tags Source
SHA-256 checksum
How to use checksums
cadcd7e54cf9fff81eba9fc92dcd0eb28f6e1c5a421e2ef9ad911d6e649d1e1a
BLAKE2b-256 checksum
How to use checksums
43dad16edd25dae8954972c8649e422efd8bdbcd19b4386590388a4d424c84f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / astock_mcp_cn-0.2.6-py3-none-any.whl

Download URL astock_mcp_cn-0.2.6-py3-none-any.whl
Size 22.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e53a66a0e1e56cc494f1fa456d75aa185bc04540389bf3d6710e300099d01826
BLAKE2b-256 checksum
How to use checksums
45cefdf623a0ca3ad1c2577f56e274aab322cb00c0af21f2743f875d5c0f35c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for astock-mcp-cn 0.2.6

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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