Tushare_MCP
<div align="center">
Intelligent Stock Data Assistant Based on Model Context Protocol (MCP)

</div>
<br>
This project is developed based on the financial data interfaces provided by Tushare, with supported capabilities including:
- Tool invocation, such as stock market data, in-depth financial data, and index data.
- Secure Tushare Token configuration and status check mechanism.
- Standardized HTTP API interfaces through FastAPI encapsulation, facilitating integration with other applications.
<br>
For ease of experience, the core `server.py` (basic data service) and the newly added `hotlist.py` (popular list and theme data service) have been deployed online via Render. You can quickly experience these two services in an AI IDE that supports MCP (such as Cursor or Trae) using the following `mcp.json` configuration:
json
{
"mcpServers": {
"Tushare_mcp": {
"url": "https://tushare-mcp.onrender.com/sse",
"type": "sse"
},
"hotlist_mcp": {
"url": "https://hotlist-mcp.onrender.com/sse",
"type": "sse"
}
}
}
👉Quick Experience Guide with cherry studio
20250515 Update
Added hotlist.py, a powerful tool module focused on tracking hot lists and deep thematic exploration!
With hotlist.py, you can easily achieve:
- Single tool query: Quickly obtain concept sector lists, limit-up and limit-down stock lists, or real-time app hot lists for specific dates and markets (such as KPL, Tonghuashun, Dongfangcaifu).
- Intersection analysis capability: Combine concept/theme and constituent stock data from different platforms to efficiently identify potential sectors or individual stocks recognized by multiple authoritative sources.
- Insight into abnormal data: By combining constituent stocks of concept sectors with limit-up, limit-down, and hot list data, accurately filter out stocks that are performing strongly or showing key signals within specific themes.
- Trend analysis support: Query market data for a particular concept sector over a period of time, or track the frequency of a stock/sector appearing on historical hot lists to assist in judging the sustainability of its popularity and changes in capital attention.
You can ask the AI assistant questions of the following types (and more):
- "What are the popular concept sectors on Tonghuashun today?"
- "Which stocks hit the limit-up yesterday?"
- "Which stocks are both part of Theme A on KPL and Concept B on Tonghuashun?"
- "In the Tonghuashun concept of Artificial Intelligence, which component stocks hit the limit-up today?"
- "Query the daily price change of the New Energy Vehicle sector index over the past month."
- "Help me count how many times a certain stock has appeared on the Tonghuashun hot stock list in the past week."
✨ Supported Capabilities
- Comprehensive stock data query:
- Provides basic stock information, real-time quotes (daily, indicators), and historical price change queries.
- Supports intelligent search by stock code or name.
<br>
- In-depth financial data analysis:
- Obtain detailed financial statements of listed companies, including income statements, balance sheets, and cash flow statements.
- Query key financial indicator data.
<br>
- Index and market data coverage:
- Supports querying basic information of major indices, obtaining constituent stocks, and global index quotes.
<br>
- Shareholder and company fundamental information:
- Query number of shareholders, top ten shareholder information, daily share capital value, and equity pledge details.
<br>
- Popular lists and thematic data (provided by
hotlist.py):
- KPL (KaiPianLa) data:
- Concept theme list query (can be filtered by date, code, name).
- Concept theme constituent stock query (can be filtered by date, theme code, stock code).
- Obtain limit-up, limit-down, broken board, natural limit-up, and auction list data.
- Daily limit-up and limit-down statistics:* Obtain detailed statistical data on daily stock limit up (U), limit down (D), and board breaking (Z).
- Tonghuashun (THS) Data:
- Query list of sector indices (concepts, industries, regions, etc.).
- Query component stocks of concept sectors.
- Daily market data for sector indices.
- Tonghuashun App hotlist data (hot stocks, concept sectors, ETFs, etc.).
- Eastmoney Data:
- Daily concept sector data query (can be filtered by code, name, date range).
- Daily component stocks of concept sectors.
❌ Unsupported Capabilities
- News, research reports, and other information data
- More granular technical data (minute lines, Tick quotes)
- Macroeconomic data, futures, options, and other non-stock data
🚀 Quick Start
Environment Requirements
- Python 3.8+
- Tushare account and API Token (get it from: Tushare Pro Token Application Page, please register yourself)
Installation Steps
-
Clone the repository:
bash
git clone <Your GitHub Repository HTTPS or SSH Link>
cd <Your Project Directory Name>
-
Create and activate a virtual environment (recommended):
bash
python -m venv venv
source venv/bin/activate # Linux/macOS
venv/Scripts/activate # Windows
-
Install dependencies:
bash
pip install -r requirements.txt
Configure Tushare Token
This project requires a Tushare API Token to function properly. You can configure the Token in the following ways:
- **Using a
.env file (recommended, secu…