Shopify MCP: What Your Store Tells AI Agents

Every Shopify store now publishes a second copy of your catalog for AI agents, and your robots.txt tells them to use it instead of your pages. Here is how to find it and check what it says.

By AjayCodeWiz · September 7, 2026 · 8 min read

The problem

A merchant posted on the Shopify Community that AI assistants kept telling shoppers her product was out of stock. It was not out of stock. No variant was out of stock.

She went looking in her theme files and found the words "out of stock" sitting in the code. That looked like the answer. It was not.

I get why she landed there. It is the only thing you can see.

But it sends you the wrong way. Five people in that thread told her to check her structured data. None of them said where the model was actually reading from.

So I measured it on a real Shopify store. The answer turned out to be somewhere most merchants do not know exists.

Your theme always contains the words "out of stock"

Start here, because it saves you hours.

I took a product page on a live store. The product was in stock. Its only variant was in stock. The buy button worked.

That page still contained the words "Sold out" twice and "Unavailable" six times.

Every Shopify theme carries that wording. It has to. The theme needs those strings ready so it can show them the moment something does sell out. They sit in the page doing nothing until they are needed.

So finding "out of stock" in your theme proves nothing at all. It is there on every healthy store on the platform.

AI crawlers get exactly the same page you get

The next theory people reach for is that crawlers see a different version of the site. They do not.

I requested one in-stock product page five times. The only thing I changed was which client I claimed to be.

The same Shopify product page requested as Chrome, GPTBot, OAI-SearchBot, ClaudeBot and PerplexityBot, all returning identical HTML with one Product block and InStockThe same Shopify product page requested as Chrome, GPTBot, OAI-SearchBot, ClaudeBot and PerplexityBot, all returning identical HTML with one Product block and InStock

Chrome, GPTBot, OAI-SearchBot, ClaudeBot and PerplexityBot all received the same thing. Same byte count. One Product block. The same availability value, reading InStock.

Two useful things follow from that.

You do not need special tooling to check your own page. View source in your normal browser shows what a crawler receives.

And there is no hidden crawler version of your store to hunt down. If your page says InStock, it says InStock to every reader, human or model.

What is Shopify MCP?

Here is the part that changes the question.

MCP stands for Model Context Protocol. It is a shared standard for how AI systems ask software for data. Google, Microsoft, OpenAI and Shopify have all adopted it.

Every Shopify store already has an MCP endpoint. You did not install it and you cannot see it in your admin. It is on right now, on your store, at this address:

https://yourstore.com/api/ucp/mcp

That endpoint hands AI agents your catalog directly. It offers tools with names like search_catalog, lookup_catalog and get_product. An agent can ask it for a product and get structured data back, without ever loading your product page.

So your stock level is published in two places. Your HTML is one. This is the other.

Your robots.txt tells agents to prefer it

This is the bit worth seeing for yourself. Open this in a browser tab:

https://yourstore.com/robots.txt

A Shopify robots.txt showing agent instructions pointing at agents.md, the UCP discovery file and the UCP/MCP endpointA Shopify robots.txt showing agent instructions pointing at agents.md, the UCP discovery file and the UCP/MCP endpoint

Above the usual crawler rules, Shopify now writes instructions aimed at AI agents. They point at three things:

  • agents.md, a plain-language instruction file for agents
  • /.well-known/ucp, a discovery file that describes what your store supports
  • /api/ucp/mcp, the endpoint above

And then a line that matters more than the other three put together:

Agents should use UCP/MCP for catalog, cart, and checkout.

Your own site is telling AI agents not to read your pages for product data. It is telling them to use the endpoint instead.

That reframes the whole problem. "The model read my theme code and got confused" may simply not be what happened.

What to do when the schema is already correct

Work through these in order.

Check the one line that counts. Open your product page, press Ctrl+U for view source, then Ctrl+F and search for availability. You want one result, and it should say InStock.

Count the Product blocks. Search view source for "@type":"Product". You want exactly one. If you find two, an SEO app or a review app is adding its own, and the two can disagree. Turn the app's structured data off rather than editing your theme.

Confirm the product is published to the Online Store sales channel. That channel is what feeds both your product page and the agent endpoint. A product unpublished from it goes missing from both.

