Get the FREE Ultimate OpenClaw Setup Guide →

mcp-baostock

MCP server from HuggingAGI/mcp-baostock-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio huggingagi-mcp-baostock-server uvx mcp-baostock-server

How to use

This MCP server provides access to BaoStock-based stock market data through a set of endpoints implemented in Python. It supports querying basic stock information, historical K-line data, industry classifications, dividend information, quarterly financial indicators (profitability, efficiency, growth), index data, and valuation indicators. Once running, you can invoke the server's endpoints to fetch data for specified tickers and time ranges. Use the included examples as guidance for requesting different data types and consult the server's API documentation (if provided) for the exact path names and query parameters.

How to install

Prerequisites:

  • Python 3.10+
  • baostock
  • pandas

Installation steps:

  1. Create and activate a virtual environment (recommended): python3 -m venv venv source venv/bin/activate # Linux/macOS .\venv\Scripts\activate # Windows
  2. Install required Python packages: pip install baostock pandas
  3. Install the MCP BaoStock server package (the server implementation): pip install mcp-baostock-server # if the package name matches the MCP server
  4. Run the MCP server (as shown in the README): uv run mcp-baostock-server

Notes:

  • If you are deploying in a container or different environment, ensure Python 3.10+ is used and dependencies are installed accordingly.

Additional notes

Environment variables and configuration tips:

  • Make sure network access to BaoStock APIs is available from your deployment environment.
  • If you encounter SSL or certificate issues with external APIs, configure the system trust store or disable strict SSL temporarily (not recommended for production).
  • The server may expose multiple endpoints for stock basics, K-line data, industry classifications, dividends, quarterly indicators, indices, and valuations; refer to the API documentation for exact route paths and query parameters.
  • For debugging, enable verbose logs if the server supports it and ensure the BaoStock package is up to date.
  • If running inside a container, map appropriate ports and provide any necessary API keys or access tokens if the server requires authentication for certain endpoints.

Related MCP Servers

Sponsor this space

Reach thousands of developers