A-Share
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.
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
Maintainer
Works with
Installation
Manual Installation
npx a-shareConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
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-serverInstall 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-taTest 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.pyAdd 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"
}
}
}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.
A-Share Alternatives — Similar Finance & Fintech Servers
Looking for alternatives to A-Share? Here are other popular finance & fintech servers you can use with Claude, Cursor, and VS Code.
ValueCell
★ 10.7kValueCell is a community-driven, multi-agent platform for financial applications.
Vibe Trading
★ 8.1k'Vibe-Trading: Your Personal Trading Agent'
Quantdinger
★ 6.2kAI quantitative trading platform for crypto, stocks, and forex with backtesting, live trading, market data, and multi-agent research.vibe-trading ,trading-agents,ai-trader,ai-trading
TradingView
★ 2.8kReal-time crypto & stock screening, advanced technical indicators, Bollinger Bands intelligence, candlestick patterns + native Claude Desktop integration. Multi-exchange (Binance, KuCoin, Bybit+). Open-source AI trading infrastructure.
Financial Datasets
★ 2.1kProvides access to comprehensive financial data including income statements, balance sheets, cash flow statements, stock prices, company news, SEC filings, and cryptocurrency information with built-in financial ratio analysis.
Stripe
★ 1.6kThe Stripe Model Context Protocol server allows you to integrate with Stripe APIs through function calling. This protocol supports various tools to interact with different Stripe services.
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.
Set Up A-Share in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.