<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Howlia</title>
    <description>The latest articles on DEV Community by Howlia (@howlia).</description>
    <link>https://dev.to/howlia</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4216798%2F0a57c85c-f94a-4b1c-930d-a84c8bbdf7e7.png</url>
      <title>DEV Community: Howlia</title>
      <link>https://dev.to/howlia</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/howlia"/>
    <language>en</language>
    <item>
      <title>Introducing Market Data to AI Assistants with MCP</title>
      <dc:creator>Howlia</dc:creator>
      <pubDate>Fri, 30 Oct 2026 09:28:54 +0000</pubDate>
      <link>https://dev.to/howlia/introducing-market-data-to-ai-assistants-with-mcp-1a4o</link>
      <guid>https://dev.to/howlia/introducing-market-data-to-ai-assistants-with-mcp-1a4o</guid>
      <description>&lt;p&gt;An AI assistant can explain a market move, but first it needs the prices, the time window, and the context behind the numbers. Model Context Protocol (MCP) offers a way to make tools available to an AI client, so it can request data as part of a conversation or workflow.&lt;/p&gt;

&lt;p&gt;This introduction uses TickDB MCP and a real cross-market example to show what that looks like: selecting instruments, retrieving historical price bars, comparing returns, and checking a later quote. The same checks apply when building your own data-powered assistant.&lt;/p&gt;

&lt;h2&gt;
  
  
  What MCP adds to a market data workflow
&lt;/h2&gt;

&lt;p&gt;A market data API returns structured information such as quotes and historical price bars. An MCP server exposes tools that an AI client can discover and call. The client can use the returned data to answer a question, run calculations, or prepare a chart.&lt;/p&gt;

&lt;p&gt;For example, a user might ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How did Meta, the Nasdaq, gold, and the yen move during the October 22 U.S. trading session?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The workflow can be broken down into inspectable steps:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Question → Choose instruments and time range → Call MCP tools
→ Check the returned data → Calculate changes → Explain the result
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;TickDB supplies the market data; the AI client coordinates the tool calls and presentation. The assistant still needs to interpret the returned fields correctly. MCP makes the tools available; it does not guarantee that a model chooses the right symbols, time range, or calculation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choose comparable data
&lt;/h2&gt;

&lt;p&gt;The example uses four instruments:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Instrument&lt;/th&gt;
&lt;th&gt;Role in the comparison&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;META.US&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Meta shares, quoted in U.S. dollars per share&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;IXIC&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Nasdaq Composite index&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;XAUUSD&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Gold quoted in U.S. dollars per ounce&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;USDJPY&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;U.S. dollars quoted in Japanese yen&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These prices have different units, so comparing their raw levels is not useful. First, query the same observation window for each instrument. Then calculate a percentage change from a consistent starting point.&lt;/p&gt;

&lt;h2&gt;
  
  
  Request historical bars
&lt;/h2&gt;

&lt;p&gt;TickDB MCP exposes a &lt;code&gt;get_kline&lt;/code&gt; tool for historical price bars. This is the actual Meta request used in the original analysis. It shows the tool name and arguments, not the full MCP protocol envelope:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"tool"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"get_kline"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"arguments"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"symbol"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"META.US"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"stock"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"interval"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"5m"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"adjust"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"none"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"start_time"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1792675800000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"end_time"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1792698900000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"limit"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The request selects five-minute, unadjusted stock bars. The millisecond timestamps identify bar start times from October 22, 2026 at 13:30 UTC through 19:55 UTC; the final bar ends at 20:00 UTC. The other instruments were queried over the same range, using &lt;code&gt;type: indices&lt;/code&gt; for IXIC and &lt;code&gt;type: forex&lt;/code&gt; for XAUUSD and USDJPY. &lt;code&gt;adjust&lt;/code&gt; applies to the stock request in this example.&lt;/p&gt;

&lt;p&gt;The successful Meta response has business code &lt;code&gt;0&lt;/code&gt; and places records under &lt;code&gt;data.klines&lt;/code&gt;. Here is an excerpt of the first bar:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"code"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"data"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"symbol"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"META.US"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"interval"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"5m"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"klines"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"time"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1792675800000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"open"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"676.35000000"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"high"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"681.07000000"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"low"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"657.40000000"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"close"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"657.41000000"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Prices are strings in this response, so convert them explicitly before calculating. Check the business code, required fields, and whether the series is empty; a missing record or error is not a zero price. Also check timestamps and the trading session before describing a result as current.&lt;/p&gt;

