This MCP server implements the Model Context Protocol to provide stock market data through TuShare API. It offers various tools for querying stock market information, including limit steps, hot stocks, concept boards, money flow data, and minute-level trading data.
Before installing the MCP server, you need to:
First, configure your TuShare API token:
.env
file based on the example template:cp .env.example .env
.env
file and add your TuShare token:TUSHARE_TOKEN=your_token_here
To build the server from source:
cargo build --release
The compiled binary will be available at ./target/release/tsrs-mcp-server
.
Alternatively, you can download pre-built binaries from the releases section, for example: tsrs-mcp-server-<tag>-aarch64-apple-darwin.tar.gz
for macOS ARM architecture.
To start the MCP server, simply run the executable:
./target/release/tsrs-mcp-server
The server provides several MCP tools for stock market data:
Retrieves stocks that have achieved consecutive daily limits.
Parameters:
trade_date
: Trading datestart_date
: Start date for range queryend_date
: End date for range querynums
: Number of consecutive limit-upsReturns: Stock codes, names, trading dates, and limit-up counts
Gets hot stock rankings from TongHuaShun App.
Parameters:
trade_date
: Trading dateReturns: Stock information, rankings, popularity, and concept data
Obtains limit-up and limit-down data.
Parameters:
tag
: Tag typestart_date
: Start dateend_date
: End dateReturns: Detailed limit-up/down information and transaction data
Retrieves KaiPanLa concept theme lists.
Parameters:
trade_date
: Trading dateReturns: Theme codes, names, limit-up counts, etc.
Gets constituent stocks of KaiPanLa concept themes.
Parameters:
trade_date
: Trading datets_code
: Stock codeReturns: Detailed information about theme constituent stocks
Retrieves concept sectors with the most limit-up stocks each day.
Parameters:
trade_date
: Trading datestart_date
: Start dateend_date
: End dateReturns: Sector codes, names, consecutive limit data
Gets TongHuaShun individual stock capital flow data.
Parameters:
ts_code
: Stock codetrade_date
: Trading datestart_date
: Start dateend_date
: End dateReturns: Detailed capital flow data
Retrieves daily capital flow data for TongHuaShun concept sectors.
Parameters:
trade_date
: Trading datestart_date
: Start dateend_date
: End dateReturns: Sector capital flow data
Gets minute-level A-share trading data.
Parameters:
ts_code
: Stock codefreq
: Frequencystart_date
: Start dateend_date
: End dateReturns: Minute-level trading data
To connect to the server from a client like ChatWise, configure the connection settings as required by your client application.
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 > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.