The A-Share MCP Server is a specialized tool for the Chinese A-share stock market, providing comprehensive data access including stock information, historical price data, financial indicators, and macroeconomic data through the Model Context Protocol (MCP).
To set up the A-Share MCP Server on your system:
# 1. Create a virtual environment
uv venv
# 2. Activate the virtual environment
# On Windows
.venv\Scripts\activate
# On macOS/Linux
# source .venv/bin/activate
# 3. Install all dependencies
uv sync
Add the following to your MCP servers configuration:
{
"mcpServers": {
"a-share-mcp": {
"command": "uv",
"args": [
"--directory",
"C:\\Users\\YourName\\Projects\\a_share_mcp",
"run",
"python",
"mcp_server.py"
],
"transport": "stdio"
}
}
}
Important Notes:
uv
command is accessible in your system PATHIn the CherryStudio MCP server interface:
a-share-mcp
(or custom name)Local A-Share MCP Server
(or custom description)uv
(or full path to uv.exe)--directory
C:\\Users\\YourName\\Projects\\a_share_mcp
run
python
mcp_server.py
Troubleshooting: If the server doesn't activate immediately, try navigating away from the MCP settings and then back again.
Baostock data updates follow this schedule:
Daily updates:
Weekly updates:
Note that current trading day data won't be available until after 17:30.
The A-Share MCP Server provides numerous tools organized into categories:
get_historical_k_data
: Historical price dataget_stock_basic_info
: Basic stock informationget_dividend_data
: Dividend historyget_adjust_factor_data
: Adjustment factorsget_profit_data
: Profit statementsget_operation_data
: Operation metricsget_growth_data
: Growth indicatorsget_balance_data
: Balance sheet informationget_cash_flow_data
: Cash flow dataget_dupont_data
: DuPont analysis dataget_trade_dates
: Trading calendar informationget_all_stock
: Complete stock listingsget_stock_industry
: Industry classificationsget_sz50_stocks
: SSE 50 componentsget_hs300_stocks
: CSI 300 componentsget_zz500_stocks
: CSI 500 componentsget_deposit_rate_data
: Deposit ratesget_loan_rate_data
: Loan ratesget_required_reserve_ratio_data
: RRR dataget_money_supply_data_month
: Monthly money supplyget_money_supply_data_year
: Annual money supplyget_shibor_data
: SHIBOR ratesget_latest_trading_date
: Latest market dayget_stock_analysis
: Stock analysis metricsThere are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.