agents.md Beyond Shopify: Serving It on Headless, Next.js, and Other Platforms
Canonical: https://joinagentready.com/blog/agents-md-non-shopify
By Dylan Hunt June 16th, 2026 AI discovery files
agents.md gets talked about as a Shopify thing because Shopify generates one for every store automatically. But the file itself is a web convention, not a platform feature. Any store on any stack can serve one, and as more shoppers search inside AI assistants, any store benefits from doing so. Here's how to serve agents.md when the platform doesn't hand it to you.
What agents.md actually is
Stripped of Shopify specifics: agents.md is a Markdown file served at yourdomain.com/agents.md that tells AI shopping agents three things, what your store is, what it sells, and how to transact with it. It's the agent-facing front door, the way robots.txt is the crawler-facing one. We compare the three root files in robots.txt vs llms.txt vs agents.md.
The only hard requirement is that it resolves at the bare domain root at /agents.md, with a Markdown content type. Everything else is content.
Serving it on different stacks
The file is the same everywhere; only how you serve it changes.
| Platform | How to serve /agents.md |
|---|---|
| Static site (Astro, plain HTML, etc.) | Drop an agents.md file in your public/ root so it's served at /agents.md |
| Next.js (App Router) | A route handler at app/agents.md/route.ts returning the Markdown with Content-Type: text/markdown |
| Headless Shopify (Hydrogen) | A resource route at app/routes/[agents.md].tsx that returns the Markdown |
| Other frameworks (Nuxt, SvelteKit, Remix) | A server route at /agents.md returning Markdown |
| WooCommerce / WordPress | A template or a small plugin/route that outputs the file at the root path |
The pattern is identical: respond to GET /agents.md with your Markdown and the right content type. Generate it from your data at build or request time so it stays current rather than hand-editing a static blob.
What to put in it
Use the same checklist as a Shopify store (the full version is here):
- Identity and positioning: what you are, who it's for, why buy from you.
- A capabilities summary: currencies, where you ship, returns window, subscriptions. The scannable "can you serve my shopper" block.
- What you sell: your real categories, in priority order.
- Most popular and featured products: what to recommend when the shopper is vague.
- Ratings and policies: proof, and the shipping/returns answers agents need before recommending a buy.
- Transaction rails: if your platform exposes a commerce API or an MCP endpoint, point at it so agents can check out programmatically. If not, list your read-only browsing URLs so agents can at least navigate.
And the same exclusions: no private data (contact email, phone), no discount codes that go stale, no system or internal pages.
The transaction rails are the platform-specific part
On Shopify, the file points at the platform's UCP discovery and MCP endpoints (explained here). Off Shopify, you point at whatever your stack offers. If you've stood up an MCP server or a commerce API, name it and describe the flow so agents transact the supported way. If you haven't, a descriptive agents.md still earns its keep: agents that understand what you sell and why can recommend you and send shoppers to your normal checkout, even without programmatic buying.
In other words, the descriptive half works on any stack today; the transactional half depends on what your platform exposes.
Keeping it current is the same problem everywhere
Whatever the platform, the file is a snapshot, and snapshots go stale. Generate it from live data and rebuild it when your store changes, rather than hand-maintaining a static file that drifts. The dynamics are the same as we cover in why your agents.md goes stale; only the hosting differs.
If you're on Shopify, it's easier
This is the one place the platform matters. On Shopify you don't serve the file yourself, the platform serves it, and you customize it with a templates/agents.md.liquid template. AgentReady generates a brand-specific one from your live store and keeps it current. On other platforms you own the hosting and the generation, using the structure above.
Either way, the free AI-readiness checker fetches any store's /agents.md and reports what an agent sees, a quick way to confirm yours resolves and reads the way you intend.
Run the checker to see what an AI agent reads about your store today.
Quick answers
Frequently asked questions
Is agents.md only for Shopify?
No. agents.md is a web convention: a Markdown file served at /agents.md at your domain root that tells AI shopping agents what your store is and how to transact with it. Shopify generates one automatically, which is why it gets discussed in a Shopify context, but any site can serve one. On other platforms you create and host the file yourself.
How do I add agents.md to a headless or custom store?
Serve a Markdown response at the /agents.md path with content-type text/markdown. On a headless Shopify (Hydrogen) store, add a resource route like app/routes/[agents.md].tsx. On Next.js, add an app/agents.md/route.ts route handler that returns the Markdown. On a static site, drop an agents.md file in your public root. The key is that the file resolves at the bare domain root.
What should a non-Shopify agents.md contain?
The same things as a Shopify one: your identity and positioning, what you sell, your most popular and featured products, why buy from you, ratings, policies, and the transaction rails an agent uses to check out (your commerce API or MCP endpoint, if you have one). Leave out private data like contact email and phone, since the file is publicly cached.
Do I need UCP and MCP endpoints if I'm not on Shopify?
Only if you want agents to transact programmatically rather than just read about you. If your platform exposes a commerce API or an MCP server, point agents at it in agents.md. If it doesn't, you can still serve a descriptive agents.md (identity, catalog, policies, browsing URLs) so agents understand and recommend you, even if checkout happens on your normal storefront.
Is there a tool to generate agents.md for non-Shopify stores?
agents.md generation and maintenance in AgentReady is Shopify-focused: the app builds and keeps the file from your live Shopify catalog. On any other site, the free checker still audits your public pages and grades your discovery files, and you can write and host agents.md yourself using the structure in this post. See [plans and billing](/docs/plans-and-billing) for what each Shopify plan includes.
Dylan Hunt
Author
Builds Shopify catalog readability and AI answer visibility at AgentReady and Caffeine and Commerce.
Check your storefront’s public data
Get a free report on the product markup and discovery files the checker finds in under a minute.
Run free audit View on the App Store
Comments
Every comment here comes from a verified email. Write yours, confirm from your inbox, and it's live.
Loading comments…
Written by Dylan Hunt, Founder, AgentReady. AgentReady audits Shopify structured data and checks approved changes on the live storefront. See plans.
Research preview, not for sale
AI Answers
AI answer monitoring
See what AI says. Improve the source. Compare what changed.
Free guide
The Shopify Functions Playbook
25 real things you can build with Functions, with the plan requirements and limits stated plainly. Emailed to you, readable immediately.
More in AI discovery files