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.

Related articles

Forex WebSocket API in Python: Is EURUSD Still Updating?

For Python developers building a forex quote monitor, this guide uses TickDB to subscribe to EURUSD and save each quote with its data timestamp and local receipt time. A bounded script writes raw messages, a quote CSV and a run summary. Quote counts, receipt gaps and changes in data timestamps help distinguish an open connection from continuing quote updates. The recorded 30-second observation received 38 EURUSD messages. The same code lets you inspect a new sample in your own environment.

TickDB Research ·

Integrate a Stock API in Python: Fetch Quotes, Validate Responses, Preserve Timestamps

How do you turn a stock API response into a usable quote display? Keep the key on the server, validate the response, match records by symbol, and show the price with its quote time. A live TickDB request for AAPL.US and MSFT.US returned both symbols successfully, but its top-level quote timestamps were older than its pre-market timestamps. The runnable Python example below makes that distinction visible and handles missing or malformed records.

TickDB Research ·

Integrating a Forex Real-Time Market Data API: How to Avoid Displaying Stale Quotes After a WebSocket Reconnection

After integrating real-time market data into a forex dashboard, exchange-rate monitor, or price alert, when should the page resume showing that it is “updating normally” once the connection is restored? This article is aimed at developers responsible for these features. Using TickDB’s actual EUR/USD subscription as an example, it walks through the full process of connecting, subscribing, deliberately disconnecting, and reconnecting, and explains how quote timestamps, heartbeats, and page status work together to keep teams from being misled by stale data. Product managers and technical colleagues can use the recovery sequence and acceptance checklist in the article to jointly review the page behavior.

TickDB Research ·

Forex Tick Data API: Live Quotes, Historical Downloads, and Access Costs

For quant teams choosing an FX data supplier, a working live feed answers only part of the purchasing question. Research may need historical bid and ask updates, while a dashboard may need current quotes and charts. This guide explains how to distinguish quotes, trades, and bars, check historical access, and compare costs against a specific job. It includes a dated EUR/USD quote sample, three actual TickDB historical queries, and a supplier questionnaire you can copy into an enquiry.

TickDB Research ·

Stock API in Practice: Using MCP to Analyze Tech Stocks, Gold, and Forex

A stock API gives AI access to real-time U.S. stock market data and historical price bars. Combining those records with gold prices and forex quotes makes cross-market analysis possible. This walkthrough uses actual TickDB MCP requests to examine the October 22, 2026 technology stock selloff, calculate comparable returns, and separate price observations from explanations.

TickDB Research ·