Publish llms.txt and agents.md with Codex
Publishing llms.txt and agents.md with Codex means asking OpenAI's coding agent, connected to StoreSEO, to check what your Shopify store serves to AI crawlers, generate llms.txt and agents.md and switch versions from the CLI, the desktop app or the IDE extension.
Last updated: October 2026
Set up Codex for StoreSEO
Skip this if Codex is already connected. The full guide, with the alternatives, is on the Codex page.
- 1
Add StoreSEO to Codex
Run this in any terminal. It writes a [mcp_servers.storeseo] table to ~/.codex/config.toml, which the Codex CLI, the IDE extension and the ChatGPT desktop app all read.
Terminalcodex mcp add storeseo --url https://mcp.storeseo.com/mcp
- 2
Sign in to your store
Run the login command. Your browser opens: pick your Shopify store and approve access. Then run codex mcp list, or type /mcp inside Codex, to confirm storeseo is there.
Terminalcodex mcp login storeseo codex mcp list
How does this work in Codex?
You are in a Codex session, in the terminal or the IDE extension, with the storeseo server configured in config.toml and signed in through codex mcp login. Ask whether the store's llms.txt and agents.md are current and Codex calls storeseo_start, storeseo_get_llms_txt_status and storeseo_get_agents_md_status. With the server's default_tools_approval_mode set to writes, those reads run without a prompt, since StoreSEO marks them read-only, and the answer names the active version, the public URLs and whether a rebuild is due.
Writes are where the approval mode earns its place. storeseo_generate_llms_txt writes into the live theme and Shopify Files, storeseo_generate_agents_md publishes live and spends AI Content Optimizer credit, and with writes mode Codex prompts for each of those, on top of StoreSEO telling the agent to name the effect and wait for your yes. After llms.txt generation Codex polls storeseo_get_llms_txt_status, which is a series of quick reads, so the 60 second default timeout is not a problem there. storeseo_generate_agents_md is an AI generation inside one call, so it is the one that can outlast the default.
Rollback uses storeseo_list_llms_txt_versions and storeseo_activate_llms_txt_version, and you can lock the destructive pair down further with per-tool approval so storeseo_delete_llms_txt_version and storeseo_reset_agents_md always prompt. A file called AGENTS.md in your repository is a different thing from the storefront agents.md StoreSEO publishes at your store's /agents.md, so name the one you mean when you prompt. The first is instruction text for coding agents, and StoreSEO never reads or writes it, which keeps the two jobs cleanly apart.
-
You: Publish a fresh agents.md for the store.
- storeseo_start read-only
- storeseo_get_agents_md_status read-only
-
Codex: Your store serves Shopify's default agents.md. Generating a custom one publishes it live at once, replaces the default and spends AI Content Optimizer credit. Do you want me to generate it?
-
You: Yes, generate it.
- storeseo_generate_agents_md needs approval
-
Codex: Published. The response has the markdown and the public URL; I can paste the text here.
What to ask Codex
Check llms.txt and agents.md with StoreSEO and tell me the live version and public URLs.
Generate agents.md. State the AI credit use and that it publishes live, then wait for my approval before calling the tool.
Show my llms.txt versions, then switch to version 3 after you confirm it with me.
- Is my llms.txt up to date, and which version is live right now?
- Generate a new llms.txt that includes products and collections but not blog posts. Warn me before it goes live.
- Show me my llms.txt versions and switch back to the one from last week.
- Does my store serve a custom agents.md or Shopify's default?
- Write an agents.md for my store and publish it. Tell me what it costs first.
- Reset agents.md to Shopify's default.
What StoreSEO does: llms.txt and agents.md
llms.txt is a curated map of your store for AI crawlers, and agents.md tells AI shopping agents who you are and how to buy. StoreSEO generates both from your store data and publishes them to your live theme; the agent checks status, generates, switches llms.txt versions and resets agents.md to Shopify's default.
Requires: agents.md generation spends AI Content Optimizer credit and needs at least one published product.
- 1
Check what is live
The agent reads the llms.txt status (settings, latest version, whether a rebuild is due, public URL) and the agents.md status (custom file or Shopify's default, public URL).
- 2
Warn before publishing
Generating llms.txt writes a template to your live theme and uploads a copy to Shopify Files in the same run, with no separate publish step. Generating agents.md publishes it live at once and spends credit. The agent says so and waits for your yes.
- 3
Generate and wait
llms.txt generation takes a minute or two; the agent polls the status until it finishes. agents.md returns the published text and its URL straight away.
- 4
Manage versions
StoreSEO keeps the latest ten llms.txt versions. The live file serves the active version, which is not always the newest, and any version can be made active again.
- 5
Roll back
Deleting a version is permanent. Resetting agents.md drops the custom file so Shopify's default serves again, and there is no history to restore it from.
llms.txt and agents.md reference
| llms.txt | Generated from your products, collections, pages and posts; served at your store's /llms.txt |
|---|---|
| Where it is written | A template in the live theme plus a copy in Shopify Files, in the same run |
| Schedule | llms.txt can regenerate on a saved schedule; settings passed with a run are saved for scheduled runs |
| Versions kept | The latest ten; the live file serves the active one |
| Generation time | About one to two minutes for llms.txt |
| agents.md | AI-written from your brand profile, top products, collections and contact details; served at /agents.md |
| agents.md publish | Live immediately; replaces Shopify's native default |
| agents.md reset | Shopify's default serves again within seconds; the custom text is gone for good |
Rules Codex follows
- The agent tells you that llms.txt generation writes to your live theme before it starts.
- agents.md generation publishes live and spends credit, so the agent says both and waits for your yes.
- Deleting an llms.txt version and resetting agents.md cannot be undone; the agent confirms each one.
- Deleting the active llms.txt version promotes the next newest automatically, so the agent says which version will go live.
In Codex
Codex waits 60 seconds for a tool to finish by default, and storeseo_generate_agents_md runs an AI generation inside the call, so raise tool_timeout_sec for the storeseo server if it times out. Set default_tools_approval_mode to writes or prompt, not approve: approve skips the prompt, and then the confirmation StoreSEO asks for in chat is the only check before a live theme or storefront write.
What runs without asking. Reads such as SEO scores, store listings, settings and Google reports run straight away. Generating a preview spends AI credit but writes nothing, and StoreSEO tells the agent to say what a generation will cost before it runs one. Applying content, optimizing images, changing settings, publishing llms.txt or agents.md, writing a product description and deleting anything wait for your yes in the conversation. That yes is an instruction the agent follows, not a lock on the server, so your client's own tool-approval setting is the hard stop.
Questions
Why did my agents.md generation time out in Codex?
Codex waits 60 seconds for a tool by default, and storeseo_generate_agents_md composes the file with AI in a single call. Raise tool_timeout_sec for the storeseo server in config.toml, then check storeseo_get_agents_md_status before generating again, since the file may already have been published.
Which Codex approval mode suits llms.txt and agents.md?
Use writes or prompt for the storeseo server. Writes lets the read-only status tools run and prompts for generate, activate, delete and reset. Avoid approve, which skips the prompt for every tool on that server.
What is the difference between llms.txt and agents.md?
llms.txt is a curated map of your store for AI crawlers and answer engines, served at /llms.txt. agents.md is the file AI shopping agents read to understand your brand and how to shop with you, served at /agents.md. StoreSEO can generate both.
Does generating llms.txt change my theme?
Yes. The same run writes an llms.txt template into your live theme and uploads a copy to Shopify Files. There is no separate publish step, which is why the agent should warn you before it starts.
Can I go back to an older llms.txt?
Yes. StoreSEO keeps the latest ten versions, and any of them can be made the active one, which republishes it to your storefront. Deleting a version is permanent.
Can I undo a generated agents.md?
You can reset it, which makes Shopify's native default serve again within seconds. The custom text is discarded with no history, so keep a copy if you might want it back.
Keep going
llms.txt and agents.md with other agents
More Codex guides