Track keyword rankings with OpenCode
Tracking keyword rankings with OpenCode means running the open-source terminal agent in your theme project and asking it to add keywords to StoreSEO's Google rank tracker, read their positions and history, and compare them with competitor domains.
Last updated: October 2026
Set up OpenCode for StoreSEO
Skip this if OpenCode is already connected. The full guide, with the alternatives, is on the OpenCode page.
- 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.
Terminalopencode 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.
Terminalopencode mcp auth storeseo opencode mcp list
How does this work in OpenCode?
You start OpenCode in the project folder and type a request such as show my tracked keywords and which ones fell. The agent calls storeseo_start, then storeseo_list_keywords, which returns each keyword's latest Google position, the change, SERP features and competitor positions. For one keyword it reads storeseo_get_keyword_history, a dated trail with the competitor positions at every check. Because the agent also works on your files, you can ask it to write the movers into a Markdown file or a CSV in the repository and keep a running log next to your theme code.
Adding keywords is a short exchange. OpenCode calls storeseo_list_rank_locations and storeseo_list_rank_languages, because the tracker only accepts the exact names those lookups return, then shows you the rows it would add with country, language and device. After your yes in the terminal it calls storeseo_add_keywords. Checks run in the background, so a new keyword shows no position until a later storeseo_list_keywords. Competitors follow the same pattern with storeseo_list_competitors and storeseo_add_competitors, up to five domains.
OpenCode hands tool names to the model as the server name plus the tool name, so StoreSEO tools look like storeseo_ followed by the tool, and permission patterns can match them. Rank and competitor tracking are Pro plan tools, and the tracker covers Google only. If your plan lacks them, the agent should say so rather than call the rank tools.
-
You: Add example-competitor.com as a competitor and show me how it ranks against me.
- storeseo_start read-only
- storeseo_list_competitors read-only
-
OpenCode: You track 3 of 5 competitor domains. Shall I add example-competitor.com as the fourth?
-
You: Yes, add it.
- storeseo_add_competitors needs approval
- storeseo_list_keywords read-only
-
OpenCode: Added. Its positions fill in as the next checks run; for now it shows no rank on your five keywords.
What to ask OpenCode
Use StoreSEO to list my tracked keywords sorted by overall position and write the five biggest movers to rank-log.md. Read only.
Look up the exact country and language names for the United Kingdom and English, then show me the keyword rows you would add and wait for my yes.
Add example-competitor.com as a competitor, but first list my current competitors and tell me how many of the five slots are used.
- Track shopify linen shirts and linen shirt for men in the United States on mobile.
- How have my tracked keywords moved this month, and where do my competitors rank?
- Show the rank history for organic cotton tote since July.
- Add example-competitor.com as a competitor.
- Build a keyword cluster for my best seller and tell me the estimated credit first.
- Which tracked keywords dropped out of the top ten?
What StoreSEO does: keyword rank tracking
StoreSEO checks your Google rank for tracked keywords by country, language and device, records the history and compares competitor domains. Keyword clusters group related keywords around a product's focus keyword with search volume and difficulty.
Requires: Rank and competitor tracking are Pro plan tools. Keyword clusters spend AI Content Optimizer credit.
- 1
Pick the market
The agent looks up the exact country and language names the tracker accepts, because new keywords must use them verbatim.
- 2
Add keywords
After your yes it adds keywords with a country, language and device. Checks run in the background, so positions appear later.
- 3
Read ranks and history
It lists your keywords with the latest Google position, change, SERP features and competitor positions, and reads the dated history for any keyword.
- 4
Compare competitors
Up to five competitor domains are tracked alongside your keywords. To change one, it is deleted and the new domain added.
- 5
Build a cluster
For a product with a focus keyword, StoreSEO generates a cluster of related keywords in the background; the agent states the estimated credit first and polls until it is ready.
Keyword rank tracking reference
| Search engine | Google; AI search engines are not tracked |
|---|---|
| Locations | 213 countries, country level only |
| Languages | 127 languages |
| Devices | Desktop or mobile |
| Competitors | Up to five domains; no edit, delete and re-add |
| Keyword limit | Counts against your plan's keyword limit |
| Deleting a keyword | Removes its entire rank history; cannot be undone |
| Keyword cluster | Built around the product's existing focus keyword, sorted by search volume, with relevance and difficulty |
| Plan | Pro plan for rank and competitor tools |
Rules OpenCode follows
- On a plan without rank tracking, the agent explains the upgrade instead of calling the rank tools.
- Country and language names come from the lookup tools, never typed from memory.
- Deleting a keyword or competitor erases its history for good, so the agent confirms each one.
- A cluster needs a focus keyword set in the StoreSEO app; the agent states the estimated credit and waits for your yes.
In OpenCode
OpenCode's documentation describes deny rules for MCP tools but no ask-first mode, so the yes StoreSEO asks the agent for in the terminal is the main check on writes. If you want a client-side stop, deny the delete tools by name with a pattern, because storeseo_delete_keyword permanently removes a keyword and its entire rank history. Also remember that opencode mcp add writes to the project configuration unless you pass --global, so a server added without it only exists in that project, and OpenCode V2 expects servers under mcp.servers.
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
Can I stop OpenCode from deleting tracked keywords?
Yes. OpenCode permission rules can deny tools by name or pattern, so deny the StoreSEO delete tools if you want a client-side stop. Deleting a keyword erases its whole rank history and cannot be undone.
Can OpenCode save my keyword rankings to a file?
Yes. OpenCode works in the folder you started it in, so you can ask it to write the positions or the biggest movers into a Markdown or CSV file there and update it in a later session.
Which plan do I need for keyword tracking through an agent?
Rank tracking and competitor tracking are Pro plan tools. On other plans the agent should explain that instead of calling them. Keyword clusters work on plans with AI Content Optimizer credit.
Does StoreSEO track rankings in AI search engines?
No. The rank tracker checks Google results by country, language and device. AI visibility is handled by the GEO score, llms.txt and agents.md jobs instead.
Why are new keywords pending?
Rank checks run in the background. Adding a keyword queues the first check, and its position appears in the keyword list once that check completes.
What is a keyword cluster?
A group of related keywords built around a product's focus keyword, sorted by search volume and scored for relevance and difficulty. It shows which wider terms the product page can target.
Keep going
Keyword rank tracking with other agents
More OpenCode guides