stock-data-mcp
This server provides a comprehensive suite of 43 tools for querying financial market data, including A-shares, Hong Kong stocks, US stocks, and cryptocurrencies, with automatic failover across multiple data sources.
Key capabilities:
A-Share Market Data: Historical/real-time prices, company info, financial indicators, and tools for sentiment (dragon-tiger list, limit-up pool), fund flows, sector analysis, margin trading, block trades, shareholder data, institutional holdings, backtesting, and more.
US/HK Stock Data: Historical prices, company overviews, financial statements, earnings, insider transactions, news/sentiment, and technical indicators.
Cryptocurrency Data: OKX K-lines, loan ratios, taker volume, and Binance AI reports.
Market News & Utilities: Stock-specific and global financial news, current time/trading calendar, data source status, and symbol search.
Other Features: Automatic failover, support for multiple symbol formats, configurable via environment variables (API keys, endpoints).
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@stock-data-mcpwhat's the latest price of AAPL?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
stock-data-mcp
MCP 服务器,提供 A股/港股/美股、加密货币数据查询,支持多数据源自动故障转移。
PyPI
MCP 配置
{
"mcpServers": {
"stock-data": {
"command": "uvx",
"args": ["stock-data-mcp"]
}
}
}Git 源码(开发版,会实时更新)
MCP 配置
{
"mcpServers": {
"stock-data": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/stockmcp/stock-data-mcp",
"stock-data-mcp"
]
}
}
}Add to 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
## Current Coverage
Current provides 43 tools across A-share, HK, US stock, crypto, and market/news use cases.
### A-Stock
- `index_prices` - A股指数 K 线数据
- `stock_prices` - 个股 K 线数据
- `stock_realtime` - 个股实时行情
- `stock_batch_realtime` - 批量实时行情
- `search` - 股票搜索
- `stock_info` - 个股基本信息
- `stock_indicators` - 财务指标摘要
- `get_current_time` - 当前时间与交易日历
- `stock_lhb_ggtj_sina` - 龙虎榜
- `stock_sector_fund_flow_rank` - 板块资金流排名
- `stock_margin_trading` - 融资融券
- `stock_zt_pool` - 涨停池
- `stock_north_flow` - 北向资金
- `stock_block_trade` - 大宗交易
- `stock_holder_num` - 股东人数
- `stock_chip` - 筹码分布
- `stock_fund_flow` - 个股资金流向
- `stock_sector_spot` - 板块行情
- `stock_board_cons` - 板块成分股
- `stock_market_pe_percentile` - 市场 PE 分位
- `stock_industry_pe` - 行业 PE
- `stock_dividend_history` - 分红历史
- `stock_institutional_holdings` - 基金持仓
- `stock_earnings_calendar` - 业绩披露日历
- `stock_financial_compare` - 财务对比
- `stock_locked_shares` - 限售解禁
- `stock_pledge_ratio` - 质押比例
- `stock_top10_holders` - 十大股东
- `backtest_strategy` - 回测策略
### US / HK / Crypto / Market
- `stock_prices_us` - 美股/港股 K 线
- `stock_overview_us` - 美股概览
- `stock_financials_us` - 美股财报
- `stock_earnings_us` - 美股业绩
- `stock_insider_us` - 内部交易
- `stock_news_us` - 美股新闻
- `stock_tech_indicators_us` - 美股技术指标
- `okx_prices` - OKX 行情
- `okx_loan_ratios` - OKX 借贷比
- `okx_taker_volume` - OKX 主动买卖量
- `binance_ai_report` - Binance AI 报告
- `stock_news` - 个股新闻
- `stock_news_global` - 全球财经新闻
- `data_source_status` - 数据源状态
## Symbol Formats
Upstream tools normalize common stock-code inputs before routing. This is especially relevant for `stock_prices`, `stock_realtime`, `stock_info`, and `stock_indicators`.
- A股个股: `600519`, `000001`, `sh600519`, `sz000001`, `600519.SH`, `000001.SZ`
- ETF: `510300`, `159001`, `sh510300`, `sz159001`, `510300.SH`, `159001.SZ`
- 港股: `01810`, `1810`, `HK01810`, `01810.HK`, `1810.hk`
- 美股: `AAPL`, `MSFT`, `BRK.B`
Notes:
- 港股工具会将以上输入标准化为 5 位纯数字代码,例如 `01810.HK` -> `01810`
- A股和 ETF 工具会将带市场前缀或后缀的代码标准化为 6 位纯数字代码,例如 `sh600519` -> `600519`
- 美股代码会统一转为大写,例如 `brk.b` -> `BRK.B`
## Data Sources And Failover
- A股实时: `Efinance -> Akshare -> Tushare`
- 港股实时: `Akshare -> YFinance`
- ETF 实时: `Akshare -> YFinance`
- 美股实时: `YFinance -> AlphaVantage`
- 日 K 线: `Tushare -> Efinance -> Akshare -> Pytdx -> Baostock`
## Environment Variables
| Variable | Purpose |
|----------|---------|
| `TUSHARE_TOKEN` | Tushare API token |
| `ALPHA_VANTAGE_API_KEY` | Alpha Vantage API key |
| `OKX_BASE_URL` | Custom OKX API proxy endpoint |
| `BINANCE_BASE_URL` | Custom Binance API proxy endpoint |
| `NEWSNOW_CHANNELS` | Comma-separated news source channels |
| `ENABLE_EASTMONEY_PATCH` | Set to `true` to inject randomized `User-Agent` and `nid18` token for Eastmoney requests when Eastmoney endpoints are being rate-limited |
| `LOG_LEVEL` | Logging level, default `INFO` |
## Eastmoney Patch
If Eastmoney endpoints fail frequently with `RemoteDisconnected`, abrupt resets, or similar rate-limit style errors, enable:
```bash
export ENABLE_EASTMONEY_PATCH=trueWhen enabled, upstream will:
inject a randomized
User-Agentfetch and cache an Eastmoney
nid18tokenmerge the
nid18cookie into existing cookiesadd a small randomized delay before Eastmoney requests
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseBqualityBmaintenanceAn MCP server that exposes all 23 baostock data endpoints as tools, including K-line, quarterly financials, performance reports, dividends, industry classification, index constituents, and macro series.243
- Flicense-qualityCmaintenanceMCP server that wraps SFC financial data API into 32 tools for comprehensive A-share market data, including real-time quotes, rankings, limit-up statistics, news, themes, financials, charts, research reports, and watchlists.
- Alicense-qualityDmaintenanceProduction-grade MCP server for Chinese A-share market data, offering 30 tools including real-time quotes, K-lines, fund flows, and financial reports, with stdio and HTTP transport support.6MIT
- AlicenseAqualityCmaintenanceAn MCP server that gives AI assistants direct, structured access to China A-share market data.3Apache 2.0
Related MCP Connectors
7-factor stock scoring MCP server. US/HK/CN, 74 stocks. Free + Premium (USDC/Base). x402 ready.
MCP server exposing the Backtest360 engine API as tools for AI agents.
This MCP server provides seamless access to Malaysia's government open data, including datasets, w…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/openstockdata/stock-data-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server