# Write SEO blog post drafts with OpenCode

> Run OpenCode in your terminal and have StoreSEO write an SEO blog post as a Shopify draft. Agree the credit cost in the session, then publish from Shopify.

Writing blog post drafts in OpenCode with StoreSEO means describing the post in your terminal session and letting StoreSEO's blog writer save a finished SEO article as a draft in the Shopify blog you pick.

## How do you set up OpenCode for this?

### 1. Add StoreSEO to OpenCode

Run this from the project that should use StoreSEO, or add --global to make it available in every project. OpenCode writes a remote server entry to its configuration; the equivalent hand-written entry is shown in the next step.

```bash
opencode mcp add storeseo --url https://mcp.storeseo.com/mcp
```

### 2. Sign in to your store

Remote servers use OAuth by default. Run the auth command, then pick your Shopify store in the browser and approve access. Inside OpenCode, /mcps does the same: select storeseo and sign in. opencode mcp list should then show it as connected.

```bash
opencode mcp auth storeseo
opencode mcp list
```

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

In OpenCode V2 servers go under mcp.servers. Older versions put the server directly under mcp, so use the layout your version documents.

```json
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "servers": {
      "storeseo": {
        "type": "remote",
        "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, and turn OAuth off for this server so OpenCode sends the header instead.

```json
{
  "mcp": {
    "servers": {
      "storeseo": {
        "type": "remote",
        "url": "https://mcp.storeseo.com/mcp",
        "oauth": false,
        "headers": {
          "Authorization": "Bearer {env:STORESEO_TOKEN}"
        }
      }
    }
  }
}
```

Then ask: "Use StoreSEO to list my blogs and write a 1,200 word draft on how to care for linen shirts in the News blog. Give me the credit cost and wait for my yes."

## How does this work in OpenCode?

You are in OpenCode's terminal interface, usually inside a project, with StoreSEO added through opencode mcp add and signed in with opencode mcp auth storeseo. You type the brief: the topic, the keyword, a word count and whether a featured image is wanted. OpenCode calls storeseo_start first, since every StoreSEO tool needs the conversation id it returns, and then storeseo_list_blogs. The result lists each synced blog with its numeric Shopify id, title and article count; if it is empty, the blogs have to be synced in the StoreSEO app, which no tool here can do.

The next step is the one to read closely. Writing a post spends AI Content Optimizer credit, which grows with word count and with a featured image, so StoreSEO tells the agent to state the cost and wait for your yes. You answer in the session. OpenCode then calls storeseo_generate_blog_post with the blog id and your brief, and polls storeseo_get_blog_post_job with the returned job id. The writing takes a few minutes, and you see each poll as a tool call in the transcript with steps completed out of total, ending in completed, failed or cancelled. Once it completes, you can have OpenCode read the draft's record with storeseo_get_resource_seo using resource type article.

Being in a terminal helps in small ways. You can keep the brief, the keyword list and the title options in a file in the project and tell OpenCode to use it, and you can keep working on code in another session while the job runs. What does not change is where the result lives: the post is a draft article inside Shopify, not a file in your repository, and you review it and publish it from Shopify admin.

### Example session (illustrative)

**You:** Write a 1,200 word draft on how to care for linen shirts in the News blog.
→ `storeseo_start` (read-only)
→ `storeseo_list_blogs` (read-only)
**Agent:** News is blog 1042. The post spends AI credit based on its length and is saved as a draft, not published. Should I start the job?
**You:** Yes, start it.
→ `storeseo_generate_blog_post` (needs approval)
→ `storeseo_get_blog_post_job` (read-only)
**Agent:** The job is at step 4 of 5 and is not complete, so I will not call the draft finished. Checking again now.

## 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 OpenCode 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 OpenCode:** The OpenCode documentation describes deny rules for MCP tools but no ask-first mode, so a StoreSEO call that is not denied runs when the agent makes it. For this job that means the cost confirmation StoreSEO asks the agent for is the main check on spending credit, so read the cost it quotes before you answer. If you want a client-side stop, deny storeseo_generate_blog_post by name in the sessions where you are only auditing, and remove the rule for a session where you intend to write. Also remember that opencode mcp add writes to the project configuration unless you pass --global.

## What can you ask OpenCode to do?

- Use StoreSEO to list my blogs and write a 1,200 word draft on how to care for linen shirts in the News blog. Give me the credit cost and wait for my yes.
- Read brief.md in this folder and write the StoreSEO blog draft it describes, with a featured image. Tell me how far along the job is.
- Check the SEO record of the blog draft you just created and list the issues I should fix before publishing.
- 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 OpenCode ask me before it spends AI credit on a blog post?

StoreSEO tells the agent to name the cost and wait for your yes, and OpenCode follows that in the session. OpenCode's own documentation describes deny rules but no ask-first mode, so deny the generate tool by name if you want a hard stop.

### Where does the finished blog post end up?

In the Shopify blog you chose, as a draft article. It is not written into your project folder. You review it and publish it from Shopify admin.

### 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 Codex](https://storeseo.com/agent/codex/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 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 OpenCode guides

- [OpenCode and StoreSEO overview](https://storeseo.com/agent/opencode)
- [Audit your store's SEO with OpenCode](https://storeseo.com/agent/opencode/seo-audit)
- [Optimize meta tags and content with OpenCode](https://storeseo.com/agent/opencode/optimize-meta)
- [Optimize images and alt text with OpenCode](https://storeseo.com/agent/opencode/image-seo)
- [Get products ready for AI search with OpenCode](https://storeseo.com/agent/opencode/ai-search-readiness)
- [Publish llms.txt and agents.md with OpenCode](https://storeseo.com/agent/opencode/llms-txt-agents-md)
- [Set up structured data with OpenCode](https://storeseo.com/agent/opencode/structured-data)
- [Manage sitemaps and indexing with OpenCode](https://storeseo.com/agent/opencode/sitemaps)
- [Track keyword rankings with OpenCode](https://storeseo.com/agent/opencode/keyword-tracking)
- [Read Search Console and Analytics with OpenCode](https://storeseo.com/agent/opencode/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/opencode/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
