- Home
- MCP servers
- A-share
A-share
- python
19
GitHub Stars
python
Language
5 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"firmmaple-a-share-mcp-server": {
"command": "python",
"args": [
"mcp_server.py"
]
}
}
}You run an MCP server focused on the A股 market to answer questions about stocks, historical data, financials, macroeconomics, and more. It exposes a consistent querying interface that you can connect to from AI assistants or other MCP clients to fetch up‑to‑date stock information and analytical data.
How to use
You connect your MCP client to the local or remote MCP server and request data using the available tools. The server provides stock basic information, historical K data, financial statements, macroeconomic data, market overviews, and technical indicators. You can ask questions at different levels, such as details for a single stock, comparisons across groups, or time-bound analyses, and your AI assistant will format the responses for easy interpretation.
How to install
Prerequisites you need before installation: Python 3.10 or higher and the pip package manager. You also should be prepared to install optional dependencies for advanced capabilities.
# Clone the project repository
git clone https://github.com/firmmaple/a-share-mcp-server.git
cd a-share-mcp-server
# Install core dependencies
pip install -r requirements.txt
# Optional: install advanced technical indicators library
pip install pandas-ta
Run the server
Start the MCP server locally with Python. The server will listen on the default port and accept MCP connections from your client.
python mcp_server.py
Configure your MCP client
In your AI assistant or MCP client, register the local server as an MCP endpoint so you can send queries and receive structured responses.
{
"mcpServers": {
"a_share_mcp": {
"command": "python",
"args": ["mcp_server.py"],
"cwd": "."
}
}
}
Available tools
get_stock_basic_info
Query basic stock information such as code, name, listed status, and industry for a given stock code.
get_historical_k_data
Fetch historical K-line data for a stock over a specified date range.
get_profit_data
Retrieve profit-related metrics for a company, such as net income and margins, by year or quarter.
get_operation_data
Obtain operating metrics from financial statements to assess ongoing business performance.
get_growth_data
Access growth indicators like revenue growth and earnings growth over time.
get_balance_data
Get balance sheet data including assets, liabilities, and equity for a given period.
get_cash_flow_data
Retrieve cash flow statements to evaluate cash generation and usage.
get_dupont_data
Compute Dupont analysis metrics to understand return on equity drivers.
get_trade_dates
Fetch valid trading dates within a specified range or calendar context.
get_all_stock
List all available stocks covered by the data source.
get_stock_industry
Retrieve industry classifications for stocks and sector groupings.
get_sz50_stocks
Get the list of SZ50 constituent stocks.
get_hs300_stocks
Get the list of HS300 constituent stocks.
get_zz500_stocks
Get the list of ZZ500 constituent stocks.
get_deposit_rate_data
Obtain recent or historical deposit rates from macro data sources.
get_loan_rate_data
Access loan rate data for macroeconomic context.
get_required_reserve_ratio_data
Query reserve requirement data to understand monetary policy indicators.
get_money_supply_data_month
Fetch monthly money supply metrics.
get_money_supply_data_year
Fetch yearly money supply metrics.
get_shibor_data
Retrieve SHIBOR rate data for interbank liquidity outlook.
get_technical_indicators
Compute or retrieve technical indicators such as moving averages, MACD, RSI.
get_moving_averages
Calculate or access moving averages for trend analysis.
calculate_bollinger_bands
Compute Bollinger Bands for volatility and price channel assessment.
calculate_macd
Calculate MACD indicator for momentum signaling.
calculate_rsi
Calculate RSI for relative strength and momentum.
get_valuation_metrics
Retrieve valuation metrics to assess relative pricing.
calculate_peg_ratio
Compute PEG ratio as a growth-adjusted valuation multiple.
calculate_ddm_valuation
Perform Dividend Discount Model based valuation.
calculate_dcf_valuation
Perform Discounted Cash Flow valuation analysis.
get_comparable_analysis
Run a comparable company analysis to benchmark valuations.
get_market_analysis_timeframe
Analyze market data across a defined timeframe.
format_trading_calendar
Format and interpret trading calendar data for planning.
validate_stock_code
Validate stock code formats and correctness.
get_latest_trading_date
Fetch the latest trading date in the dataset.