Ask the model what it actually looked at. Ask for the exact URL and the date it fetched. This is the step people skip, and it resolves most of these cases. A cached answer from three weeks ago is not something you can fix by editing your theme today.

Check it is quoting you at all. Marketplace and reseller listings of the same product get pulled into answers constantly. Those listings genuinely are out of stock. The model is right, it is just not talking about your store.

Does Shopify have an llms.txt file?

This comes up a lot, so it is worth being precise.

llms.txt is a proposed standard. The idea is a plain-text file at the root of a site that tells language models what the site is and where the good content lives. Think of it as a sitemap written for a reader rather than a crawler.

Shopify does not generate one for you. What Shopify generates is the agent block in your robots.txt, plus agents.md and the UCP discovery file described above.

Apps exist that will write an llms.txt and an agents.md for you. Before you buy one, open your robots.txt and see what your store already publishes. On most stores the answer is more than the owner expects.

What structured data does Shopify output?

Your theme outputs JSON-LD on product pages. That is a block of machine-readable data describing the product: its name, its price, its availability.

The availability value is the one that matters here. It reads either https://schema.org/InStock or https://schema.org/OutOfStock, and it is generated from your real inventory, not from the words in your template.

Two things go wrong with it in practice.

The value can be stale, usually because an app is caching it.

Or there can be more than one block, because your theme writes one and an app writes another. When two blocks disagree, whatever reads the page has to pick, and it may not pick the one you want.

Both of those you can see from view source in under a minute.

Sold out, unavailable and out of stock are three different things

Merchants use these interchangeably. Shopify does not, and the distinction explains some odd behaviour.

Sold out means inventory reached zero and you are tracking inventory. The variant still exists and can come back.

Unavailable usually means the variant combination does not exist at all. Pick a size and a colour that were never made together and the theme shows unavailable.

Continue selling when out of stock is a per-variant setting. Turn it on and a variant at zero inventory still sells. Your page will not say sold out, even though the number is zero.

That last one is worth checking if your page and your inventory seem to disagree.

Can I stop AI agents reading my catalog?

You can, and it is worth thinking about before you do.

The agent instructions live in your robots.txt, and Shopify writes that block for you. On the paid plans you can edit robots.txt through a theme file called robots.txt.liquid, which lets you add rules for named crawlers.

Blocking has a real cost though. AI assistants are increasingly how people find products. Turning them away is closer to removing yourself from a search engine than to closing a security hole.

There is also a middle option most people miss. Shopify's own agent instructions already draw a line: agents may read your catalog and build a cart, but the file states plainly that checkout is for humans and that payment needs a person to approve it. So the risky part is already fenced off without you doing anything.

My advice for most stores is to leave it on and make sure the data is right. An agent that reads your catalog correctly is a sales channel. An agent working from a two-week-old cached page is the actual problem, and blocking it makes that worse rather than better.

How often does the endpoint update?

The endpoint reads your live catalog, so it reflects inventory as it stands when the agent asks.

The delay is almost never on Shopify's side. It is on the model's. Assistants cache what they retrieve, and some answer from a search index that was built days or weeks ago.

That is why asking a model for its retrieval date is such a useful question. It separates a data problem, which you can fix, from a caching problem, which you mostly cannot.

The short version

If an AI assistant is saying something wrong about your stock, do not start in your theme files.

The sold-out wording in your theme is inert and lives on every store. Crawlers receive the same HTML you do. Your real availability is one line in your structured data, and it should appear exactly once.

And if that line is already correct, the problem is not your markup. Your store publishes a second copy of your catalog at /api/ucp/mcp. Your own robots.txt tells agents to read that one instead. That, or the model is answering from a cached copy it fetched weeks ago.

Neither of those gets fixed by adding more schema.

Spending too long on manual Shopify busywork?

PinFlow turns your Shopify catalog into Pinterest pins and posts them on a schedule, automatically. Same idea as the rule above, let the system handle the repetitive part.

Get PinFlow on the Shopify App Store

Answered on the Shopify Community

A merchant ran into this and asked about it on the forum. I worked through it on a test store and posted the fix there on September 7, 2026. You can read the original thread, including the follow-up questions, over on the Shopify Community.

View the original thread