<?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: vjtuomin</title>
    <description>The latest articles on DEV Community by vjtuomin (@vjtuomin).</description>
    <link>https://dev.to/vjtuomin</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%2F4045444%2F761c4c96-3c20-4d9d-a75c-67629e2255e2.png</url>
      <title>DEV Community: vjtuomin</title>
      <link>https://dev.to/vjtuomin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vjtuomin"/>
    <language>en</language>
    <item>
      <title>Why I built a Shopify behavioral-data MCP server (and what Clarity's couldn't do)</title>
      <dc:creator>vjtuomin</dc:creator>
      <pubDate>Fri, 24 Jul 2026 11:47:57 +0000</pubDate>
      <link>https://dev.to/vjtuomin/why-i-built-a-shopify-behavioral-data-mcp-server-and-what-claritys-couldnt-do-40hd</link>
      <guid>https://dev.to/vjtuomin/why-i-built-a-shopify-behavioral-data-mcp-server-and-what-claritys-couldnt-do-40hd</guid>
      <description>&lt;p&gt;Six months ago I started using Claude to help Shopify merchants with conversion work. The workflow was promising: connect the store's data, ask questions in plain English, get grounded answers instead of staring at dashboards. Then I hit a wall that took a while to articulate.&lt;/p&gt;

&lt;p&gt;The wall was this: the behavioral data existed, but nothing exposed it in a shape an AI could actually reason over.&lt;/p&gt;

&lt;p&gt;That's not obvious until you try to build on it. Let me break it down.&lt;/p&gt;

&lt;p&gt;The layers of Shopify data, and which ones AI can reach&lt;br&gt;
A Shopify store generates data in roughly four layers:&lt;/p&gt;

&lt;p&gt;Business aggregates — GA4, Shopify Analytics. Revenue, sessions, conversion rate. Reachable via API, but summary data. It tells you conversion dropped, not why.&lt;br&gt;
Order and customer records — the Shopify Admin API. Clean, structured, AI-reachable. Great for "who bought what," useless for "why did people not buy."&lt;br&gt;
Behavioral events — clicks, scrolls, rage-clicks, funnel steps. This is where the "why" lives. Captured by Hotjar, Clarity, and similar.&lt;br&gt;
Session recordings — video replays. Human-watchable, not machine-readable at all.&lt;br&gt;
Layer 3 answers the questions merchants actually care about, and it's the one AI tools can't reach. Here's why.&lt;/p&gt;

&lt;p&gt;Why the existing behavioral tools don't work for AI&lt;br&gt;
Hotjar doesn't expose behavioral data through any API meant for programmatic reasoning. You watch recordings and look at heatmaps in their dashboard. The data is locked to human eyes.&lt;/p&gt;

&lt;p&gt;Microsoft Clarity actually shipped an MCP server in 2025, which was the closest thing to what I wanted. But the limits made it impractical for real work:&lt;/p&gt;

&lt;p&gt;10 API requests per day, per project. An AI assistant answering one question typically makes 3-5 tool calls (it decomposes, queries, validates). So 10 requests is ~2-3 real questions before a 24-hour lockout.&lt;br&gt;
3-day data lookback. No week-over-week, no "did anything change after the redesign" if the redesign was four days ago.&lt;br&gt;
3 dimensions per request, 4 total (browser, OS, country, device). No product, no cart, no funnel step, no session outcome.&lt;br&gt;
So the most Claude could do with Clarity was "what was mobile engagement on Chrome in the last 3 days." A demographic question. Not "which product pages lose the most customers before add-to-cart," which is the question that moves revenue.&lt;/p&gt;

&lt;p&gt;The deeper issue isn't the rate limit. It's that these tools structure data for dashboard rendering — coordinates for a heatmap overlay, timestamps for a replay scrubber. An LLM handed that data spends its context window parsing coordinates instead of reasoning about behavior.&lt;/p&gt;

&lt;p&gt;What I built&lt;br&gt;
Same capture, different priorities. A lightweight script (~15KB) collects the same behavioral signals Clarity and Hotjar capture — clicks, scroll depth, rage-clicks, funnel progression. The difference is what happens next.&lt;/p&gt;

&lt;p&gt;Every event is tagged with Shopify context at ingest:&lt;/p&gt;

&lt;p&gt;{&lt;br&gt;
  "event": "rage_click",&lt;br&gt;
  "element": "size-chart-toggle",&lt;br&gt;
  "page_type": "product",&lt;br&gt;
  "product_id": "8123...",&lt;br&gt;
  "product_title": "Merino Base Layer",&lt;br&gt;
  "cart_value_at_event": 0,&lt;br&gt;
  "session_outcome": "abandoned",&lt;br&gt;
  "device": "mobile"&lt;br&gt;
}&lt;br&gt;
That product_id / page_type / session_outcome tagging is the whole point. It means the AI can answer "which products have the highest rage-click rate on mobile before abandonment" — a four-dimension question that Clarity's three-dimension cap structurally can't express.&lt;/p&gt;

&lt;p&gt;The data is aggregated for LLM context, not dumped raw. Early on I made the mistake of exposing raw event streams. A busy product page generates thousands of events a day; handing an LLM 5,000 rows burns the context window and produces worse answers than a well-shaped summary. So the MCP tools return pre-aggregated views — "rage-click rate by product, by device, by session outcome" — with the option to drill down. Shape the data for the reasoning pattern, not for completeness.&lt;/p&gt;

&lt;p&gt;Exposed over MCP with token-scoped auth. Each merchant gets a revocable token scoped to their store. The tools are read-only resources (query behavior), not write actions. Any MCP client works — Claude Desktop, ChatGPT where MCP is supported, Cursor.&lt;/p&gt;

&lt;p&gt;The honest limitations&lt;br&gt;
It's closed-source. The capture script and the aggregation layer are the product. I went back and forth and landed on closed for now.&lt;br&gt;
Shopify-only. The whole value is in the Shopify-specific tagging. A generic version would lose exactly the thing that makes it useful.&lt;br&gt;
"Session replay" is event-level, not video. You can reconstruct what happened from the structured events, but there's no video scrubber. That's deliberate — video is for humans, structured events are for AI.&lt;br&gt;
It's early. A few design-partner stores, a public launch on the Shopify App Store, and a lot still to build.&lt;br&gt;
Why MCP specifically&lt;br&gt;
I could have built a normal REST API. MCP mattered because the whole point is that the merchant's own AI tools consume the data. With MCP, a Shopify operator connects the server to whatever they already use — Claude, ChatGPT, Cursor — in about 30 seconds, and the AI picks the right tool based on the question. A REST API would have meant every integration is a custom job. MCP made it one protocol, any client.&lt;/p&gt;

&lt;p&gt;If you're newer to the protocol, I wrote up what an MCP server is separately.&lt;/p&gt;

&lt;p&gt;Try it, or tear it apart&lt;br&gt;
It's on the Shopify App Store as ClickContext, free during early access.&lt;/p&gt;

&lt;p&gt;I'd genuinely like to hear where this breaks — especially the aggregate-vs-raw design and the closed-source call. Both are decisions I could see going the other way.&lt;/p&gt;

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