&lt;h2&gt;
  
  
  Calculate changes over the same window
&lt;/h2&gt;

&lt;p&gt;Each response in this example contains 78 five-minute bars. Using the first bar's open and the last bar's close for the October 22 U.S. regular session gives:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Instrument&lt;/th&gt;
&lt;th&gt;First open&lt;/th&gt;
&lt;th&gt;Last close&lt;/th&gt;
&lt;th&gt;Change&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;META.US&lt;/td&gt;
&lt;td&gt;676.35&lt;/td&gt;
&lt;td&gt;648.87&lt;/td&gt;
&lt;td&gt;-4.06%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IXIC&lt;/td&gt;
&lt;td&gt;26,308.407&lt;/td&gt;
&lt;td&gt;26,008.859&lt;/td&gt;
&lt;td&gt;-1.14%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;XAUUSD&lt;/td&gt;
&lt;td&gt;4,076.61&lt;/td&gt;
&lt;td&gt;4,027.93&lt;/td&gt;
&lt;td&gt;-1.19%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;USDJPY&lt;/td&gt;
&lt;td&gt;157.234&lt;/td&gt;
&lt;td&gt;156.862&lt;/td&gt;
&lt;td&gt;-0.24%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The calculation is &lt;code&gt;(last / first - 1) × 100&lt;/code&gt;. A falling USDJPY means fewer yen are needed to buy one dollar, so the yen strengthened against the dollar. Inverting the pair gives approximately +0.24% for the yen over the same window.&lt;/p&gt;

&lt;p&gt;These are &lt;strong&gt;open-to-close changes within the selected session&lt;/strong&gt;, not previous-close-to-close daily returns. The distinction matters: a move before the session opens is included in the latter but not the former. The prices show what happened in this window; they do not by themselves prove why each market moved.&lt;/p&gt;

&lt;h2&gt;
  
  
  Follow up with a quote
&lt;/h2&gt;

&lt;p&gt;An assistant can use &lt;code&gt;get_ticker&lt;/code&gt; to request a quote snapshot for the same instruments:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"tool"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"get_ticker"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"arguments"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"symbols"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"META.US,IXIC,XAUUSD,USDJPY"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This request was also executed for the original article. A quote is a snapshot, not a continuous subscription. Its timestamp and session fields matter: when this request was made on October 23, the next U.S. regular session had not started, so Meta's regular-session fields still described the previous session. A client should check the returned timestamps instead of assuming every value is from the same moment.&lt;/p&gt;

&lt;p&gt;One possible follow-up is: “Check the latest quotes for those instruments and compare them with the end of the historical window.” That is a suggested prompt, not a claim that a further conversation was executed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it in your own workflow
&lt;/h2&gt;

&lt;p&gt;TickDB provides a hosted MCP service and an open-source server implementation that developers can inspect or deploy themselves. Connection and authorization depend on the client and configuration; market-data access depends on the permissions of the API key in use. For a continuously updating stream, evaluate the WebSocket interface separately rather than treating a one-off MCP query as a subscription.&lt;/p&gt;

&lt;p&gt;The useful starting point is a question with a clear time range. Keep the tool arguments and data timestamps alongside the answer, and make the calculation reproducible. That makes it easier to inspect both the data and the assistant's interpretation.&lt;/p&gt;

&lt;p&gt;Market data provided by TickDB.ai. Source code and connection instructions: &lt;a href="https://github.com/TickDB/tickdb-unified-realtime-marketdata-api/tree/main/mcp" rel="noopener noreferrer"&gt;TickDB MCP on GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Adapted from &lt;a href="https://tickdb.medium.com/stock-api-in-practice-using-mcp-to-analyze-tech-stocks-gold-and-forex-184b34dd76a1" rel="noopener noreferrer"&gt;Stock API in Practice: Using MCP to Analyze Tech Stocks, Gold, and Forex&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>ai</category>
      <category>api</category>
      <category>fintech</category>
    </item>
  </channel>
</rss>
