How to Connect Claude to Real-Time Market Data with MCP

TickDB Research ·

Meta description: Configure TickDB MCP to give Claude access to live market data with millisecond timestamps. Step-by-step setup for Claude Desktop, real JSON output, and a timestamp verification method so you know exactly when the data is from.


Claude gives you a price. How old is it?

Ask Claude "What's Apple trading at right now?" It answers. The number sounds plausible.

But there's no timestamp on that number. You don't know if it's from today's open, last month's earnings call, or a training dataset from two years ago. If you feed an unverified price into a research workflow, you're building on an unknown foundation — and you won't know it until the strategy breaks.

This isn't a hallucination in the traditional sense. Claude's training has a cutoff date. Without a live data connection, it reconstructs prices from memory, and memory doesn't carry timestamps.

The fix is Model Context Protocol (MCP): configure a real-time data source, and Claude calls a live API instead. Every response includes a timestamp. You can verify it.


What MCP changes

MCP is an open standard for connecting AI tools to external services. Once an MCP server is registered, Claude can call it during a conversation — the same way it might call a calculator or a code interpreter.

The difference in practice:

  • Without MCP → "Apple is trading around $185." (No source. No timestamp. Unknown date.)
  • With TickDB MCP → "last_price": "332.27", "timestamp": 1789156801000 (API-sourced. Timestamp verifiable.)

The price is a fact. The timestamp is proof of when that fact was observed.


Setting up TickDB MCP

TickDB provides an MCP server with 13 tools (as of 2026-08-04), covering real-time snapshots, historical candlestick data, order book depth, capital flow, intraday data, and market metrics.

Step 1: Get your API key

Sign up at tickdb.ai and copy your API key from the dashboard.

Step 2: Register the MCP server in Claude Desktop

Edit the Claude Desktop config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Add the following under mcpServers:

{
  "mcpServers": {
    "tickdb": {
      "command": "uvx",
      "args": ["tickdb-mcp@latest"],
      "env": {
        "TICKDB_API_KEY": "your_api_key_here"
      }
    }
  }
}

Verify the exact command against the current docs at tickdb.ai/docs/mcp.

Step 3: Fully restart Claude Desktop

Quit from the system tray (not just close the window) and relaunch. The TickDB tools should appear in the tool panel.


Verifying the connection: timestamps are the test

Once configured, ask Claude: "Get me a real-time snapshot of AAPL and 000001.SZ."

Claude calls get_ticker. The raw response:

{
  "code": 0,
  "message": "success",
  "data": [
    {
      "symbol": "AAPL",
      "name": "Apple Inc.",
      "last_price": "332.27",
      "open": "327.45",
      "high_24h": "336.22",
      "low_24h": "326.3",
      "volume_24h": "50716865",
      "price_change_percent_24h": "1.75",
      "timestamp": 1789156801000
    },
    {
      "symbol": "000001.SZ",
      "name": "Ping An Bank",
      "last_price": "11.8",
      "open": "11.73",
      "high_24h": "11.9",
      "low_24h": "11.72",
      "price_change_percent_24h": "0.51",
      "timestamp": 1789353765000
    }
  ]
}

Tested 2026-09-14, Claude Sonnet 4.6 via TickDB MCP. Output is from the actual API call — not constructed manually.

Now convert the timestamps to confirm they're valid:

from datetime import datetime, timezone
import pytz

def verify_ts(ts_ms: int, label: str, tz: str = "US/Eastern"):
    dt = datetime.fromtimestamp(ts_ms / 1000, tz=timezone.utc)\
                 .astimezone(pytz.timezone(tz))
    print(f"{label}: {dt.strftime('%Y-%m-%d %H:%M:%S %Z')}")

verify_ts(1789156801000, "AAPL")
# → 2026-09-11 18:00:01 EDT  (Friday after-hours — last US trading day before the weekend)

verify_ts(1789353765000, "000001.SZ", tz="Asia/Shanghai")
# → 2026-09-14 10:43:05 CST  (Monday morning, China A-share session)

The timestamps reveal something the numbers alone don't: AAPL's quote is from Friday's after-hours session because US markets don't trade on weekends. The 000001.SZ quote is from Monday morning because China's A-share market opened today. Without timestamps, you'd have no way to know this distinction.

Three-point acceptance check:

  1. timestamp field is present and is an integer
  2. Converted time falls within a plausible trading session for that market
  3. Field structure matches TickDB documentation (symbol, last_price, timestamp all present)

All three pass → the data is API-sourced, not reconstructed from model memory.


Common issues

Tools don't appear after restart

Most likely cause: JSON syntax error in the config file (JSON disallows comments and trailing commas). Also check that uvx is installed — run uvx --version; if it's missing, run pip install uv. Always quit from the system tray, not just close the window.

Authentication errors

Confirm that TICKDB_API_KEY is set inside the env block, with no extra whitespace or wrapping quotes around the key value itself.

Empty results or wrong symbol

US stocks use the plain ticker (AAPL). China A-shares use 000001.SZ (Shenzhen) or 600036.SH (Shanghai). Hong Kong stocks use 00700.HK. If you're unsure of the format, call get_available_symbols first to look up the correct symbol code.


