home / mcp / a-share-mcp mcp server
Provides access to A股 stock data, including historical prices, fundamentals, macro data, and analytical reports through an MCP interface.
Configuration
View docs{
"mcpServers": {
"24mlight-a-share-mcp-is-just-i-need": {
"command": "uv",
"args": [
"--directory",
"C:\\Users\\YourName\\Projects\\a_share_mcp",
"run",
"python",
"mcp_server.py"
]
}
}
}You can run the A股 MCP Server locally to query stock fundamentals, historical data, finance indicators, macroeconomic metrics, and more for the Chinese A-share market. It exposes a suite of tools that let you retrieve and analyze market data, generate reports, and support automated analyses from your preferred MCP client. This setup focuses on practical usage and easy client configuration so you can start querying data quickly.
Configure one or more MCP clients to connect to the local MCP server. You will run the server locally and then start queries from your MCP-enabled editor, IDE, or tool that supports the MCP protocol. Common tasks include retrieving historical price data, getting basic stock information, accessing financial reports, and generating market analyses. You can connect using standard input/output (stdio) configurations or a remote HTTP MCP endpoint, depending on your setup.
Prerequisites you need before running the server:
Installation steps you should follow in sequence to get the server running locally:
# 1. Create a virtual environment (only create, do not install yet)
uv venv
# 2. Activate the virtual environment
# Windows
.venv\Scripts\activate
# macOS/Linux
source .venv/bin/activate
# 3. Install all dependencies (must be run inside the activated environment)
uv syncConfiguration tips for MCP clients, troubleshooting notes, and important usage details are provided below to help you connect smoothly and maximize data accessibility.
The MCP server can be connected using local stdio configurations or an HTTP-based endpoint if you host it remotely. The following configuration examples show how to launch the MCP server via the uv tool and connect from an MCP client.
Important: ensure the command and arguments align with the examples exactly so the client can start the MCP server properly.
The server provides a comprehensive set of tools to cover stock data, finance, market analysis, macroeconomics, and utilities. Each tool exposes specific data queries and reporting capabilities.
Fetch historical K-line data for a stock, including open, high, low, close, and volume over a specified period.
Retrieve fundamental information about a stock, such as issuer, listing date, industry, and basic identifiers.
Access payout history and dividend-related data for a given stock.
Obtain adjustment factors used for back-adjusting historical prices to account for corporate actions.
Query profitability indicators from financial statements, such as net income and profit margins.
Retrieve operating efficiency metrics, including turnover and working capital indicators.
Access growth indicators such as revenue growth, earnings growth, and other expansion metrics.
Fetch balance sheet data including assets, liabilities, and equity components.
Obtain cash flow statements and related cash flow metrics.
Perform Dupont analysis to decompose return on equity into profitability, asset use efficiency, and leverage.
Retrieve concise performance express reports summarizing recent results.
Get earnings forecast reports and guidance for future performance.
Offer a summarized view of key financial indicators across multiple categories.
Provide trading calendar information, including trading days for the market.
List all securities in the market. Useful for broad analyses and filtering.
Search for stocks by name, code, or description to locate relevant instruments.
Fetch information on halted trading and suspension events.
Retrieve industry classification for stocks.
List constituents of market indices, such as major indices and sector indices.
Get constituents of the SZ50 index (top 50 stocks in the Shenzhen market).
Get constituents of the HS300 index (沪深300 constituents).
Get constituents of the ZZ500 index (中证500 constituents).
Provide a catalog of industry classifications used in stock categorization.
List stocks belonging to a specific industry.
Query bank deposit rates as part of macroeconomic data.
Query loan interest rates as part of macroeconomic data.
Retrieve required reserve ratio data for the banking system.
Access monthly money supply statistics.
Access yearly money supply statistics.
Return the most recent trading date in the dataset.
Specify the timeframe for market analysis results.
Check if a given date is a trading day.
Get the previous trading day relative to a given date.
Get the next trading day relative to a given date.
Retrieve data for the most recent N trading days.
Obtain the recent trading range over a specified window.
List month-end trading dates.
Generate a comprehensive analysis report for a stock.
Standardize stock codes for consistent querying.
Standardize index codes for consistent querying.
Query constant values used by tools for consistent references.