Enables secure storage and loading of Tushare API tokens through environment variables, allowing users to configure their credentials without hardcoding them.
Serves as the framework for exposing the MCP server's functionality via HTTP APIs, providing standardized endpoints for integration with other applications.
Provides version control for the MCP server codebase, with specific instructions for cloning the repository as part of the installation process.
Hosts the repository for the MCP server code, enabling users to clone and contribute to the project.
Referenced as a tool that might manage Python environments on some systems, with guidance for users in such environments.
Supported as a deployment platform with specific environment setup instructions for Linux users.
Supported as a deployment platform with specific environment setup instructions for macOS users.
Serves as the foundation for building tools that interact with Tushare's financial data APIs, providing comprehensive stock market data query capabilities.
Used to display project metadata badges such as license information and Python version requirements.
Tushare MCP
A股数据查询服务,基于 MCP (Model Context Protocol) 协议,支持通过 AI 助手(Claude Desktop、Cursor 等)用自然语言查询股票数据。
重要说明
本项目使用
如果你想用官方 tushare,修改 server.py 第 5 行:
同时修改 requirements.txt:将 tinyshare 替换为 tushare==版本号
功能
提供 25 个 MCP 工具,覆盖:
A股、港股基本信息
日线行情、财务报表
股东信息、指数数据
龙虎榜、交易日历
快速开始
安装
配置 Token
启动后,在 AI 助手中调用 setup_tushare_token 工具配置。
或手动创建配置文件:
启动服务
服务运行在 http://localhost:8000
健康检查:
http://localhost:8000/API 文档:
http://localhost:8000/docsMCP 端点:
http://localhost:8000/sse
使用
Claude Desktop
编辑配置文件 ~/Library/Application Support/Claude/claude_desktop_config.json:
重启 Claude Desktop 即可使用。
Cursor
设置 → MCP Servers → 添加:
名称:
tushareURL:
http://localhost:8000/sse
HTTP API
工具列表
Token 管理
setup_tushare_token- 配置 Tokencheck_token_status- 检查 Token 状态
股票信息
get_stock_basic_info- A股基本信息get_hk_stock_basic- 港股基本信息search_stocks- 搜索股票
行情数据
get_daily_prices- 日线行情(开高低收)get_daily_metrics- 换手率、PE/PBget_daily_basic_info- 股本、市值get_period_price_change- 区间涨跌幅
财务数据
get_financial_indicator- 财务指标get_income_statement- 利润表get_balance_sheet- 资产负债表get_cash_flow- 现金流量表get_fina_mainbz- 主营业务构成
股东信息
get_shareholder_count- 股东户数get_top_holders- 前十大股东
指数数据
search_index- 搜索指数get_index_list- 指数列表get_index_constituents- 指数成分股get_global_index_quotes- 国际指数行情
特色数据
get_pledge_detail- 股权质押get_top_list_detail- 龙虎榜get_top_institution_detail- 龙虎榜机构席位
工具
get_trade_calendar- 交易日历get_start_date_for_n_days- 计算往前N个交易日
数据格式
日期: YYYYMMDD(如 20240930)
股票代码:
A股:
000001.SZ(深圳) /600000.SH(上海)港股:
00700.HK指数:
000300.SH
金额单位:
财务数据: 亿元
股本: 万股
市值: 万元
Docker 部署
故障排查
Token 无效
服务无法访问
MCP 连接失败
License
MIT
This server cannot be installed
Related Resources
Related MCP Servers
- -securityAlicense-qualityA server based on Model Context Protocol that enables AI assistants to query and search for stock information using the Tushare API.Last updated -31MIT License
- Asecurity-licenseAqualityA Model Context Protocol server providing tools for querying A-share stock market data, including historical prices, financial reports, market indices, and macroeconomic indicators.Last updated -27458MIT License
- AsecurityAlicenseAqualityProvides real-time financial data to language models via MCP protocol, enabling access to stock prices, market indices, and financial news through Tushare API.Last updated -1581433312MIT License
- -securityFlicense-qualityA custom Model Context Protocol server that provides real-time financial analysis tools including stock monitoring, portfolio management, market summaries, and automated price alerts with Telegram notifications.Last updated -