Stock Market MCP Server for AI Finance Agents (43 Tools)

TickDB Research ·

Stock Market MCP Server for AI Finance Agents Cover

2026-12-03 live architecture benchmark: unifying US extended hours, Hong Kong equities, and China A-shares under one 43-tool MCP contract.

You wire Claude Code or Cursor to build a cross-market AI finance agent that compares NVDA.US, 0700.HK, and 600519.SH before the New York open. Halfway through the reasoning loop, Yahoo Finance starts throwing HTTP 429 rate limits, your US fundamentals MCP returns empty payloads for Hong Kong and Shanghai tickers, and a local Tushare script lacks US overnight prints. The pipeline never crashes—instead, the LLM quietly fills the gaps with stale training memory and emits a confident, completely fabricated valuation brief.

Who it's for: AI finance agent architects and quant engineers building with Claude Code, Cursor, Codex, or LangGraph across US, Hong Kong, and China A-shares
When to use it: Replacing brittle Yahoo Finance + Financial Datasets + Tushare multi-source glue that triggers 403s, rate limits, schema drift, and LLM price hallucinations
What you get: An objective 6-way financial MCP architecture matrix, live 2026-12-03 43-tool cross-market captures (13 market + 29 fundamentals), context-window tool-pruning math, 5 unit-tested anti-hallucination guardrails, and drop-in configs

30-Second TL;DR

  • Root cause: Stitching 3–4 regional data sources together compounds ticker-suffix mismatches, heterogeneous financial JSON keys, and unpruned MCP tool bloat (~6,880 schema tokens per turn across 43 tools).
  • Unified solution: A single 43-tool stock market MCP server (13 market data + 29 US/HK/A-share fundamentals + 1 subscription status) paired with intent-based tool pruning (5–8 tools per sub-agent, ~80% lower schema overhead) and 5 deterministic Python guardrails.
  • Honest scope: Choose Financial Datasets MCP if you strictly need US equities and raw SEC 10-K filings, or Tushare/AKShare if you only need domestic A-share local factors. Consolidate onto a unified cross-market MCP data layer only when your agent spans US, HK, and China A-shares under one reasoning workflow.

Why Multi-Source Glue (Yahoo Finance + Financial Datasets + Tushare) Breaks Production AI Finance Agents

Most teams do not set out to build a four-vendor Frankenstein stack. They start with a quick prototype: yfinance for quotes, Financial Datasets or FMP for US income statements, and a community Tushare or AKShare MCP server for Shanghai and Shenzhen stocks. The demo works on Friday afternoon—and silently degrades the moment real cross-Pacific workflows hit production.

Walk through what actually happens inside the Model Context Protocol (MCP) loop across four layers of friction:

  1. Symbol & Session Fragmentation: Yahoo Finance expects .SS for Shanghai stocks, Tushare expects .SH, and US extended sessions split into regular, post-market, overnight, and pre-market prints. When an agent queries three servers, one mismatching ticker suffix drops a leg of the comparison without raising a fatal exception.
  2. Heterogeneous Financial Schemas: Even when every call succeeds, revenue appears as totalRevenue in one server, revenue in a second, and localized Chinese keys in a third. Prompting the LLM to reconcile three financial schemas burns output tokens and invites unit-conversion errors between USD, HKD, and CNY.
  3. Unpruned MCP Context Bloat: Every mounted MCP tool injects its JSON parameter schema into the system prompt on every single reasoning turn. At roughly 160 tokens per tool schema, loading 43 unpruned tools consumes ~6,880 tokens per turn before the user asks a single question—and stacking three separate MCP servers pushes schema overhead past 10,000 tokens, measurably raising tool-selection confusion.
  4. Silent Failure Amplification: In real production logs, cross-border AI agents frequently hit HTTP 403 errors when asking Western providers for Hong Kong fundamentals (such as 0981.HK) or fail on missing secondary provider keys. Because LLMs are trained to be helpful, an unhandled 403 often triggers silent fallback to parametric memory rather than an explicit abort.

Multi-Source Glue Sprawl vs Unified 43-Tool MCP and Scoped Pruning

Figure 1: Replacing four fragmented upstreams with one 43-tool MCP engine plus intent-scoped 5–8 tool sub-agent packs cuts per-turn schema overhead by roughly 80%.

