# Optimize meta tags and content with Codex

> Run StoreSEO meta optimization from Codex: preview generated titles, descriptions, FAQs and URL handles in your terminal or IDE, then apply what you approve.

Optimizing meta tags and on-page content with Codex means asking OpenAI's coding agent, in the CLI, the IDE extension or the desktop app, to have StoreSEO preview generated meta for a product and to apply only the parts you approve.

## How do you set up Codex for this?

### 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.

```bash
codex 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.

```bash
codex mcp login storeseo
codex mcp list
```

### 3. Or write it in config.toml (optional)

If you would rather edit the file, add this table to ~/.codex/config.toml, or to .codex/config.toml in a trusted project. In the desktop app or the IDE extension you can add the same URL under MCP servers, Add server, Streamable HTTP.

```toml
[mcp_servers.storeseo]
url = "https://mcp.storeseo.com/mcp"
```

### 4. Or connect with an access token (optional)

Generate a token in StoreSEO under Settings, AI Toolkit, export it as STORESEO_TOKEN in your shell, and point config.toml at that variable. Codex sends it as an Authorization Bearer header, so the token never sits in the file.

```toml
[mcp_servers.storeseo]
url = "https://mcp.storeseo.com/mcp"
bearer_token_env_var = "STORESEO_TOKEN"
```

Then ask: "Use StoreSEO to preview optimized meta for the product with handle trail-socks. Show me the draft and score change, and wait for my yes before applying."

## How does this work in Codex?

You run Codex in the repository you work from, with the storeseo server in config.toml and signed in through codex mcp login. A request like preview better meta for the product with handle trail-socks leads Codex to call storeseo_start, then storeseo_get_resource_seo, then storeseo_preview_resource_optimization. The CLI prints each tool call as it happens. StoreSEO writes the meta title, description, tags, FAQs, AI snippet and any new handle on its servers and returns a draft with a projected score, so Codex reads that draft back to you rather than composing text of its own.

Codex has per-server approval settings, and they decide when you see a prompt. With default_tools_approval_mode set to writes, any tool that is not marked read-only prompts, which includes the preview tool and the apply tool. That gives you two checkpoints: the prompt on the preview, where you accept the AI Content Optimizer credit cost, and the prompt on the apply, where you accept the change to the live product. Between them sits the agent's own question, which you answer in the session, and you should say which fields to skip, such as the handle if you do not want a redirect.

Generation can take a while. Codex waits 60 seconds for a tool to finish by default, and a preview that writes several fields can approach that, so if a preview times out, raise tool_timeout_sec for the storeseo server and run it again. Be aware that a timed-out preview may still have spent credit, so check the draft and the credit use before you retry. A re-preview spends credit again.

### Example session (illustrative)

**You:** Preview better meta for the trail-socks product. Spending credit on the preview is fine.
→ `storeseo_start` (read-only)
→ `storeseo_get_resource_seo` (read-only)
→ `storeseo_preview_resource_optimization` (preview)
**Agent:** The draft lifts the score from 31 to 68 with new meta, tags and two FAQs. The handle would change from /socks-1 to /merino-trail-socks, with a redirect from the old URL. Apply everything?
**You:** Apply the meta and tags, skip the FAQs.
→ `storeseo_apply_resource_optimization` (needs approval)
**Agent:** Applied the meta, tags and handle. The score is now 64. The FAQs remain in the draft for about an hour.

## What StoreSEO does: meta tags and on-page content

StoreSEO generates the content server-side: meta title and description, tags, a keyword-led URL handle, FAQs and an AI snippet. The agent shows you the draft and the projected score change before anything is saved, then applies all of it or only the parts you approve.

Tools: `storeseo_get_resource_seo`, `storeseo_preview_resource_optimization`, `storeseo_apply_resource_optimization`, `storeseo_get_ai_optimization_settings`, `storeseo_update_ai_optimization_settings`

Requires: Generating a preview spends AI Content Optimizer credit; applying a preview is free.

1. **Read the current state.** The agent reads the resource's SEO record so it knows which fields exist, which fail and what the preview will add.
2. **Generate a preview.** StoreSEO writes the meta title, description, tags, URL handle, FAQs and AI snippet and projects the new SEO score, plus the GEO score for products. Nothing is saved yet. Preview spends credit whether or not you apply it.
3. **Show you the draft.** The agent presents the generated text and the score change. When the handle changes it shows the old and new URL and tells you a redirect will be created.
4. **Apply what you approve.** After your yes it applies everything, or only the parts you chose, for example the meta but not the FAQs. Skipped fields stay available from the same draft for an hour.
5. **Report the new score.** The apply call returns the recomputed score and the remaining checklist, so the agent tells you what changed and offers the next most useful fix.

## Meta tags and on-page content reference

| Setting or limit | What applies |
|---|---|
| Generated fields | Meta title, meta description, tags, URL handle, FAQs, AI snippet |
| Resource types | Products, collections, pages and articles (collections have no meta tags or tags axis in auto settings) |
| Who writes the copy | StoreSEO, server-side. The agent never authors meta, FAQs or handles itself |
| Cost | Preview spends AI Content Optimizer credit; apply is free; a new preview spends again |
| Draft lifetime | One hour after the preview |
| URL handle | Applying a new handle changes the live URL and creates a redirect from the old one; a handle already in use is dropped automatically |
| Partial apply | Apply a subset of axes, or skip individual fields such as the handle |
| Auto optimization | Optional settings that generate content for newly synced resources; only future syncs, nothing is backfilled |
| Auto settings plan | Configurable on any plan; switching an auto toggle on needs a paid plan and no active trial |

## Rules Codex follows

- The agent previews first and applies only after you confirm the previewed content.
- When a handle changes, you see the old URL and the new URL before the apply call, because applying creates a redirect.
- A request like optimize my worst five products authorizes the previews; the agent should remind you that previews spend credit even if you do not apply them.
- Turning on auto optimization spends credit on every future sync, so the agent proposes the exact sections and waits for your yes.
- Product title, focus keyword and description body are not written by this job; the description has its own tool in the AI search job.

**In Codex:** Set the server's default_tools_approval_mode to writes or prompt. If you set it to approve, Codex runs the preview and apply tools without prompting and the confirmation StoreSEO asks for in the conversation is the only check left, which is an instruction the agent follows and not a lock. Preview generation can also exceed Codex's default 60 second tool wait, so raise tool_timeout_sec for storeseo if a preview times out, and check your credit use before you re-run it, because a second preview spends credit again.

## What can you ask Codex to do?

- Use StoreSEO to preview optimized meta for the product with handle trail-socks. Show me the draft and score change, and wait for my yes before applying.
- Preview a new meta title, description and FAQ for my Summer Dresses collection and keep the current URL handle. Tell me the credit cost first.
- Apply the meta from that preview but skip the FAQ, then show me the new score and what is still failing.
- Optimize the meta title and description for my five lowest-scoring products. Show me the previews before you apply anything.
- Preview a new meta title, description and FAQ for the collection Summer Dresses, and keep the current URL handle.
- Apply the meta from that preview but skip the FAQ.
- Which of my pages have no meta description? Draft one for each and wait for my approval.
- What does StoreSEO optimize automatically for new products right now?
- Turn on automatic meta and alt text for new products only. Tell me what that will spend first.

## Frequently asked questions

### Why did my Codex meta preview time out?

Codex waits 60 seconds for a tool to finish by default and generating several fields can take longer. Raise tool_timeout_sec for the storeseo server in config.toml. Check your credit use before retrying, since a second preview spends AI Content Optimizer credit again.

### Which Codex approval mode works best for meta optimization?

The writes mode is a good fit, because it prompts for every tool that is not marked read-only, including the preview and the apply, while reads such as storeseo_get_resource_seo run without interruption. Avoid the approve mode for this server.

### Does previewing an optimization change my product?

No. A preview generates the content and projects the score without saving anything. It does spend AI Content Optimizer credit, and applying the draft afterwards is free.

### What happens to the old URL when the handle changes?

Applying a new URL handle updates the live URL and StoreSEO creates a redirect from the old one, so existing links keep working. The agent should show you both URLs before it applies the change.

### Can I apply only part of a preview?

Yes. The apply step takes the axes you approved, and individual content fields such as the URL handle can be skipped. Skipped parts stay available from the same draft for one hour.

### Does auto optimization fix my existing products?

No. Auto optimization only acts on resources synced or updated after you turn it on. Existing products are fixed with the preview and apply steps in this job.

### Will StoreSEO change my product title?

No. This job writes the SEO meta title, not the storefront product title. The product title is edited in Shopify admin.

## Meta tags and on-page content with other agents

- [Optimize meta tags and content with Claude](https://storeseo.com/agent/claude/optimize-meta)
- [Optimize meta tags and content with ChatGPT](https://storeseo.com/agent/chatgpt/optimize-meta)
- [Optimize meta tags and content with Claude Code](https://storeseo.com/agent/claude-code/optimize-meta)
- [Optimize meta tags and content with Claude Cowork](https://storeseo.com/agent/claude-cowork/optimize-meta)
- [Optimize meta tags and content with Cursor](https://storeseo.com/agent/cursor/optimize-meta)
- [Optimize meta tags and content with Gemini CLI](https://storeseo.com/agent/gemini-cli/optimize-meta)
- [Optimize meta tags and content with GitHub Copilot](https://storeseo.com/agent/github-copilot/optimize-meta)
- [Optimize meta tags and content with Windsurf](https://storeseo.com/agent/windsurf/optimize-meta)
- [Optimize meta tags and content with Grok](https://storeseo.com/agent/grok/optimize-meta)
- [Optimize meta tags and content with ChatGPT dots](https://storeseo.com/agent/chatgpt-dots/optimize-meta)
- [Optimize meta tags and content with Grok Bot](https://storeseo.com/agent/grok-bot/optimize-meta)
- [Optimize meta tags and content with Muse](https://storeseo.com/agent/muse/optimize-meta)
- [Optimize meta tags and content with Manus](https://storeseo.com/agent/manus/optimize-meta)
- [Optimize meta tags and content with OpenClaw](https://storeseo.com/agent/openclaw/optimize-meta)
- [Optimize meta tags and content with Hermes Agent](https://storeseo.com/agent/hermes-agent/optimize-meta)
- [Optimize meta tags and content with Paperclip](https://storeseo.com/agent/paperclip/optimize-meta)
- [Optimize meta tags and content with NanoClaw](https://storeseo.com/agent/nanoclaw/optimize-meta)
- [Optimize meta tags and content with OpenCode](https://storeseo.com/agent/opencode/optimize-meta)
- [Optimize meta tags and content with Zed](https://storeseo.com/agent/zed/optimize-meta)
- [Optimize meta tags and content with Kiro](https://storeseo.com/agent/kiro/optimize-meta)
- [Optimize meta tags and content with Antigravity](https://storeseo.com/agent/antigravity/optimize-meta)
- [Optimize meta tags and content with Kimi Code](https://storeseo.com/agent/kimi/optimize-meta)

## More Codex guides

- [Codex and StoreSEO overview](https://storeseo.com/agent/codex)
- [Audit your store's SEO with Codex](https://storeseo.com/agent/codex/seo-audit)
- [Optimize images and alt text with Codex](https://storeseo.com/agent/codex/image-seo)
- [Get products ready for AI search with Codex](https://storeseo.com/agent/codex/ai-search-readiness)
- [Publish llms.txt and agents.md with Codex](https://storeseo.com/agent/codex/llms-txt-agents-md)
- [Set up structured data with Codex](https://storeseo.com/agent/codex/structured-data)
- [Manage sitemaps and indexing with Codex](https://storeseo.com/agent/codex/sitemaps)
- [Track keyword rankings with Codex](https://storeseo.com/agent/codex/keyword-tracking)
- [Read Search Console and Analytics with Codex](https://storeseo.com/agent/codex/google-reports)
- [Write SEO blog post drafts with Codex](https://storeseo.com/agent/codex/blog-posts)

## Related documentation

- [Add a meta description to Shopify products](https://storeseo.com/docs/add-meta-description-to-shopify-products)
- [How to use the AI Content Optimizer](https://storeseo.com/docs/how-to-use-storeseo-ai-content-optimizer)
- [How to enable auto AI optimization](https://storeseo.com/docs/how-to-enable-auto-ai-optimization)
- [AI Content Optimizer credits](https://storeseo.com/docs/credits-ai-content-optimizer)

---

Canonical: https://storeseo.com/agent/codex/optimize-meta
Last updated: October 2026.

Approval: Reads run straight away; StoreSEO tells the agent to preview and wait for your yes before it writes, spends credit or publishes, and your client's tool-approval setting is the hard stop.

Every agent guide: https://storeseo.com/agent · Connect the MCP server: https://storeseo.com/docs/connect-storeseo-mcp-to-your-ai-assistant · Pricing: https://storeseo.com/pricing · Install StoreSEO: https://apps.shopify.com/storeseo
