TuShare (Chinese Financial Data) MCP server

Integrates with TuShare financial API to provide structured access to Chinese market data including stock listings, concept themes, money flow statistics, and minute-level price data.
Back to servers
Provider
hanxuanliang
Release date
Apr 07, 2025
Language
Rust
Stats
5 stars

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.

Installation

Prerequisites

Before installing the MCP server, you need to:

  1. Have Rust and Cargo installed on your system
  2. Obtain a TuShare API token

Setting up the Environment

First, configure your TuShare API token:

  1. Create a .env file based on the example template:
cp .env.example .env
  1. Edit the .env file and add your TuShare token:
TUSHARE_TOKEN=your_token_here

Building from Source

To build the server from source:

cargo build --release

The compiled binary will be available at ./target/release/tsrs-mcp-server.

Using Pre-built Binaries

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.

Usage

Starting the Server

To start the MCP server, simply run the executable:

./target/release/tsrs-mcp-server

Available Tools

The server provides several MCP tools for stock market data:

Data Query Tools

Limit Step Tool

Retrieves stocks that have achieved consecutive daily limits.

Parameters:

  • trade_date: Trading date
  • start_date: Start date for range query
  • end_date: End date for range query
  • nums: Number of consecutive limit-ups

Returns: Stock codes, names, trading dates, and limit-up counts

THS Hot Stocks

Gets hot stock rankings from TongHuaShun App.

Parameters:

  • trade_date: Trading date

Returns: Stock information, rankings, popularity, and concept data

KPL List

Obtains limit-up and limit-down data.

Parameters:

  • tag: Tag type
  • start_date: Start date
  • end_date: End date

Returns: Detailed limit-up/down information and transaction data

KPL Concept

Retrieves KaiPanLa concept theme lists.

Parameters:

  • trade_date: Trading date

Returns: Theme codes, names, limit-up counts, etc.

KPL Concept Constituents

Gets constituent stocks of KaiPanLa concept themes.

Parameters:

  • trade_date: Trading date
  • ts_code: Stock code

Returns: Detailed information about theme constituent stocks

Limit Concept List

Retrieves concept sectors with the most limit-up stocks each day.

Parameters:

  • trade_date: Trading date
  • start_date: Start date
  • end_date: End date

Returns: Sector codes, names, consecutive limit data

THS Money Flow

Gets TongHuaShun individual stock capital flow data.

Parameters:

  • ts_code: Stock code
  • trade_date: Trading date
  • start_date: Start date
  • end_date: End date

Returns: Detailed capital flow data

THS Concept Money Flow

Retrieves daily capital flow data for TongHuaShun concept sectors.

Parameters:

  • trade_date: Trading date
  • start_date: Start date
  • end_date: End date

Returns: Sector capital flow data

Stock Minute Data

Gets minute-level A-share trading data.

Parameters:

  • ts_code: Stock code
  • freq: Frequency
  • start_date: Start date
  • end_date: End date

Returns: Minute-level trading data

Client Configuration

To connect to the server from a client like ChatWise, configure the connection settings as required by your client application.

How to add this MCP server to Cursor

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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later