# Manage sitemaps and indexing with OpenCode

> Use OpenCode in your terminal to list StoreSEO sitemap, noindex and nofollow flags, change one resource after your yes and set up an HTML sitemap page.

Managing sitemaps and indexing with OpenCode means asking the open-source terminal agent to read StoreSEO's sitemap, noindex and nofollow flags on your Shopify products, collections, pages and articles, change them one resource at a time and set up the HTML sitemap.

## 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 products that are noindex or excluded from the sitemap. Read only, no writes."

## How does this work in OpenCode?

You open OpenCode in the theme project, with the storeseo server added by opencode mcp add and signed in with opencode mcp auth storeseo, and type a request such as which pages are excluded from the sitemap. Tool names reach the model as server_tool, so the agent calls storeseo_start and then storeseo_list_resource_sitemaps, asking for the page resource type and filtering on the sitemap flag. Each call prints in the session as it runs and every one is a read. The same session can hold the theme code, so a question about why a template carries a robots meta tag sits next to the StoreSEO flag for that page.

Writing a flag is a separate step. A noindex flag removes a page from search results, so StoreSEO tells the agent to name the resource and the flags and wait for your yes before storeseo_update_resource_sitemap. OpenCode's MCP documentation describes deny rules but no ask-before-running mode, so StoreSEO's confirmation in the chat is the main check unless you add a client-side stop. A permission rule matching storeseo_update_resource_sitemap with the deny effect hides that tool entirely, which is a clean way to run a read-only audit session. Then ask the agent to list the resource again, since the flags can change in the StoreSEO app.

The HTML sitemap uses storeseo_get_html_sitemap_settings first, because an update replaces the settings wholesale, then storeseo_update_html_sitemap to generate and enable the page, then storeseo_list_sitemap_menus for the edit links. You add the sitemap link to a menu in Shopify admin; no tool does it. Everything in this job runs on any active plan, so it works on the free plan too.

### Example session (illustrative)

**You:** Which products are left out of the sitemap?
→ `storeseo_start` (read-only)
→ `storeseo_list_resource_sitemaps` (read-only)
**Agent:** Gift Card Test and Sample Pack are excluded from the sitemap; only Gift Card Test is also noindex. Should I put Sample Pack back in the sitemap?
**You:** Yes, put Sample Pack back.
→ `storeseo_update_resource_sitemap` (needs approval)
→ `storeseo_list_resource_sitemaps` (read-only)
**Agent:** Sample Pack is back in the sitemap. Gift Card Test is unchanged.

## What StoreSEO does: sitemaps and indexing

StoreSEO controls two things here: per-resource sitemap flags (left out of the XML sitemap, noindex, nofollow) and an HTML sitemap page. The agent lists flags, changes them one resource at a time and walks you through the HTML sitemap setup.

Tools: `storeseo_list_resource_sitemaps`, `storeseo_update_resource_sitemap`, `storeseo_get_html_sitemap_settings`, `storeseo_update_html_sitemap`, `storeseo_list_sitemap_menus`

1. **List the flags.** The agent lists products, collections, pages or articles with their sitemap, noindex and nofollow flags, filtered as you ask.
2. **Change one resource.** After your yes it sets the flags on one resource, which writes the matching Shopify metafields.
3. **Re-read before reporting.** Flags can also change in the StoreSEO app, so the agent re-lists before telling you the current state.
4. **Create the HTML sitemap.** It reads the HTML sitemap settings, then generates and enables the page.
5. **Add it to a menu.** It lists your navigation menus with their edit links; you add the sitemap link to a menu in Shopify admin, then the agent marks setup complete.

## Sitemaps and indexing reference

| Setting or limit | What applies |
|---|---|
| Flags per resource | Excluded from sitemap, noindex, nofollow |
| Resource types | Products, collections, pages and articles |
| Where flags live | Shopify metafields on the resource |
| HTML sitemap steps | Generate and enable, add the link to a menu yourself, mark complete |
| HTML sitemap settings | Replaced wholesale on update; read first |
| Menus | Listed with edit links; the menu you choose is not stored |
| Plan | Every active plan |

## Rules OpenCode follows

- A noindex flag removes a page from search results, so the agent names the resource and waits for your yes.
- The agent re-lists flags in the same turn before telling you their current state.
- Adding the sitemap link to a menu is a step you do in Shopify admin; no tool does it.
- HTML sitemap settings are read before every update, because an update replaces them.

**In OpenCode:** OpenCode's documentation describes deny rules for MCP tools but no setting that asks before running one, so for a noindex change StoreSEO's confirmation in the chat is the main check. If you want a client-side stop, add a permission rule with the deny effect for storeseo_update_resource_sitemap and storeseo_update_html_sitemap, and lift it only for the session where you mean to write. Also note that opencode mcp add writes to the project configuration unless you pass --global, so a sitemap session in another folder will not see the server.

## What can you ask OpenCode to do?

- Use StoreSEO to list my products that are noindex or excluded from the sitemap. Read only, no writes.
- Exclude the product Gift Card Test from the sitemap and set it to noindex. Show me the resource and flags first and wait for my yes.
- Check my HTML sitemap settings with StoreSEO, set it up if it is missing and list the menus I can add it to.
- Which of my products are set to noindex or excluded from the sitemap?
- Exclude the product Gift Card Test from the sitemap and set it to noindex.
- Set up an HTML sitemap for my store and tell me which menu to add it to.
- Are any of my blog posts set to nofollow?
- Remove noindex from the page About Us.

## Frequently asked questions

### How do I stop OpenCode from changing sitemap flags by accident?

Add a permission rule with the deny effect for the StoreSEO update tools, for example storeseo_update_resource_sitemap. OpenCode's docs describe deny rules for MCP tools, so the agent can still list flags but cannot write them.

### Does OpenCode need the config layout for the HTML sitemap tools?

No extra setup is needed beyond the storeseo server entry. In OpenCode V2 it sits under mcp.servers, and the sitemap tools then work on any active StoreSEO plan.

### What is the difference between excluding a page from the sitemap and noindex?

Excluding a resource leaves it out of your XML sitemap, so crawlers are not pointed at it. Noindex tells search engines not to show the page in results even if they find it. StoreSEO sets each flag separately per resource.

### Can the agent add the HTML sitemap to my menu?

No. The agent generates the HTML sitemap and lists your menus with their edit links, and you add the sitemap link to a menu in Shopify admin. Then the agent can mark setup complete.

### Do sitemap tools need a paid plan?

No. The sitemap tools work on every active StoreSEO plan.

### Why does the agent check the flags again before answering?

Sitemap flags can also be changed in the StoreSEO app outside the conversation, so an earlier listing may be stale. Re-reading in the same turn keeps the answer accurate.

## Sitemaps and indexing with other agents

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

## 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)
- [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)
- [Write SEO blog post drafts with OpenCode](https://storeseo.com/agent/opencode/blog-posts)

## Related documentation

- [How to generate an HTML sitemap](https://storeseo.com/docs/how-to-generate-html-sitemap)
- [Choose products to include in the sitemap](https://storeseo.com/docs/how-to-choose-products-to-include-in-sitemap)
- [Store not appearing in Google search results](https://storeseo.com/docs/store-not-appearing-in-google-search-results)

---

Canonical: https://storeseo.com/agent/opencode/sitemaps
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
