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.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.