ashareapi
Officialashareapi — A股数据 API 官方 DeepSeek Harness 插件
让 DeepSeek Harness(DSH) 直接调用 A 股数据:行情 / K线 / 五档盘口 / 财务 / 资金 / 龙虎榜 / 板块 / 可转债 / 因子选股 / 宏观 —— 24 个工具,免费工具无需 Key。
桌面端、Web UI、命令行都能装 —— 下载桌面端 后,在「插件」页里输个包名就行。
支持 DeepSeek Harness 桌面端与 Web UI:
中文 · English
官网 · 文档 · 端点清单 · MCP 接入 · Agent Skill
GitHub 源码 · 问题反馈 Issues · 更新日志
这是什么
一个 A股数据 DeepSeek Harness 插件:装上之后,你在 DSH 里问「600667 现在多少钱」,它会自己去调工具拿真实数据,而不是编一个数给你。
桌面端、Web UI、命令行都能用 —— 桌面端 / Web UI 在「插件」页面输一个包名;命令行一条命令。
底层接的是 ashareapi.com 的 MCP 服务(一个 URL)。插件本身只负责把这个服务挂进 DSH —— 传输、工具注册、断线重连都由 DSH 自带的 MCP 客户端处理,所以 DSH 升级时插件基本不用跟着改。
Related MCP server: mcp-eastmoney
为什么用它
桌面端 / Web UI 输个包名就装好:不用配 JSON、不用写脚本,装完重启即可用
免费工具真的免 Key:
ashare_quote/ashare_kline/ashare_hot/ashare_market_overview/ashare_changedist这 5 个装上就能调,不用先买 Key多源自动切换:后端 70 个数据源互为备份,某个源出问题会自动换下一个,且不扣调用次数
口径固定,不用二次处理:K 线固定前复权(没有
adjust参数),不会二次复权无数据 ≠ 失败:停牌这类「市场真没数据」和「取数失败」分开返回 —— Agent 不会把停牌误判成故障
工具描述写给 AI 看:每个工具都写清「什么时候用 / 参数怎么填 / 返回什么」,Agent 不会调错
薄:插件不含任何数据逻辑,只有一份配置 —— 多源切换 / 缓存 / 巡检都在服务端,出问题最好排查
安装
桌面端 / Web UI(推荐)
下载 DeepSeek Harness 桌面端(macOS / Windows)后,打开左侧「插件」页面,输入包名:
ashareapi-dsh-pluginWeb UI(dsh web)里是同一个「插件」页面,操作一样。装完直接就能在对话里用 —— 不用命令行、不用改配置文件。
命令行
npx @deepseek-ai/dsh web # 启动 Web UI
npx @deepseek-ai/dsh plugin --profile web add ashareapi-dsh-plugin(已全局装过 dsh 的话,把 npx @deepseek-ai/dsh 换成 dsh 即可。)
命令行安装和 Web UI 的「插件」页面都会调用本机的 pnpm(DSH 不自带,桌面端自带一份)—— 没装的话先
npm i -g pnpm。
装完重启 dsh web 生效。启动前也可以先确认这一层挂上了:
npx @deepseek-ai/dsh --profile web --dump-config # 输出里应出现 # == ashareapi-dsh-plugin⚠️ 桌面端的 profile 由桌面应用自己管理,不能用命令行装 —— 桌面端请走上面的「插件」页面。
然后在对话里直接问:
你可以这样问 | 会用到的工具 |
600667 现在多少钱? |
|
帮我拉一下 600667 最近 60 天的日 K |
|
今天市场什么情况? |
|
现在大家都在看什么股票? |
|
今天涨跌家数怎么分布? |
|
其他安装方式(命令行):
# 从 GitHub
npx @deepseek-ai/dsh plugin --profile web add github:ashareapi/ashareapi-dsh-plugin
# 从本地目录(开发调试)
npx @deepseek-ai/dsh plugin --profile web add file:/绝对路径/ashareapi-dsh-plugin本插件是纯 JavaScript、没有构建步骤,所以从 GitHub 装也是装完即用 —— 不需要给 pnpm 开
allowBuilds授权。
卸载:
npx @deepseek-ai/dsh plugin --profile web remove ashareapi-dsh-plugin配置 API Key
上面 5 个免费工具不用配任何东西就能用。
要用其余 19 个工具(盘口 / 财务 / 资金 / 龙虎榜 / 板块 / 选股 / 宏观…),需要一个 Key:获取 Key(体验版 ¥9.9 起,24 个工具全开)。
方式一:环境变量(最省事)
在 ~/.dsh/.env 里加一行($DSH_HOME 改过就放那儿):
ASHAREAPI_KEY=ct-你的KEY方式二:写进 profile
编辑对应 profile 的 cordis.patch.yml —— Web UI / 命令行是 ~/.dsh/profiles/web/cordis.patch.yml,桌面端是 ~/.dsh/profiles/desktop/cordis.patch.yml(桌面端的目录要先打开一次桌面端才会生成)。加一条按 id 覆盖的补丁:
- id: mcp-ashareapi
name: ashareapi-dsh-plugin
config:
apiKey: ct-你的KEY⚠️ 这条补丁会整块替换该条目的
config,所以只写你要改的字段即可 —— 其余字段(端点、命名空间)用插件内置默认值。
可配置项
字段 | 默认值 | 说明 |
| 读环境变量 | 不填则走匿名,只有 5 个免费工具可用 |
|
| 走自建代理时改这里 |
|
| 工具名前缀,即 |
|
| 额外请求头,与上面的 Key 合并 |
其余字段(toolCallTimeoutMs、failOnStartupError 等)原样透传给 DSH 自带的 MCP 客户端。
工具
装好后工具名形如 mcp__ashareapi__ashare_quote。
免费(无需 Key)
ashare_quote 实时快照 · ashare_kline K线 · ashare_hot 热搜榜 · ashare_changedist 涨跌分布 · ashare_market_overview 市场总览
需 Key
ashare_orderbook 五档盘口 · ashare_snapshot 全字段画像 · ashare_finance 财务 · ashare_fund 资金流 · ashare_technical 技术指标 · ashare_shareholder 股东 · ashare_events 事件 · ashare_lhb 龙虎榜 · ashare_screen 因子选股 · ashare_sector 板块 · ashare_sector_valuation 板块估值 · ashare_macro 宏观 · ashare_bond 可转债 · ashare_etf ETF · ashare_ipo 新股 · ashare_dividend 分红 · ashare_dehydrated 脱水研报 · ashare_search 代码搜索 · ashare_usage 用量
字段含义、参数与返回样例见文档。
开发
npm test # 配置组装 + 拼写提示的回归护栏插件本体只有 index.js 一个文件、零运行时依赖:它把配置交给 DSH 自带的 MCP 客户端,不重复实现传输逻辑。这样 DSH 升级时通常不需要跟着改。
相关
官方 SDK:Python pip install ashareapi · Node.js / TypeScript npm install ashareapi
MCP 服务器:https://api.ashareapi.com/mcp(配置说明)—— 不用 DSH?Claude Code / Codex / Cursor 等 19 家客户端填一条 URL 就能接
Agent Skill(给 AI 读的接口说明书):https://ashareapi.com/skill
版本
最新版本见 CHANGELOG.md。
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
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.
Provide access to Chinese stock market data including historical prices, real-time data, news, and…
Read-only China A-share data for AI agents: market, limit-up, capital flow and disclosures.
China A-share market data for research, backtesting and AI agents via MCP.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceProvides access to Chinese mainland financial data including A-stock quotes, financial statements, industry analysis, and macroeconomics through 42 MCP tools, with automatic data source fallback and no API key required.43Apache 2.0
- 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.515MIT
- AlicenseAqualityCmaintenanceProvides 46 financial data tools for AI assistants covering A-share, HK, US markets, macroeconomics, funds, and derivatives, powered by AKShare.54MIT
- AlicenseCqualityBmaintenanceEnables AI agents to access Chinese financial market data and investment research through 177 tools, covering stocks, industries, macroeconomics, economic cycles, commodities, crypto, funds, and asset allocation.181MIT