The engineering takeaway is straightforward: do not ask a probabilistic LLM to act as your ETL join engine. Collapse cross-market quotes and fundamentals onto one deterministic contract first, then expose only the 5–8 tools each sub-agent actually needs.


Objective 6-Way Financial MCP Comparison: Acknowledge Strengths Before Mapping the Cross-Market Gap

Every financial MCP server on the market solves a real niche. Before evaluating a unified cross-market stack, steelman the strongest public alternatives so your team picks the right boundary for its actual roadmap.

6-Way Financial MCP Capability and Cross-Market Coverage Matrix

Figure 2: Tri-state capability comparison across six widely adopted financial MCP and agent data stacks (Dec 2026 public documentation and live verification).

RankFinancial MCP / Data StackWhere This Stack Excels (Objective Strengths)Structural Boundary (Public Docs & Dec 2026 Checks)Deployment & Auth Model
1Financial Datasets MCPPurpose-built for US AI finance agents with exceptionally clean SEC financial statements, insider trades, and segmented US metrics.Strictly focused on US equities; lacks Hong Kong and China A-share real-time quotes, order books, and unified Asian fundamentals.Remote / Local MCP + API Key
2Alpha Vantage / FMP / EODHD MCPMature Western data ecosystems with deep technical indicators (AV), US/EU ratios (FMP), and broad global EOD breadth (EODHD).Cross-Pacific depth breaks down on HKEX and China A-share real-time quotes and deep fundamentals; teams often juggle multiple keys and hit regional 403 gaps.Official / Community MCP + API Key
3TickDBSingle contract unifying US (with pre/post/overnight), HK, and China A-share live quotes (13 tools) plus 29 cross-market fundamentals and 1 subscription tool (43 total); offers Hosted Streamable HTTP / OAuth and MIT open-source Docker/PyPI self-hosting.Excludes US options chains and raw SEC 10-K full-text parsing; no standalone Python/Go SDK repo (provides OpenAPI 3.0, AsyncAPI 3.0, CLI, and tickdb-mcp); requires sub-agent tool pruning to avoid context bloat.Hosted Streamable HTTP + OAuth / MIT Self-Host
4Yahoo Finance MCP (yfinance wrappers)Zero signup friction, broad symbol coverage, and fast 5-minute prototype validation.Unofficial reverse-engineered source prone to IP throttling, sudden schema shifts, missing L1/L2 depth, and inconsistent Asian capital-flow coverage.Local Python / uvx
5Tushare / AKShare Community MCPsUnmatched depth for China A-share domestic factors (dragon-tiger lists, margin financing, macro series) with vibrant local community scripts.Requires local Python/uvx runtime maintenance; public scraper wrappers face rate-limit jitter; lacks US overnight sessions and official hosted OAuth MCP.Local Python / uvx / Token
6Domestic Institutional Terminal Agents (iFinD / Wind)Deep domestic event databases, F10 announcements, and institutional Chinese research workflows.Closed terminal-centric ecosystems rather than MIT-licensed self-hostable MCP servers; friction-heavy inside Claude Code, Cursor, or international multi-agent stacks.Proprietary Terminal / Enterprise API

Notice how the decision tree resolves itself:

  • US-only SEC research agent: Financial Datasets MCP is cleaner and faster to adopt.
  • China A-share domestic factor research only: Tushare or AKShare community wrappers already cover niche local datasets well.
  • Cross-Pacific AI finance agent (US + HK + A-shares, quotes + fundamentals): Every single-region stack forces you back into multi-source glue—this is the exact gap a unified 43-tool MCP engine closes.

Live 2026-12-03 Verification: Single-Session Quotes + 29 Fundamentals Across NVDA.US, 0700.HK, and 600519.SH

Marketing pages often claim "global unified coverage" while hiding divergent field names behind the scenes. To verify actual payload symmetry, we executed live calls against the hosted 43-tool MCP server on 2026-12-03 at 10:00–10:05 UTC (18:00–18:05 CST) across three benchmark equities—NVDA.US (NASDAQ), 0700.HK (SEHK), and 600519.SH (SSE)—using a single session and one API key.

(Methodology note: this is a point-in-time live observation demonstrating schema parity and edge cases, not a long-term SLA guarantee or investment commentary.)

2026-12-03 Live Capture Across US, HK, and China A-Shares with 5 Guardrails

Figure 3: Point-in-time 2026-12-03 10:00 UTC capture showing unified quotes, identical canonical income-statement keys, live PE ranges, and five verified guardrails.

1. Identical Cross-Market Fundamental Schema (get_financials_latest & get_valuation_latest)

Across USD, HKD, and CNY filings, get_financials_latest(kind="IS") returned the exact same 8 canonical field_name keys (EPS, GrossMgn, NetProfit, NetProfitMarginDf, OperatingIncome, OperatingRevenue, ProfitQuality, ROEDf) with zero regional adapter code:

Symbol (Market / Currency)Live Regular Quote & Session DetailReporting Period (period_end)OperatingRevenue (YoY)GrossMgn / ROEDfLive PE (1Y Range · Sector Rank)
NVDA.US (US · USD)$151.72 (-3.00%) · Pre $148.415 · Ovn $151.28 · Post $150.42FY2027 Q3 (2026-10-25)$115.84B (+103.21%)74.82% / 105.38%16.25 (28.39–44.68 · 12/89)
0700.HK (HK · HKD)HK$341.80 (-0.93%) · Vol 13,525,378 shares2026 Q3 (2026-09-29)HK$242.58B (+15.07%)55.90% / 21.68%11.58 (14.45–21.02 · 9/24)
600519.SH (CN · CNY)¥1,485.00 (+0.22%) · 29,834 hands · Net flow +¥673.34M2026 Q3 (2026-09-29)¥40.27B (+3.08%)89.64% / 30.55%22.53 (19.30–20.66 · 6/31)

2. Solving Context-Window Bloat: How to Prune 43 Tools into 3 Scoped Sub-Agent Packs

Having 43 tools (13 real-time/historical market tools + 29 deep cross-market fundamentals & calendar tools + 1 subscription status tool) under one endpoint is a major architectural advantage—provided you never dump all 43 schemas into a single generalist prompt.

Instead, keep one MCP backend and mount intent-scoped tool allowlists per sub-agent in Claude Code, Cursor, or LangGraph:

Sub-Agent PackMounted ToolsExact Tool AllowlistEst. Schema Tokens (~160/tool)Overhead vs. Full 43 Tools
Realtime Monitor6get_ticker, get_kline, get_order_book, get_recent_trades, get_intraday, get_market_status~960 tokens-86.0%
Fundamental Research8get_stock_info, get_company_profile, get_financials_latest, get_financials_ttm, get_valuation_latest, get_segments_latest, get_shareholders_top, get_industry_peers~1,320 tokens-80.8%
Event & Capital Flow5get_capital_flow, get_report_calendar, get_ipo_calendar, get_dividends_ttm, get_company_news~820 tokens-88.1%
Unpruned Full Surface43All 13 market + 29 fundamental + 1 subscription tools~6,880 tokensBaseline

This pattern delivers the best of both worlds: one auth credential and one data contract underneath, with lean ~1,000-token reasoning contexts on top.

Mapping all 43 atomic tools by functional layer also shows why a single backend eliminates three separate vendor adapters across US, Hong Kong, and China A-shares:

Capability LayerToolsAtomic Coverage (US Extended / HK / China A-Shares)Primary Agent Role
Real-Time & Historical Market Data13Quotes, adjusted klines, order book, recent trades, intraday, capital flow, ex-factors, sessions & trade daysLive monitoring & gap alerts
Company Profile & Financial Statements7Company profile, executives, latest/annual/TTM financial statements, latest & historical revenue segmentsEarnings & margin synthesis
Valuation & Industry Benchmarks6Latest & historical valuation (PE), industry peers, industry distribution, sector rankings & hierarchy treeCross-market valuation screening
Shareholders, Funds & Capital Return8Dividends & TTM dividends, buybacks, latest/top shareholders, shareholder detail, fund holdings & corporate actionsOwnership & shareholder yield
Event Calendars, News & Status8Earnings, dividend, split, IPO & other calendars, company news & full news detail, live market statusCatalyst tracking & risk alerts
Subscription & Quota Status1API key subscription and entitlement statusGateway health & rate guards

Beyond the Config Snippet: 5 Live-Captured Anti-Hallucination Guardrails

