A-Share

v1.0.0Finance & Fintechstable

Provides comprehensive A-share (Chinese stock market) data including stock information, historical prices, financial reports, macroeconomic indicators, technical analysis, and valuation metrics through the free Baostock data source.

a-sharemcpai-integration
Share:
25
Stars
0
Downloads
0
Weekly
0/5

What is A-Share?

A-Share is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to provides comprehensive a-share (chinese stock market) data including stock information, historical prices, financial reports, macroeconomic indicators, technical analysis, and valuation metrics throug...

Provides comprehensive A-share (Chinese stock market) data including stock information, historical prices, financial reports, macroeconomic indicators, technical analysis, and valuation metrics through the free Baostock data source.

This server falls under the Finance & Fintech category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Provides comprehensive A-share (Chinese stock market) data i

Use Cases

Access comprehensive Chinese stock market data and pricing.
Retrieve financial reports and macroeconomic indicators.
Perform technical analysis and valuation on A-share securities.
firmmaple

Maintainer

LicenseMIT
Languagepython
Versionv1.0.0
UpdatedMay 18, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx a-share

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use A-Share

The A-Share MCP Server connects AI assistants to comprehensive Chinese stock market data via the free Baostock data source — no API key required. It provides tools covering historical K-line prices, financial reports (profit, balance sheet, cash flow, DuPont analysis), macroeconomic indicators (deposit/loan rates, money supply, Shibor), technical indicators (MACD, RSI, Bollinger Bands), valuation metrics (PEG, DCF, DDM), and major index constituents like CSI 300 and Shanghai 50. Investors and quant researchers use it to perform fundamental and technical analysis on A-share securities directly within Claude.

Prerequisites

  • Python 3.10 or higher
  • pip for installing Python dependencies
  • No API key required — data is sourced from the free Baostock service
  • Optional: pandas-ta library for advanced technical indicator calculations
  • An MCP-compatible client such as Claude Desktop or Claude Code
1

Clone the repository

The server is not published to PyPI; clone it from GitHub to get the source code and requirements file.

git clone https://github.com/firmmaple/a-share-mcp-server.git
cd a-share-mcp-server
2

Install dependencies

Install the required Python packages. The pandas-ta library is optional but recommended for advanced technical analysis features like MACD and RSI calculations.

pip install -r requirements.txt

# Optional: enable advanced technical indicators
pip install pandas-ta
3

Test the server locally

Run the server directly to confirm it starts without errors. The server connects to Baostock on startup and begins listening for MCP requests on port 3000.

python mcp_server.py
4

Add the server to your MCP client configuration

Open claude_desktop_config.json and add the a-share-mcp entry. Replace the path values with the actual absolute paths on your system.

{
  "mcpServers": {
    "a-share-mcp": {
      "command": "python",
      "args": ["/absolute/path/to/a-share-mcp-server/mcp_server.py"],
      "cwd": "/absolute/path/to/a-share-mcp-server"
    }
  }
}
5

Restart your MCP client and query stock data

Fully restart Claude Desktop. Ask Claude for historical prices or financial data on any A-share stock using its market-prefixed code (sh.600519 for Shanghai, sz.000001 for Shenzhen).

A-Share Examples

Client configuration

claude_desktop_config.json entry running the a-share-mcp server via Python. Update the paths to match your local clone location.

{
  "mcpServers": {
    "a-share-mcp": {
      "command": "python",
      "args": ["/Users/yourname/a-share-mcp-server/mcp_server.py"],
      "cwd": "/Users/yourname/a-share-mcp-server"
    }
  }
}

Prompts to try

Example prompts for stock data, financial reports, technical analysis, and macroeconomic indicators.

- "Get the basic info for Kweichow Moutai (sh.600519)"
- "Show me the daily K-line data for sz.000001 from 2024-01-01 to 2024-03-31"
- "Retrieve the Q4 2023 profit report for BYD (sz.002594)"
- "Calculate MACD and RSI technical indicators for CATL (sz.300750) over the last 6 months"
- "What are the current CSI 300 constituent stocks?"
- "Show China's current deposit rates and reserve ratio"

Troubleshooting A-Share

Baostock connection errors on startup

Baostock requires an internet connection and occasionally has maintenance windows. Retry after a few minutes. Ensure no firewall is blocking outbound connections from Python to the Baostock servers.

Technical indicators return errors or None values

Install the optional pandas-ta library with `pip install pandas-ta`. Some advanced indicators (MACD, RSI, Bollinger Bands) depend on this package. Confirm installation with `python -c "import pandas_ta; print(pandas_ta.__version__)"`.

Stock code not found or returns empty data

A-share codes require a market prefix: use sh. for Shanghai Exchange stocks (e.g., sh.600519) and sz. for Shenzhen Exchange stocks (e.g., sz.000001). Use the get_all_stocks tool to browse available codes.

Frequently Asked Questions about A-Share

What is A-Share?

A-Share is a Model Context Protocol (MCP) server that provides comprehensive a-share (chinese stock market) data including stock information, historical prices, financial reports, macroeconomic indicators, technical analysis, and valuation metrics through the free baostock data source. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install A-Share?

Follow the installation instructions on the A-Share GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with A-Share?

A-Share works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is A-Share free to use?

Yes, A-Share is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Finance & Fintech MCP Servers

Explore all finance & fintech servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "a-share": { "command": "npx", "args": ["-y", "a-share"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use A-Share?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides