Stock SDK

Market data for China A-shares, Hong Kong and US stocks, funds, futures and options over MCP

By Link (individual) TypeScript Local · stdio Finance and paymentsData and analytics

73 popularity score ★ 2.0k ↓ 1.9k/wk

Connect your client

Local (npm)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

Claude CodeTerminal
claude mcp add stock-sdk -- npx -y stock-sdk mcp
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "stock-sdk": {
      "command": "npx",
      "args": [
        "-y",
        "stock-sdk",
        "mcp"
      ]
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "stock-sdk": {
      "command": "npx",
      "args": [
        "-y",
        "stock-sdk",
        "mcp"
      ]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "stock-sdk": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "stock-sdk",
        "mcp"
      ]
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.stock-sdk]
command = "npx"
args = ["-y", "stock-sdk", "mcp"]
Gemini CLITerminal
gemini mcp add --scope user stock-sdk npx -- -y stock-sdk mcp

Settings 3

STOCK_SDK_MCP_TOOLS Optional: Which tools to expose: core (default, 26 tools), full (all 93) or a comma-separated list of tool names.
STOCK_SDK_MCP_PROMPTS Optional: Which built-in prompts (AI Skills) to expose: core (default), full or a comma-separated list.
STOCK_SDK_MCP_TIMEOUT Optional: Request timeout in milliseconds for the upstream data calls; the SDK default applies when unset.

What it does

stock-sdk is a zero-dependency JavaScript/TypeScript library for stock market data, and since v2 its npm package also ships a command-line tool and a built-in MCP server started with `stock-sdk mcp`. The server speaks MCP over stdio only and opens no network port; its protocol layer is written by hand rather than with the official MCP SDK.

Every tool maps to a read-only method of the library: real-time and historical quotes and candles for China A-shares, Hong Kong and US stocks and Chinese mutual funds, technical indicators and signal detection, holder cost distribution, industry and concept sectors, money flow, Stock Connect northbound data, limit-up pools, the dragon-tiger list, block trades, margin data, domestic and global futures, exchange options, fund details and a trading calendar. The data is pulled live from public finance endpoints such as Tencent Finance and East Money; for A-share candles it falls back to Tencent and then Sina when East Money throttles. It is aimed above all at the Chinese market, and many tool descriptions and field names are in Chinese.

The tool set is chosen with `STOCK_SDK_MCP_TOOLS`. At v2.4.6 the source registers 93 tools, of which 26 are marked core and exposed by default; `full` exposes all of them, or a comma-separated list picks individual tools. The README says 92, and the docs' overview page says the server offers tools only, but the v2.4.6 server also serves MCP prompts ("AI Skills" such as `analyze_stock`), filtered the same way by `STOCK_SDK_MCP_PROMPTS` (src/spec/methods.ts, src/mcp/server.ts).

What it needs

RuntimeNode.js 18+

Node.js 18 or later with npx (the package is run from npm). No account, API key or sign-in. The machine needs outbound internet access to the public finance endpoints (Tencent Finance, East Money, Sina) it pulls data from.

Limits

Quotes come from public endpoints and are not exchange-matched real time: its README says they usually lag by tens of seconds to minutes and are not suited to high-frequency trading decisions. Only 26 of the 93 tools are on unless STOCK_SDK_MCP_TOOLS=full is set; a prompt that needs a non-core tool fails until it is enabled. Coverage is uneven by market: block trades and margin data are A-share only, and Hong Kong and US calendars give market status only. Transport is stdio only, with no HTTP/SSE or resources. No trading or account access: the raw passthrough method is deliberately not exposed as a tool. Upstream endpoints can rate-limit, which the SDK handles with retries and fallbacks.

Who it suits

Suits developers, analysts and hobby investors who want an assistant to pull Chinese A-share, Hong Kong, US stock, fund, futures or options data, sector and money-flow figures, or indicator-based signals, without an API key or paid data plan, running locally through npx. It is read-only, so it cannot place orders or see a brokerage account. It is not official from any exchange or data vendor, relies on unofficial public endpoints that can change or throttle, and has delayed quotes, so pick a licensed market-data feed when you need guaranteed, real-time or redistributable data. Its strongest coverage is mainland China; for mostly US data a US-focused data server may fit better.

Tools 60 of 93

get_a_share_quotes
Full real-time quotes for given China A-share codes (core)
get_hk_quotes
Real-time quotes for Hong Kong stocks (core)
get_us_quotes
Real-time quotes for US stocks (core)
get_fund_quotes
Latest estimates for Chinese mutual funds (core)
get_today_timeline
Intraday minute-by-minute price line for one A-share (core)
get_history_kline
Daily, weekly or monthly candles for an A-share (core)
get_minute_kline
1 to 60 minute candles for an A-share (core)
get_hk_history_kline
Historical candles for a Hong Kong stock (core)
get_us_history_kline
Historical candles for a US stock (core)
get_kline_with_indicators
Candles with MA, MACD, BOLL, KDJ, RSI and other indicators added (core)
get_kline_signals
Detects crossovers, overbought/oversold and breakout signals on candles (core)
get_chip_distribution
Cost distribution of A-share holders: profit ratio, average cost, peaks (core)
get_industry_list
Lists A-share industry sectors (core)
get_industry_constituents
Stocks belonging to one industry sector (core)
get_concept_list
Lists A-share concept/theme sectors (core)
get_concept_constituents
Stocks belonging to one concept sector (core)
get_futures_kline
Candles for a domestic Chinese futures contract (core)
get_individual_fund_flow
Money-flow history for one A-share (core)
get_fund_flow_rank
Ranks stocks by net money inflow (core)
get_northbound_flow_summary
Summary of Stock Connect northbound and southbound flows (core)
get_zt_pool
Stocks that hit their daily limit-up, and related pools (core)
get_dragon_tiger_detail
Exchange dragon-tiger list of unusual trading seats for a date range (core)
get_theme_list
Lists theme fund categories (core)
is_trading_day
Says whether a date is an A-share trading day (core)
get_market_status
Whether a market is open, closed or on break now (core)
search
Finds stocks and funds by keyword or code (core)
get_a_share_simple_quotes
Short-form A-share quotes
get_fund_flow
Real-time money-flow snapshot for given A-shares
get_panel_large_order
Large-order breakdown from the order book for A-shares
get_a_share_code_list
Full list of A-share codes
get_hk_code_list
Full list of Hong Kong stock codes
get_us_code_list
Full list of US stock codes
get_fund_code_list
Full list of mutual fund codes
get_all_a_share_quotes
Quotes for the whole A-share market (5000+ stocks) in one call
get_all_hk_quotes
Quotes for the whole Hong Kong market
get_all_us_quotes
Quotes for the whole US market
get_quotes_by_codes
Batch quotes for a list of A-share codes
get_hk_minute_kline
Minute candles for a Hong Kong stock
get_us_minute_kline
Minute candles for a US stock
get_hk_chip_distribution
Holder cost distribution for a Hong Kong stock
get_us_chip_distribution
Holder cost distribution for a US stock
get_industry_spot
Live quotes for one industry sector
get_industry_kline
Candles for an industry sector index
get_concept_spot
Live quotes for one concept sector
get_concept_kline
Candles for a concept sector index
get_etf_option_daily_kline
Daily candles for an ETF option contract
get_cffex_option_quotes
Quotes for China Financial Futures Exchange options
get_global_futures_spot
Spot quotes for global futures
get_futures_inventory
Warehouse inventory history for a futures product
get_comex_inventory
COMEX gold and silver inventory
get_market_fund_flow
Market-wide money-flow history
get_sector_fund_flow_rank
Ranks sectors by money inflow
get_northbound_holding_rank
Stocks ranked by northbound holdings
get_stock_changes
Intraday unusual-move events across the market
get_unusual_fluctuation
Exchange-flagged abnormal fluctuation warnings
get_block_trade_detail
Block trade records
get_margin_target_list
Stocks eligible for margin trading
get_fund_nav_history
Net asset value history for a mutual fund
get_fund_profile
Fund profile: top holdings, manager, size
get_trading_calendar
A-share trading calendar

Similar servers