What is MCP BaoStock Server?
A stock data server built on BaoStock that provides multiple MCP interfaces for querying Chinese stock market data, including basic info, historical K-line data, industry classification, dividends, quarterly financial indicators, index data, and valuation metrics.
How to use MCP BaoStock Server?
Install dependencies (Python 3.10+, baostock, pandas) and run the server with uv run mcp-baostock-server. The server exposes nine MCP tools, each demonstrated with Python test cases for specific stocks and date ranges.
Key features of MCP BaoStock Server
- Query stock basic information (listing date, industry)
- Retrieve historical daily K-line data (with forward adjustment)
- Look up industry classification for a stock
- Get dividend and bonus distribution records
- Access quarterly profitability, operational, and growth metrics
- Fetch index data (e.g., CSI 300 daily line)
- Obtain valuation indicators (P/E, P/B, etc.)
Use cases of MCP BaoStock Server
- Analyze a stock’s historical price trends using adjusted K-line data
- Retrieve dividend details for a given stock and year
- Evaluate a company’s quarterly earnings, efficiency, and growth ratios
- Compare index performance over a custom date range
- Monitor valuation metrics (P/E, P/B) over time for individual stocks
评论