# Write SEO blog post drafts with Codex

> Run Codex in your terminal or IDE to have StoreSEO write an SEO blog post as a draft in your Shopify blog. Raise the tool timeout for long generations.

Writing blog post drafts with Codex means giving OpenAI's coding agent a brief from the repository you run it in, and having StoreSEO write the post into a draft article in your Shopify blog while Codex tracks the job.

## 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 list my Shopify blogs and tell me their ids and how many articles each holds."

## How does this work in Codex?

You start Codex in a terminal, an IDE extension or the ChatGPT desktop app, all of which read the same config.toml, and ask for the post: an 1,100 word article on storing olive oil for the Recipes blog. Codex calls storeseo_start, then storeseo_list_blogs to get the blog id. These are reads, and with the server's default_tools_approval_mode set to writes, Codex lets read-only tools through and prompts for the rest.

That setting is what puts the hard stop on storeseo_generate_blog_post. StoreSEO tells the agent to state the credit cost and wait for your yes, and Codex then shows its own approval prompt for the write tool, so you answer twice at the two layers. After approval the generation runs in the background for a few minutes, and Codex polls storeseo_get_blog_post_job, printing steps completed out of total until the status is terminal. Because the job is polled in short calls, the wait does not depend on one long tool call.

When the job completes, ask Codex to read the draft's SEO record with storeseo_get_resource_seo and record the article id in a file in your working tree. You then review and publish the draft in Shopify admin. If your repository holds product copy or a tone guide, Codex can read it and fold it into the brief before you approve.

### Example session (illustrative)

**You:** Write an 1,100 word draft on storing olive oil in my Recipes blog.
→ `storeseo_start` (read-only)
→ `storeseo_list_blogs` (read-only)
**Agent:** Recipes is synced. This post will spend AI credit that grows with its length. Shall I start it?
**You:** Yes, start it.
→ `storeseo_generate_blog_post` (needs approval)
→ `storeseo_get_blog_post_job` (read-only)
**Agent:** The job is running, 3 of 5 steps done. I will poll until it completes, then tell you the draft is ready in Shopify.

## What StoreSEO does: blog post drafts

StoreSEO writes a full blog post with AI and saves it as a draft article in the Shopify blog you choose, optionally with a featured image. Nothing is published: you review and publish from Shopify admin.

Tools: `storeseo_list_blogs`, `storeseo_generate_blog_post`, `storeseo_get_blog_post_job`, `storeseo_get_resource_seo`

Requires: Spends AI Content Optimizer credit; the cost grows with word count and a featured image. Blogs must be synced in the StoreSEO app.

1. **Pick the blog.** The agent lists your synced blogs, the sections posts go into, with their ids. An empty list means the blogs need syncing in the StoreSEO app first.
2. **Agree the brief and cost.** Topic, keyword, length and whether to add a featured image. The cost grows with length and the image, so the agent tells you and waits for your yes.
3. **Generate in the background.** Writing takes a few minutes. The agent polls the job and reports progress, and does not present the post as finished while it runs.
4. **Check the draft.** When the job completes, the agent can read the draft article's SEO record. You review and publish the post from Shopify admin.

## Blog post drafts reference

| Setting or limit | What applies |
|---|---|
| Output | A draft article in the chosen Shopify blog, never published live |
| Featured image | Optional; uploaded with the draft and adds to the cost |
| Run time | A few minutes in the background |
| Insufficient credit | The call fails before anything is queued or spent |
| Blogs | Only blogs synced with StoreSEO are listed; syncing is done in the app |
| Failed runs | The job reports the error and credits are settled automatically |

## Rules Codex follows

- The agent states the expected credit use and waits for your yes before it starts a post.
- Posts are saved as drafts only; publishing is done by you in Shopify admin.
- While the job runs, the agent reports progress and never presents the draft as finished.

**In Codex:** Codex waits 60 seconds for a tool to finish by default. StoreSEO answers storeseo_generate_blog_post with a job id and writes in the background, so the call itself should return quickly, but raise tool_timeout_sec for the storeseo server if you see timeouts on the start or on slow polls. Set the server's default_tools_approval_mode to writes or prompt, not approve, because approve skips the prompt for the generate tool and leaves the confirmation StoreSEO asks for in chat as the only check. Reads like listing blogs and polling the job can stay automatic, so only the credit-spending call interrupts you.

## What can you ask Codex to do?

- Use StoreSEO to list my Shopify blogs and tell me their ids and how many articles each holds.
- Write an 1,100 word draft on storing olive oil for the Recipes blog. Tell me the AI credit cost and wait for my yes before you start.
- Poll the blog post job until it finishes, then read the draft's SEO record and write the article id to notes.md.
- List my blogs and write a 1,200 word draft on how to care for linen shirts in the News blog. Tell me the cost first.
- Write a draft post targeting best gifts for coffee lovers, with a featured image.
- How far along is the blog post you started?
- Check the SEO score of the draft you just wrote.
- Draft three post ideas for my store and write the strongest one.

## Frequently asked questions

### Does Codex stay blocked while the blog post is written?

No single call blocks for the whole run. storeseo_generate_blog_post returns a job id and the writing happens in the background for a few minutes, while Codex polls storeseo_get_blog_post_job for progress.

### Which Codex approval mode suits blog post drafts?

Use writes or prompt for the storeseo server. Reads such as listing blogs and polling the job then run on their own, and storeseo_generate_blog_post, which spends credit, stops for your approval.

### Will the agent publish a blog post on my store?

No. StoreSEO saves generated posts as drafts in the Shopify blog you choose. You review and publish them from Shopify admin.

### How long does a blog post take?

A few minutes. The writing runs in the background and the agent checks the job until it is completed, failed or cancelled.

### What does a blog post cost?

It spends AI Content Optimizer credit, and the amount grows with the word count and with a featured image. If you do not have enough credit the call fails before anything is spent.

### Why does the agent say I have no blogs?

Only blogs synced with StoreSEO are listed. Sync your blogs in the StoreSEO app, then ask again.

## Blog post drafts with other agents

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

## 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 meta tags and content with Codex](https://storeseo.com/agent/codex/optimize-meta)
- [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)

## Related documentation

- [Generate blog posts with AI in StoreSEO](https://storeseo.com/docs/how-to-generate-blog-posts-with-ai-in-storeseo)
- [Configure SEO for blog posts and pages](https://storeseo.com/docs/configure-seo-for-blog-posts-and-pages)
- [Increase your AI content credit limit](https://storeseo.com/docs/increase-ai-content-credit-limit-in-storeseo)

---

Canonical: https://storeseo.com/agent/codex/blog-posts
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