Most tutorials stop once get_ticker returns JSON. In production, subtle cross-endpoint behaviors are what silently poison AI agent outputs. During our 2026-12-03 live capture, we deliberately probed boundary endpoints and surfaced five real-world quirks every cross-market agent pipeline should normalize deterministically before passing data to the LLM:

  1. Epoch Precision Mismatch (10-Digit Seconds vs. 13-Digit Milliseconds): get_ticker("600519.SH") returned timestamp: 1796281200000 (13-digit ms), while get_capital_flow("600519.SH") returned timestamp: 1796292275 (10-digit sec, intraday net inflow +¥673.34M, large buy ¥429.81M vs. large sell ¥145.71M). Joining raw integers misaligns timestamps by 1,000×.
  2. Cross-Asset Kline Sort Divergence: get_kline("NVDA.US", "1d", 5) returned bars in ascending order (1795582800000 to 1796187600000), whereas get_kline("XAUUSD", "1d", 5) returned bars in descending order (1796256000000 down to 1795910400000). Any agent assuming klines[-1] is the latest bar will invert gold return direction.
  3. Hong Kong Zero-Padding Drift (0700.HK vs. 700.HK): Calling get_ticker("0700.HK") echoed "symbol": "0700.HK", while get_valuation_latest("0700.HK") and get_stock_info("0700.HK") returned "symbol": "700.HK". Merging quote and valuation dicts by raw string key silently drops Hong Kong fundamentals unless you canonicalize HK prefixes.
  4. Recent IPO 40404 Profile Fallback + Empty/Zero Guards: Calling get_company_profile("ANT.US") (listed Nov 19, 2026) returned TickDB error 40404 (HTTP 404), while get_stock_info("ANT.US") immediately returned complete shares (13,219,642,274), float (1,077,737,351), and eps_ttm (-9.15). Production agents must automatically fall back to get_stock_info, cast optional string numerics via float(v or 0), and filter last_price > 0 before computing returns.
  5. Cross-Market Volume Units & US 4-Session Precedence: 600519.SH reports volume_24h: "29834" in hands (×100 shares), while US and HK equities report in shares. Meanwhile, NVDA.US simultaneously carries four session prices (regular 151.72, post 150.42, overnight 151.28, pre 148.415); your normalizer must pick the active session explicitly by timestamp freshness instead of letting the LLM guess.

Below is a zero-dependency Python guardrail layer verified against our 2026-12-03 capture (9/9 unit tests passing):

import re
from typing import Any

HK_RE = re.compile(r"^0*(\d{1,5})\.HK$", re.IGNORECASE)


def normalize_epoch_ms(ts: int | float | str) -> int:
    val = int(float(ts))
    return val * 1000 if val < 10**12 else val


def safe_float(val: Any, default: float = 0.0) -> float:
    if val is None or (isinstance(val, str) and not val.strip()):
        return default
    return float(val)


def canonicalize_symbol(symbol: str) -> str:
    clean = symbol.strip().upper()
    m = HK_RE.match(clean)
    return f"{m.group(1).zfill(4)}.HK" if m else clean


def sort_klines_ascending(klines: list[dict[str, Any]]) -> list[dict[str, Any]]:
    valid = [b for b in klines if b.get("time") and safe_float(b.get("close")) > 0]
    return sorted(valid, key=lambda b: normalize_epoch_ms(b["time"]))


def normalize_volume_shares(symbol: str, raw_volume: Any) -> float:
    vol = safe_float(raw_volume)
    canon = canonicalize_symbol(symbol)
    return vol * 100.0 if canon.endswith((".SH", ".SZ", ".BJ")) else vol


def resolve_profile(profile_resp: dict[str, Any], info_resp: dict[str, Any]) -> dict[str, Any]:
    if profile_resp.get("code") == 0 and profile_resp.get("data"):
        return profile_resp["data"]
    if info_resp.get("code") == 0 and info_resp.get("data"):
        data = info_resp["data"]
        return data[0] if isinstance(data, list) else data
    raise RuntimeError("Both company_profile and stock_info failed")

For high-throughput streaming pipelines where your agent also needs full-market WebSocket feeds across 26,000+ US/HK/A-share tickers, see our Full-Market Real-Time Stock WebSocket Architecture Guide. If you are migrating existing REST/WS infrastructure from Polygon.io (Massive), refer to our Polygon.io (Massive) Cross-Market Alternative Benchmark.


3-Minute Minimal Setup: Hosted OAuth MCP, Self-Hosted MIT Docker, and CLI

You can connect the 43-tool MCP server in three ways depending on your security boundary—no unofficial scraper dependencies or fragile local Python virtual environments required.

Option A: Zero-Install Hosted Streamable HTTP (Claude Code / Cursor)

