ashare-screener
ashare-mcp-server
A 股选股 MCP Server — 把一套 5 层漏斗选股引擎封装为 MCP 工具,供 Claude / Cursor / 任意 LLM Agent 直接调用。
A-share stock screener exposed as MCP tools — a 5-layer funnel screening engine your LLM agent can call directly.
数据源(腾讯行情/Tushare) → 5层漏斗选股引擎 → SQLite → MCP Server ──→ 你的 Agent
↑ stdio
Claude / Cursor / DSH / 自研Agent工具 / Tools
工具 | 说明 | 耗时 |
| 5 层漏斗选股:主板过滤 → 换手率<10% → 全天最低价>MA5 → 创5年新高 → 筹码峰非顶部。 | full 2–5 min,test ~30s |
| 查询最近一次选股结果(读 SQLite,秒回,演示首选) | <1s |
| 单只实时报价,如 | ~1s |
选股结果入库去重(is_new 标记新增/续选),天然支持 Agent 做"今天有哪些新入选"这类增量分析。
Related MCP server: mcp-eastmoney
快速开始 / Quick Start
# 安装
pip install git+https://github.com/Sqyl/ashare-mcp-server.git
# 环境变量(全市场扫描需要 Tushare 免费token;test/pool 模式和实时报价不需要)
export TUSHARE_TOKEN=xxx # https://tushare.pro 免费注册
# export ASHARE_DB=/path/to/ashare.db # 可选,默认 ./data/ashare.dbClaude Code / Cursor / 任意 MCP client 配置:
{
"mcpServers": {
"ashare-screener": {
"command": "ashare-mcp",
"env": { "TUSHARE_TOKEN": "xxx" }
}
}
}配好后对你的 Agent 说:
"先 run_screen test 跑个小样本,然后告诉我今天有哪些入选" "查一下 600519.SH 现在什么价"
选股逻辑(漏斗 5 层)
层 | 条件 | 数据源 |
1 | 主板(60x/000/001/002),换手率 < 10%,剔除 ST/停牌 | 腾讯实时快照(批量) |
2 | 全天最低价 > MA5 | Tushare 按交易日批量 |
3 | 前复权最高价创近 5 年新高 | 腾讯日 K(带重试) |
4 | 筹码峰(120 日量价分布)不在当前价位顶部 | 腾讯日 K 计算 |
5 | 与前一日结果去重,标记 🆕 新入选 | SQLite |
策略本身来自个人回测迭代(如换手率阈值 8%→10% 的调整依据),仅供学习研究,不构成投资建议。
工程细节
限频对策:腾讯实时接口按 50 支/批分组;日 K 拉取带 3 次重试 + 0.3s 间隔;Tushare 按交易日批量查询取代逐只查询
字段陷阱:腾讯实时接口指数与个股字段数不同(~45 vs ~60 字段),解析按
len(f)分流处理前复权口径:新高判断统一用腾讯前复权日 K,避免除权假突破
并发安全:SQLite WAL 模式,选股写入与实时采集互不阻塞
License
MIT
Available Tools
3 toolslatest_resultsA
查最近一次选股结果(读DB秒回,演示首选)。空库时友好提示。
Inputs: no named parameters. Returns: result
quoteB
实时报价。ts_code 格式: 600519.SH / 000858.SZ
Inputs: ts_code (required). Returns: result
run_screenA
跑完整5层漏斗选股(主板/换手/MA5/5年新高/筹码峰)。
mode: full=全市场(2-5分钟, 需 TUSHARE_TOKEN) | pool=自选池 | test=小样本(10支)
Inputs: mode. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
run_screen executes the funnel, latest_results reads stored output, and quote fetches live prices — three clearly distinct actions on distinct targets. No overlap or plausible misselection between them.
All names use lowercase snake_case, which is consistent. However, only run_screen follows a strict verb_noun pattern; latest_results and quote are noun-only, a minor deviation rather than a break in convention.
Three tools is slightly thin for a screener but each earns its place: execute, retrieve results, and live quotes. No redundancy, though one more tool (e.g. parameterized/custom screen) would round it out.
The core loop of run-screen → view-results → quote is covered, but there is no way to customize screen criteria, browse historical runs, or look up stock metadata beyond the quote call. These are notable gaps an agent may need to work around.
Maintenance
Related MCP Connectors
China A-share screening, filings, holdings, flows and calendars as agent tools.
China A-share data for AI agents: 57 read-only tools plus 6 tools for your own watchlist.
China A-share market data over MCP: 22 tools for quotes, K-line, financials, money flow, top-trader boards, sectors, macro, convertible bonds and factor screening. Five tools need no API key, so you can connect and try it immediately.
China A-share market data for research, backtesting and AI agents via MCP.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides real-time quotes, fund flows, and corporate announcements for Chinese A-share stocks. It enables users to search for stocks, analyze financial indicators, and summarize quarterly reports through natural language.-
- AlicenseAqualityDmaintenanceEnables AI assistants to query real-time A-share stock data, including quotes, fund flows, sector flows, and K-line history, without needing an API key.520MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to pull live China A-share market data through 24 tools spanning real-time quotes, K-lines, five-level order books, financials, money flow, dragon-tiger lists, sector and valuation data, convertible bonds, ETFs, IPOs, macro indicators, and factor-based stock screening. Five of the tools work with no API key, while the rest require a paid key.577 npm1MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to query A-share market data—including quotes, candlesticks, financial reports, funds, announcements, research, macro, indices, futures, options, and convertible bonds—through 149 MCP tools across 14 layers. It requires no API keys and returns structured data with source and timestamp metadata.39 PyPI2Apache 2.0