a-share
MCP server from firmmaple/a-share-mcp-server
claude mcp add --transport stdio firmmaple-a-share-mcp-server python mcp_server.py \ --env PORT="3000" \ --env LOG_LEVEL="INFO" \ --env BAOSTOCK_API_BASE_URL="https://api.baostock.com (or your Baostock endpoint)"
How to use
a-share-mcp is a Python-based MCP server focused on the A-share stock market. It exposes a range of tools that let you query stock basic information, historical K-line data, financial reports, and macroeconomic data, as well as market overview and technical indicators. You can connect to the server using the MCP protocol (for example from an AI assistant or CherryStudio) and invoke commands such as get_historical_k_data, get_stock_basic_info, get_profit_data, get_operation_data, get_trade_dates, and various market/indices helpers. The server is designed to be run locally and listens on port 3000 by default, enabling streamlined querying of A股 data through the MCP interface.
How to install
Prerequisites:
- Python 3.10+ installed
- pip available
- Basic network access to install dependencies
- Clone the repository
git clone https://github.com/firmmaple/a-share-mcp-server.git
cd a-share-mcp-server
- Install dependencies
pip install -r requirements.txt
- (Optional) Install additional indicators library for advanced calculations
pip install pandas-ta
- Run the MCP server
python mcp_server.py
The server will start and listen on port 3000 by default, ready to accept MCP connections.
Additional notes
Tips and notes:
- The MCP server provides a range of tools across stock data (历史K线、股票基础信息、分红、复权等), 财务报表数据, 宏观经济数据, 指标分析, 以及 估值分析等功能. You can enable or adjust behavior via environment variables such as PORT (to change the listening port) and BAOSTOCK_API_BASE_URL (if you configure a custom data source).
- If port 3000 is in use, set the port by exporting PORT in the environment before starting the server, for example: PORT=8080 python mcp_server.py
- When integrating with an AI assistant or CherryStudio, add a configuration block pointing to the a-share-mcp server, using the command python and the path to mcp_server.py as shown in the example.
- Ensure network access to Baostock or other data sources as required by the enabled tools.
- The MCP protocol and tool names are described in the documentation within the repository under docs and README sections for reference.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP