npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tushare-mcp-server

v1.0.1

Published

MCP server for Tushare Pro financial data API — A-shares, indices, funds, futures, options, bonds, HK/US stocks, macroeconomics

Readme

tushare-mcp-server

中文文档 | English

A Model Context Protocol (MCP) server for Tushare Pro financial data API. Provides AI assistants (GitHub Copilot, Claude, etc.) with direct access to comprehensive Chinese financial market data — covering A-shares, indices, funds, futures, options, bonds, forex, HK/US stocks, and macroeconomic indicators.

Features

  • Universal Querytushare_query calls any of the 173 Tushare Pro APIs
  • 15 Convenience Tools — Pre-built tools for stocks, indices, financials, funds, and more
  • Built-in Documentationget_api_doc / search_api_docs for API parameter lookup
  • Categorized Index — 173 APIs organized into 18 categories

Data Coverage

| Category | # | Examples | |----------|---|----------| | A-Shares | 37 | stock_basic, daily, weekly, monthly, daily_basic, adj_factor, pro_bar | | Financials | 9 | income, balancesheet, cashflow, fina_indicator, forecast | | Market Reference | 23 | margin, top_list, block_trade, hsgt_top10, pledge_stat | | Indices | 13 | index_basic, index_daily, index_weight, sw_daily, ci_daily | | Money Flow | 8 | moneyflow, moneyflow_hsgt, moneyflow_ind_ths | | Funds | 14 | fund_basic, fund_nav, fund_daily, etf_basic, fund_portfolio | | Futures | 8 | fut_basic, fut_daily, fut_holding, fut_mapping | | Options | 3 | opt_basic, opt_daily, opt_mins | | Bonds / CB | 9 | cb_basic, cb_daily, cb_issue, repo_daily, yc_cb | | HK Stocks | 9 | hk_basic, hk_daily, hk_income, hk_balancesheet | | US Stocks | 8 | us_basic, us_daily, us_income, us_balancesheet | | Macro Economy | 14 | shibor, cn_gdp, cn_cpi, cn_ppi, cn_pmi, libor | | Sector / Concept | 5 | ths_index, ths_daily, dc_index, dc_member | | Others | 13 | fx_daily, sge_daily, news, trade_cal, etc. |

Prerequisites

Quick Start

Install via npx (recommended)

No installation needed — just configure your MCP client:

{
  "servers": {
    "tushare": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "tushare-mcp-server"],
      "env": { "TUSHARE_TOKEN": "your_token_here" }
    }
  }
}

Install from source

git clone https://github.com/erwanjun/tushare-mcp-server.git
cd tushare-mcp-server
python3 -m venv .venv
source .venv/bin/activate
pip install mcp httpx

Configuration

Tushare Token

Set your token via any of these methods:

  1. .env file (recommended) — create .env in the project root:
    TUSHARE_TOKEN=your_token_here
  2. Environment variableexport TUSHARE_TOKEN=your_token
  3. MCP client config — pass via the env field (see examples below)

VS Code (GitHub Copilot)

.vscode/mcp.json:

{
  "servers": {
    "tushare": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "tushare-mcp-server"],
      "env": { "TUSHARE_TOKEN": "your_token_here" }
    }
  }
}

Claude Desktop

claude_desktop_config.json:

{
  "mcpServers": {
    "tushare": {
      "command": "npx",
      "args": ["-y", "tushare-mcp-server"],
      "env": { "TUSHARE_TOKEN": "your_token_here" }
    }
  }
}

Tools

| Tool | Description | |------|-------------| | tushare_query | Universal query — call any Tushare Pro API | | get_stock_list | A-share stock list | | get_trade_calendar | Trading calendar | | get_daily_bars | Daily OHLCV (unadjusted) | | get_daily_basic | Daily indicators: PE, PB, market cap, turnover | | get_income | Income statement | | get_balancesheet | Balance sheet | | get_cashflow | Cash flow statement | | get_fina_indicator | Financial indicators (ROE, ROA, margins) | | get_index_daily | Index daily bars | | get_moneyflow | Stock money flow | | get_concept | Concept / sector classification | | get_concept_detail | Concept constituents | | get_fund_basic | Fund list | | get_fund_nav | Fund NAV | | get_shibor | Shibor interest rates | | get_api_doc | Full API documentation by endpoint name | | search_api_docs | Search API docs by keyword |

Development

# Re-crawl Tushare documentation
python crawl_docs.py

# Rebuild API index
python build_index.py

License

MIT