Get the FREE Ultimate OpenClaw Setup Guide →

china-stock

MCP server from peikuo/china-stock-mcp-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 peikuo-china-stock-mcp-server python main.py

How to use

China Stock MCP Server provides a unified API to access real-time and historical Chinese stock market data via the AKShare integration. Once the server is running, clients can query a variety of endpoints for A-shares, B-shares, indices, ETFs, and related market data such as real-time quotes, historical prices (daily, minute, tick), and fundamental information. The server exposes multiple MCP endpoints that map to AKShare functions, enabling developers to build apps that fetch live quotes, historical data, company fundamentals, and market intelligence without needing to manage multiple data sources. Typical usage involves starting the MCP server and then issuing requests to the configured endpoints to retrieve the data you need, for example real-time spot data or daily price history for a given symbol.

How to install

Prerequisites:

  • Python 3.8+ (recommended 3.9+)
  • Git
  • Internet access to install dependencies from PyPI

Installation steps:

  1. Clone the repository: git clone https://github.com/yourusername/china-stock-mcp.git cd china-stock-mcp/china-stock-mcp-server

  2. Create and activate a virtual environment: python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate

  3. Install dependencies: pip install -r requirements.txt

  4. Run the server: python main.py

Notes:

  • Ensure your environment has network access to fetch data from AKShare-supported sources.
  • If you modify dependencies or Python version, re-create the virtual environment as needed.

Additional notes

Tips and considerations:

  • The server relies on AKShare for data access; data availability may vary by exchange and data type. If a data source is temporarily unavailable, the corresponding endpoint may fail or return partial data.
  • Check for updates in AKShare compatibility when upgrading Python or dependencies.
  • If you plan to deploy in production, consider using a process manager (e.g., systemd, PM2) and enable logging to monitor uptime and data freshness.
  • For environment-specific configuration (e.g., proxies, API keys if required by AKShare adapters), set the appropriate environment variables prior to launching the server.
  • Review the API documentation within the server for endpoint names, parameters, and return formats to integrate with your applications smoothly.

Related MCP Servers

Sponsor this space

Reach thousands of developers