home / mcp / a-share-mcp mcp server

a-share-mcp MCP Server

Provides access to A股 stock data, including historical prices, fundamentals, macro data, and analytical reports through an MCP interface.

Installation
Add the following to your MCP client configuration file.

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.

How to use

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.

How to install

Prerequisites you need before running the server:

  • Python 3.10+ is required
  • A working MCP client that supports stdio or HTTP MCP connections
  • A Windows, macOS, or Linux environment

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 sync

Additional sections

Configuration tips for MCP clients, troubleshooting notes, and important usage details are provided below to help you connect smoothly and maximize data accessibility.

Configuration and usage notes

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.

Tools overview

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.

Available tools

get_historical_k_data

Fetch historical K-line data for a stock, including open, high, low, close, and volume over a specified period.

get_stock_basic_info

Retrieve fundamental information about a stock, such as issuer, listing date, industry, and basic identifiers.

get_dividend_data

Access payout history and dividend-related data for a given stock.

get_adjust_factor_data

Obtain adjustment factors used for back-adjusting historical prices to account for corporate actions.

get_profit_data

Query profitability indicators from financial statements, such as net income and profit margins.

get_operation_data

Retrieve operating efficiency metrics, including turnover and working capital indicators.

get_growth_data

Access growth indicators such as revenue growth, earnings growth, and other expansion metrics.

get_balance_data

Fetch balance sheet data including assets, liabilities, and equity components.

get_cash_flow_data

Obtain cash flow statements and related cash flow metrics.

get_dupont_data

Perform Dupont analysis to decompose return on equity into profitability, asset use efficiency, and leverage.

get_performance_express_report

Retrieve concise performance express reports summarizing recent results.

get_forecast_report

Get earnings forecast reports and guidance for future performance.

get_fina_indicator

Offer a summarized view of key financial indicators across multiple categories.

get_trade_dates

Provide trading calendar information, including trading days for the market.

get_all_stock

List all securities in the market. Useful for broad analyses and filtering.

search_stocks

Search for stocks by name, code, or description to locate relevant instruments.

get_suspensions

Fetch information on halted trading and suspension events.

get_stock_industry

Retrieve industry classification for stocks.

get_index_constituents

List constituents of market indices, such as major indices and sector indices.

get_sz50_stocks

Get constituents of the SZ50 index (top 50 stocks in the Shenzhen market).

get_hs300_stocks

Get constituents of the HS300 index (沪深300 constituents).

get_zz500_stocks

Get constituents of the ZZ500 index (中证500 constituents).

list_industries

Provide a catalog of industry classifications used in stock categorization.

get_industry_members

List stocks belonging to a specific industry.

get_deposit_rate_data

Query bank deposit rates as part of macroeconomic data.

get_loan_rate_data

Query loan interest rates as part of macroeconomic data.

get_required_reserve_ratio_data

Retrieve required reserve ratio data for the banking system.

get_money_supply_data_month

Access monthly money supply statistics.

get_money_supply_data_year

Access yearly money supply statistics.

get_latest_trading_date

Return the most recent trading date in the dataset.

get_market_analysis_timeframe

Specify the timeframe for market analysis results.

is_trading_day

Check if a given date is a trading day.

previous_trading_day

Get the previous trading day relative to a given date.

next_trading_day

Get the next trading day relative to a given date.

get_last_n_trading_days

Retrieve data for the most recent N trading days.

get_recent_trading_range

Obtain the recent trading range over a specified window.

get_month_end_trading_dates

List month-end trading dates.

get_stock_analysis

Generate a comprehensive analysis report for a stock.

normalize_stock_code

Standardize stock codes for consistent querying.

normalize_index_code

Standardize index codes for consistent querying.

list_tool_constants

Query constant values used by tools for consistent references.