ashare-mcp
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 syncRun (stdio)
uv run ashare-mcpConfigure 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 |
|
Dividend / adjust |
|
Quarterly financials |
|
Reports |
|
Industry / constituents |
|
Macro |
|
Utility |
|
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 |
|
| Data backend. Only |
Development
uv run pytest -q # unit tests (no network)
uv run pytest -q -m network # live baostock smoke testNotes
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.
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/maimai-hqw/ashare-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server