ashare-mcp
An MCP server that exposes all 23 baostock data endpoints as tools, including K-line, quarterly financials, performance reports, dividends, industry classification, index constituents, and macro series.
README
English | 简体中文
ashare-mcp
An MCP server built on baostock that exposes all 23 baostock data endpoints as MCP tools: K-line, quarterly financials (profit / operation / growth / balance / cash-flow / DuPont), performance express & forecast reports, dividends, adjust factors, industry classification, index constituents, the trading calendar, and macro series.
The data layer sits behind a DataProvider abstraction. v1 ships the
baostock backend, with the seam in place to add other sources (e.g.
eastmoney) later without touching the tool layer.
Install
uv sync
Run (stdio)
uv run ashare-mcp
Configure it in a stdio MCP client (Claude Desktop / Claude Code / Cursor):
{
"mcpServers": {
"ashare": {
"command": "uv",
"args": ["--directory", "/path/to/ashare-mcp", "run", "ashare-mcp"]
}
}
}
Tools
| Category | Tools |
|---|---|
| Market | get_stock_basic get_all_stock get_trade_dates get_history_k_data |
| Dividend / adjust | get_dividend_data get_adjust_factor |
| Quarterly financials | get_profit_data get_operation_data get_growth_data get_balance_data get_cash_flow_data get_dupont_data |
| Reports | get_performance_express_report get_forecast_report |
| Industry / constituents | get_stock_industry get_sz50_stocks get_hs300_stocks get_zz500_stocks |
| Macro | get_deposit_rate_data get_loan_rate_data get_required_reserve_ratio_data get_money_supply_data_month get_money_supply_data_year |
| Utility | get_current_time |
Every data tool returns a uniform shape: {"count": int, "fields": [...], "data": [{...}, ...]}.
Codes
Pass baostock-form codes: sh.600519, sz.000001, bj.430047. Bare 6-digit
codes (e.g. 600519) are normalized best-effort, but ambiguous index codes
(e.g. 000001 is both SSE Composite sh.000001 and Ping An Bank sz.000001)
should be passed with an explicit prefix.
Configuration
| Env var | Default | Meaning |
|---|---|---|
ASHARE_SOURCE |
baostock |
Data backend. Only baostock in v1. |
Development
uv run pytest -q # unit tests (no network)
uv run pytest -q -m network # live baostock smoke test
Notes
- baostock's data port must be reachable from your network (reachable inside mainland China; may time out elsewhere). If tools start timing out, check this first.
- baostock needs no registration, but each process still must call
bs.login()to open a session — this server logs in once and logs out on shutdown.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。