How to Connect Claude to Real-Time Market Data with MCP
作者: TickDB Research · 发布: 2026/9/14 · 阅读: 13
标签: 官网 英文 mcp 01
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:
timestampfield is present and is an integer- Converted time falls within a plausible trading session for that market
- 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:
| Tool | Example 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.
通过 TickDB API 获取实时行情数据
一个 API 接入外汇、加密货币、美股、港股、A股、贵金属和全球指数的实时行情。支持 WebSocket 低延迟推送,免费开始使用。
免费领取 API Key查看 API 文档