What else you can do after get_ticker

Once get_ticker works, the other 10 Tier A tools follow the same pattern — describe what you need in plain language, and Claude selects the right tool:

ToolExample request
get_kline_latest"What's AAPL's current daily candle?"
get_kline"Give me AAPL's last 5 daily bars with volume"
get_capital_flow"Net capital flow for 000001.SZ today"
get_order_book"AAPL order book depth right now"
get_intraday"000001.SZ minute-by-minute data for today"
get_market_metrics"Current A-share market breadth indicators"
get_trading_sessions"What are the US market sessions today?"

Each tool's response includes a time field (timestamp or time). The verification logic is identical to the one above.


The underlying point

Configuring TickDB MCP doesn't solve "can Claude talk about markets." It solves "can you trust what Claude says about markets."

A response with a verifiable timestamp and a documented field structure is something you can act on. A response without a timestamp is a number without provenance — it might be right, but you have no way to confirm it.

TickDB's MCP tools give Claude access to structured market data: symbol, field, and time. That ordering matters. The time is what lets you decide whether the fact is current enough to use.


FAQ

How do I connect MCP to real-time financial data?

Register an MCP server in Claude Desktop's config file, specifying the server command and your API key. After a full restart, Claude can call live market data tools during conversations and return structured JSON responses, each with a timestamp.

How can an AI agent retrieve verifiable market data?

The key is the timestamp field. Every response from TickDB's MCP tools includes a millisecond-precision Unix timestamp. Convert it to local time and cross-check it against the market's trading hours to confirm the data is recent and API-sourced — not reconstructed from training memory.

Does Claude support real-time stock data by default?

No. Without an MCP configuration, Claude has no connection to live data and draws on its training knowledge, which has a cutoff date. Registering an MCP server like TickDB gives Claude access to real-time data with verifiable timestamps.

Does this work with Cursor?

Yes. Cursor supports MCP servers with equivalent configuration. The tool calls and JSON responses are identical to what Claude Desktop produces — only the config file location differs. Refer to Cursor's MCP documentation for the exact setup path.

相关文章

跨市场行情应用的涨跌幅:同刻黄金−0.69%还是+0.24%

做跨市场行情App,最容易被用户截图投诉的,是价格旁边那个红绿百分比。同一刻、同一个金价,涨跌可以是−0.69%,也可以是+0.24%。本文拆解涨幅榜、价格提醒、持仓页、首页详情页4个最容易出错的场景,附一张跨市场分母清单。 做跨市场行情App,最容易被用户截图投诉的,往往是价格旁边那个红绿百分比。 2026年10月13日周二,北京时间10:56,黄金4,175.15美元。同一个价格,我按5…

TickDB Research ·

A股美股港股行情看板Demo三天、上线三个月:拆解7个返工点

同一张行情表,寒武纪的成交额自己算是5,414万元,接口给的是54.20亿元,差了100倍,原因只是一个单位。行情看板三天就能接通,上线后的返工,几乎都来自界面上说不清“自己是什么”的数字。 本文依据上交所、港交所的一手文件,加上10月12日盘中对7类资产的实测,给你四样东西: 一张“价格身份证”:每个数字上线前要答的5个问题 7个返工点逐条拆:钱在哪里算错、为什么会错 一份可以直接发给数据…

TickDB Research ·

拆解美股夜盘数据5个口径:12月6日起美股进入23小时交易

同一只苹果股票,同一个周六中午,三个“最新价”,1万股持仓估值差出 9,500 美元。12月6日起,美股将进入近23小时交易:夜盘数据的5个口径不说清,日K线、收益率、风控和对账都会悄悄算错。 本文依据纳斯达克、SEC、DTCC、FINRA 等一手文件,加上30只美股(含9只中概股)的实测数据,给你四样东西: 一张“北京时间 × 美股夜盘”全景图(含11月1日夏令时切换前后) 5个口径逐条拆…

TickDB Research ·

港股数据源选型:踩一个回测就假(富途/IBKR/TickDB)

回测里某个港股策略表现稳定,实盘跑了一个月,收益差了将近一半。 不是完全对不上,是那种“差异不大但一直在”的偏差。团队排查了三周——策略逻辑、滑点模型、手续费、执行延迟,全部查过。最后发现问题在数据层:数据源返回的港股代码是“700”,而团队数据库里存的是“00700”。两个格式查出来的数据,部分重叠,部分不重叠。回测用的样本,比实际可交易的样本少了一批。 这不是某个操作失误,是港股数据接入…

TickDB Research ·

A股休市10天,港股跌了,美联储还要开会,APEC即将落地深圳——8号开盘,你盘清楚了几件事?

后天开盘。10月8日,A股恢复交易。你手里的A股仓位,价格停在9月30日;但如果你同时持有港股、美股、QDII,这10天它们一直在动——港股10月2日就开盘了,美股全程正常交易。 这篇文章要说的不是“A股休市了”。有仓位的人都知道A股休市。它要说的是: 同一段时间里,你的三个市场仓位在动,你的信息却只跟得上一个。 核心概念是 信息时态差 ——港股和美股的信息是连续的,每天有K线;A股的信息是…

TickDB Research ·