The A-Share MCP server is a specialized Model Context Protocol (MCP) server focused on China's A-share market. It provides comprehensive data including stock information, historical K-line data, financial indicators, and macroeconomic data, designed to answer virtually any question about the Chinese stock market.
To set up and run the A-Share MCP server, follow these steps:
uv package manager# 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 this configuration to your IDE's MCP settings:
{
"mcpServers": {
"a-share-mcp": {
"command": "uv",
"args": [
"--directory",
"C:\\Users\\YourName\\Projects\\a_share_mcp",
"run",
"python",
"mcp_server.py"
],
"transport": "stdio"
}
}
}
Important notes:
\\) for Windows pathsuv command is accessible in your systemIn CherryStudio's MCP server configuration interface:
a-share-mcp (or custom)Local A-Share MCP Server (or custom)uv (or absolute path to uv.exe)--directoryC:\\Users\\YourName\\Projects\\a_share_mcprunpythonmcp_server.pyTip: If configuration doesn't activate immediately, navigate away from the settings page and then return to see the green indicator.
Baostock data updates follow this schedule:
Daily updates:
Weekly updates:
Note that current trading day data is not available before 17:30.
The A-Share MCP server offers 40 specialized tools across four categories:
Each tool accepts parameters to customize the output format (markdown, JSON, CSV) and limit the number of results returned.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "a-share-mcp" '{"command":"uv","args":["--directory","C:\\Users\\YourName\\Projects\\a_share_mcp","run","python","mcp_server.py"],"transport":"stdio"}'
See the official Claude Code MCP documentation for more details.
There 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 > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:
{
"mcpServers": {
"a-share-mcp": {
"command": "uv",
"args": [
"--directory",
"C:\\Users\\YourName\\Projects\\a_share_mcp",
"run",
"python",
"mcp_server.py"
],
"transport": "stdio"
}
}
}
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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.json2. Add this to your configuration file:
{
"mcpServers": {
"a-share-mcp": {
"command": "uv",
"args": [
"--directory",
"C:\\Users\\YourName\\Projects\\a_share_mcp",
"run",
"python",
"mcp_server.py"
],
"transport": "stdio"
}
}
}
3. Restart Claude Desktop for the changes to take effect