Tushare

Provides access to Tushare financial data via MCP, enabling data tools and backtesting workflows.
  • python

0

GitHub Stars

python

Language

7 months ago

First Indexed

3 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "cloga-tushare-mcp": {
      "command": "python",
      "args": [
        "C:\\Users\\lochen\\tushare_mcp_server\\server\\server.py"
      ],
      "env": {
        "TUSHARE_TOKEN": "your_token_here"
      }
    }
  }
}

You run a Tushare MCP Server to access financial data via MCP, enabling you to build tools and workflows for volatility analysis, options, ETFs, and backtesting strategies directly against Tushare data. This guide walks you through installing, configuring, and using the server with an MCP client.

How to use

Start the MCP server locally using the standard runtime command, then connect with your MCP client of choice. You can test the server setup with the MCP Inspector and run a variety of data tools to analyze volatility, fetch option and ETF data, and backtest a wheel-strategy style approach.

How to install

Prerequisites: ensure you have Python 3.10 or higher installed on your system. Obtain a Tushare Token from Tushare.pro.

Install the required Python dependencies for the server. Run the following command in your terminal from the project root.

pip install -r requirements.txt

Additional setup and usage notes

Configure your environment to provide the Tushare token when the server starts. Create a file named .env in the project root and set the token.

TUSHARE_TOKEN=your_tushare_token_here

Configuration and startup for MCP clients

If you want to run the server locally through an MCP client, you’ll configure a stdio MCP entry that runs the Python interpreter and points to the server entry script.

{
  "type": "stdio",
  "name": "tushare",
  "command": "python",
  "args": ["C:\\Users\\lochen\\tushare_mcp_server\\server\\server.py"],
  "env": {
    "TUSHARE_TOKEN": "your_token_here"
  }
}

Using with Claude Desktop

Add the MCP server to Claude Desktop by including the following in your claude_desktop_config.json. This config passes the Tushare token to the server at startup.

{
  "mcpServers": {
    "tushare": {
      "command": "python",
      "args": [
        "C:\\Users\\lochen\\tushare_mcp_server\\server\\server.py"
      ],
      "env": {
        "TUSHARE_TOKEN": "your_token_here"
      }
    }
  }
}

Testing and example tools you can use with MCP

Use the MCP Inspector to test interactions with the server. You can run tools to analyze price volatility, fetch options data, and retrieve ETF daily quotes.

Available tools and example usages

  • get_price_volatility: compute recent volatility for a stock and return frequency, window, and annualized volatility details.

  • get_option_basic: fetch contract metadata for options listed on a given exchange.

  • get_option_daily: fetch daily option data for a given ts_code and trade date.

  • get_fund_daily: fetch ETF or fund daily quotes.

  • backtest_wheel_strategy: run a backtest for a wheel strategy on a chosen underlying and date range.

Wheel Strategy and backtesting notes

The wheel strategy backtest uses ETF data and option data to simulate selling puts and calls on a monthly cadence, tracking premiums, assignments, and margin usage. Outputs include a report and dashboard under temp_data/.

If you want to run a quick in-CLI backtest, you can invoke the MCP tool directly to get high-level performance metrics without executing the full script.

Portfolio backtesting of multiple ETFs

You can backtest and rebalance a multi-ETF portfolio on a monthly cadence, generating equity curves and perf metrics in the temp_data/ directory.

Available tools

get_price_volatility

Calculates recent price volatility for a given identifier, with configurable window and frequency, and returns both period and annualized volatility metrics along with mean return per period.

get_option_basic

Retrieves option contract metadata (strike, type, expiration, etc.) for options listed on a specified exchange.

get_option_daily

Fetches daily option quotes for a given instrument code and trade date, enabling option-level analysis.

get_fund_daily

Fetches ETF or fund daily quotes, supporting fields selection and date range for analysis.

backtest_wheel_strategy

Runs a backtest of a wheel-style strategy on a chosen underlying and date range, returning performance metrics and recent trades.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational