Stock Data MCP Server

Comprehensive market data for A-shares, Hong Kong, US stocks, and crypto.

README.md

Stock Data MCP Server

English | 中文

MCP 服务器,提供 A股/港股/美股、加密货币数据查询,支持多数据源自动故障转移。

安装

PyPI

  • MCP 配置
{
  "mcpServers": {
    "stock-data": {
      "command": "uvx",
      "args": ["stock-data-mcp"]
    }
  }
}

Docker

docker run -p 8808:8808 ghcr.io/stockmcp/stock-data-mcp
  • MCP 配置
{
  "mcpServers": {
    "stock-data": {
      "url": "http://0.0.0.0:8808/mcp" # Streamable HTTP
    }
  }
}

Git 源码(开发版,会实时更新)

  • MCP 配置
{
  "mcpServers": {
    "stock-data": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/stockmcp/stock-data-mcp",
        "stock-data-mcp"
      ]
    }
  }
}
环境变量(可选)
变量 说明
TUSHARE_TOKEN Tushare Pro API Token(A股高优先数据源)
ALPHA_VANTAGE_API_KEY Alpha Vantage API Key(美股数据增强,不配置则使用 yfinance 免费源)
OKX_BASE_URL OKX API 代理地址
BINANCE_BASE_URL Binance API 代理地址
NEWSNOW_CHANNELS NewsNow 财经快讯频道列表(默认:wallstreetcn-quick,cls-telegraph,jin10

Claude Code

claude mcp add stock-data \
    -e TUSHARE_TOKEN=your_token \
    -e ALPHA_VANTAGE_API_KEY=your_key \
    -e OKX_BASE_URL=https://okx.4url.cn\
    -e BINANCE_BASE_URL=https://bian.4url.cn \
    -- uvx stock-data-mcp

工具列表

工具 说明
search 股票搜索
stock_info 股票信息
stock_prices 历史价格+技术指标
stock_realtime 实时行情
stock_batch_realtime 批量实时行情
stock_chip 筹码分布
stock_fund_flow 个股资金流向
stock_period_stats 多周期统计
stock_sector_spot 个股所属板块
stock_board_cons 板块成分股
stock_news 个股新闻
stock_news_global 全球财经快讯
stock_indicators_a A股财务指标
stock_indicators_hk 港股财务指标
stock_indicators_us 美股财务指标
stock_zt_pool_em A股涨停股池
stock_zt_pool_strong_em A股强势股池
stock_lhb_ggtj_sina A股龙虎榜
stock_sector_fund_flow_rank 板块资金流
stock_overview_us 美股公司概览(Alpha Vantage / yfinance)
stock_financials_us 美股财务报表(Alpha Vantage / yfinance)
stock_news_us 美股新闻情绪(需 Alpha Vantage API key)
stock_earnings_us 美股盈利数据(Alpha Vantage / yfinance)
stock_insider_us 美股内部交易(Alpha Vantage / yfinance)
stock_tech_indicators_us 美股技术指标(需 Alpha Vantage API key)
okx_prices 加密货币K线
okx_loan_ratios 加密货币借贷比
okx_taker_volume 加密货币买卖量
binance_ai_report 加密货币AI分析
get_current_time 系统时间及交易日
data_source_status 数据源状态

License

MIT

Tools 31

searchSearch for stocks
stock_infoGet detailed stock information
stock_pricesRetrieve historical prices and technical indicators
stock_realtimeGet real-time market data for a stock
stock_batch_realtimeGet real-time data for multiple stocks
stock_chipAnalyze chip distribution
stock_fund_flowTrack individual stock fund flow
stock_period_statsGet multi-period statistics
stock_sector_spotIdentify sectors for a specific stock
stock_board_consList constituent stocks of a board
stock_newsFetch news for a specific stock
stock_news_globalGet global financial news
stock_indicators_aGet A-share financial indicators
stock_indicators_hkGet Hong Kong stock financial indicators
stock_indicators_usGet US stock financial indicators
stock_zt_pool_emGet A-share limit-up pool
stock_zt_pool_strong_emGet A-share strong limit-up pool
stock_lhb_ggtj_sinaGet A-share dragon and tiger list
stock_sector_fund_flow_rankRank sectors by fund flow
stock_overview_usGet US company overview
stock_financials_usGet US financial statements
stock_news_usGet US stock news sentiment
stock_earnings_usGet US earnings data
stock_insider_usGet US insider trading data
stock_tech_indicators_usGet US technical indicators
okx_pricesGet cryptocurrency K-line data
okx_loan_ratiosGet crypto loan ratios
okx_taker_volumeGet crypto taker volume
binance_ai_reportGet AI-generated crypto analysis
get_current_timeGet system time and trading day status
data_source_statusCheck status of data sources

Environment Variables

TUSHARE_TOKENTushare Pro API Token for A-share data
ALPHA_VANTAGE_API_KEYAlpha Vantage API Key for US stock data
OKX_BASE_URLProxy URL for OKX API
BINANCE_BASE_URLProxy URL for Binance API
NEWSNOW_CHANNELSList of financial news channels

Try it

Get the latest real-time price and recent news for Apple (AAPL).
Show me the financial indicators and recent earnings report for a specific A-share stock.
What is the current fund flow trend for the semiconductor sector?
Provide an AI-based analysis report for Bitcoin using Binance data.
List the current A-share stocks that are in the strong limit-up pool.

Frequently Asked Questions

What are the key features of Stock Data MCP Server?

Supports A-shares, Hong Kong, US stocks, and cryptocurrency markets.. Provides technical indicators, financial statements, and news sentiment.. Features automatic failover across multiple data sources for reliability.. Includes specialized tools for market analysis like fund flow and chip distribution..

What can I use Stock Data MCP Server for?

Automating financial research by pulling real-time stock data directly into Claude.. Comparing financial indicators across different global markets.. Monitoring sector-specific fund flows to identify market trends.. Generating AI-driven summaries of cryptocurrency market reports..

How do I install Stock Data MCP Server?

Install Stock Data MCP Server by running: uvx stock-data-mcp

What MCP clients work with Stock Data MCP Server?

Stock Data MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Stock Data MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Open Conare