Add the following entry to your Cursor .cursor/mcp.json or Claude Code MCP config (replace the header placeholder with your own key from transparent self-serve onboarding, or use the browser OAuth flow at https://mcp.tickdb.ai/oauth):

{
  "mcpServers": {
    "tickdb": {
      "url": "https://mcp.tickdb.ai/",
      "headers": {
        "X-TickDB-Key": "${MARKET_API_KEY}"
      }
    }
  }
}

Option B: Self-Hosted MIT Open-Source Container (tickdb-mcp) or CLI Verification

For teams auditing every outbound tool call inside private infrastructure, run the MIT-licensed tickdb-mcp server via Docker/PyPI or verify raw JSON directly via the official npm CLI (npm install -g tickdb):

# Verify multi-market live quotes via official CLI (comma-separated symbols)
tickdb ticker NVDA.US,0700.HK,600519.SH --json

# Or install the zero-registration ClawHub skill for agent coding sandboxes
npx clawhub@latest install tickdb-market-data

Explore the complete endpoint schemas, OpenAPI 3.0 / AsyncAPI 3.0 specs, and llms.txt index in the TickDB Documentation, or inspect market-specific coverage on the China A-Shares API and US Stocks API pages.


Honest Architectural Boundaries: When NOT to Use This Stack

A credible architecture recommendation states its boundaries upfront:

  1. US Options Chains & Raw SEC 10-K Full Text: If your agent relies on OPRA options Greeks or parsing 200-page SEC 10-K footnotes verbatim, pair your workflow with a dedicated options or SEC filing source.
  2. Standalone Python / Go Client SDKs: TickDB currently ships tickdb-mcp (PyPI, MIT), the tickdb npm CLI, OpenAPI 3.0, AsyncAPI 3.0, and native HTTP/WebSocket examples rather than a dedicated Python/Go wrapper SDK repository. Teams using native requests/httpx or MCP tool calls integrate cleanly with zero wrapper lock-in.
  3. Small-Context Models Without Tool Pruning: Mounting all 43 tools unfiltered into a small-context or low-tier model inflates token bills and increases wrong-tool calls. Always enforce the 5–8 tool sub-agent allowlist pattern above.

Frequently Asked Questions (FAQ)

Can a single stock market MCP server replace both Yahoo Finance and Tushare?

For cross-market AI finance agents that need US (including extended hours), Hong Kong, and China A-share real-time quotes plus standardized income statements, valuation percentiles, shareholders, and event calendars, yes—a single 43-tool MCP server removes multi-key glue and schema drift. Keep Tushare/AKShare only if you need specialized A-share-only local datasets such as dragon-tiger lists.

How do I prevent Claude Code or Cursor from hallucinating stock prices or financial metrics?

Combine two layers: (1) ground the model on live MCP tool outputs rather than web snippets or parametric memory, and (2) insert deterministic code guardrails that normalize 10-digit vs. 13-digit timestamps, sort klines ascending by time, canonicalize HK symbols (0700.HK vs. 700.HK), fall back on 40404 IPO profiles, and enforce explicit US session precedence.

Does mounting 43 MCP tools slow down or bloat my AI agent?

Only if all 43 JSON schemas are injected on every turn (~6,880 tokens). Splitting tools into three intent-scoped packs (6 realtime tools, 8 fundamental tools, 5 event/flow tools) keeps schema overhead around 820–1,320 tokens per turn while preserving one unified backend.

How do I start testing the 43-tool MCP server with Claude Code or Cursor?

TickDB offers transparent self-serve onboarding with Hosted OAuth MCP, MIT open-source self-hosting, and CLI access. Review the full tool catalog and integration guides on the TickDB AI Tools & MCP Hub.

7 markets · 91,730 symbols

US stocks
14,810
Hong Kong market
3,355
China stocks, ETFs & bonds
7,578
Forex & metals
1,228
Indices
13,960
Futures
49,787
Crypto
1,012
12/7/2026

Related articles

A-Share Minute Data API: A Stock Gapped Up and Is Still Up at 10:00. Has It Given Back the Gap?

When an A-share stock opens higher and is still up on the day at 10:00, how much of the opening gap is left? In a November 24 replay, the same CNY 167.73 Hygon price was 2.27% above the previous close and 1.29% below the open. Use the two baselines and the worksheet below to separate continuation, a fading gap and missing observations on your own watchlist.

TickDB Research ·