Read Search Console and Analytics with OpenCode
Reading Search Console and Analytics with OpenCode means asking the open-source terminal agent for your store's clicks, queries, pages and traffic sources, which StoreSEO reads from your connected Google accounts and OpenCode prints next to the project you are working in.
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 run opencode in the repository for your theme or storefront and ask a question in the prompt box, for instance which pages earn impressions but few clicks. After opencode mcp auth storeseo has completed, OpenCode sees the tools under the storeseo prefix, so the model calls storeseo_start and then storeseo_get_search_console_insights with the page dimension. The reply is a ranked table of pages with clicks, impressions, CTR and average position, plus the range totals and the previous period of the same length, and it appears in the terminal alongside the files you have open.
Because OpenCode is a coding agent, a finding can turn into a change in the same session without a context switch. Ask for the GA4 page_performance report with storeseo_get_analytics_report and the agent can match a weak landing page to its template, or write the figures into a Markdown file in the project so the next session can compare against them. You can also choose the dimension yourself: query, page, country, device, searchAppearance or date. Each choice is one more read call, and reads need no yes from you.
OpenCode exposes tool names to the model as server_tool, and its permission rules can match a pattern such as storeseo_*. That is useful here: if you only want reporting, you can deny the write tools by name and leave the two Google reports, so the session cannot apply anything even if the conversation drifts. If you later decide to act on a report, such as new meta for a page with a weak click-through rate, lift that rule for the job and let StoreSEO ask for your yes before the write.
-
You: List the pages with the most impressions and lowest CTR in the last 28 days.
- storeseo_start read-only
- storeseo_get_search_console_insights read-only
-
OpenCode: Three pages sit at a CTR under 2 percent despite high impressions: the Linen Shirt page, the Summer Dresses collection and the shipping policy page. Do you want the GA4 page performance for them too?
-
You: Yes, and write both results to a file.
- storeseo_get_analytics_report read-only
-
OpenCode: Done: both tables are in reports/google-28d.md, with the previous period beside each metric.
What to ask OpenCode
Use StoreSEO to show Search Console clicks, impressions, CTR and position by page for the last 28 days, top 20 by clicks.
Compare my Search Console performance on mobile and desktop for the last 28 days and note the biggest change.
Fetch the GA4 key_events report for last month and save the figures to reports/ga4-key-events.md in this project.
- Which queries brought the most clicks from Google in the last 28 days, and how does that compare with the month before?
- Which product pages have high impressions but a CTR under two percent?
- Show organic search traffic from GA4 for the last three months.
- Which countries send the most visitors, and on which devices?
- Which traffic sources led to purchases last month?
What StoreSEO does: search console and analytics reports
StoreSEO connects to your Google Search Console and Google Analytics 4 property. The agent reads Search Console performance by date, query, page, country, device or search appearance, and curated GA4 reports, each compared with the previous period by default.
Requires: A paid StoreSEO plan with Google connected in the app, and a GA4 property selected for Analytics reports.
- 1
Pick the question
Search Console answers how you appear in Google: clicks, impressions, CTR and average position. GA4 answers what visitors do: users, engagement, pages, sources and key events.
- 2
Read the report
The agent reads the last 28 days by default, or the range you name, broken down by the dimension that fits the question.
- 3
Compare periods
Both reports include the previous period of the same length and the change per metric unless you ask otherwise.
- 4
Turn it into actions
The agent can link what it finds to the other jobs, for example pages with impressions but a low CTR are candidates for new meta.
Search Console and Analytics reports reference
| Search Console metrics | Clicks, impressions, CTR, average position |
|---|---|
| Search Console dimensions | Date, query, page, country, device, search appearance |
| GA4 reports | Search traffic, user activity, demographics, page performance, traffic source, key events |
| Default range | Last 28 days |
| Comparison | Previous equal-length period with per-metric change, on by default |
| What it writes | Nothing. Both tools are read-only and never connect or configure Google |
| Plan | Paid plan with Google connected; GA4 property selected for Analytics |
Rules OpenCode follows
- Both tools are reads and run straight away.
- Connecting Google or choosing the GA4 property is done in the StoreSEO app; the agent hands you the link when it is missing.
- Numbers are reported as Google returns them; the agent does not project outcomes from them.
In OpenCode
OpenCode V2 expects servers under mcp.servers, while older versions put the server directly under mcp, so check the layout your installed version documents before you edit the file. opencode mcp add writes to the project configuration unless you pass --global, which means a server added without it will be missing in other projects and the report tools will not appear there. The docs describe deny rules but no ask-first mode, so deny the write tools by name if you want a client-side stop on a reporting session.
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 OpenCode save my Search Console report to a file?
Yes. OpenCode works in the folder you started it in, so you can ask it to write the figures from storeseo_get_search_console_insights or storeseo_get_analytics_report to a Markdown or CSV file and compare them in a later session.
How do I stop OpenCode from using the StoreSEO write tools during a reporting session?
Add a permission rule that denies the write tools by name, using the storeseo prefix, and leave the two Google report tools allowed. OpenCode documents deny rules for MCP tools, and the reports only need the read tools.
Can the agent connect my Google account?
No. Connecting Search Console and Google Analytics, and choosing the GA4 property, is done in the StoreSEO app. If Google is not connected, the tool returns a link telling you what to set up.
Can these reports change anything?
No. Both Google tools are read-only. They never connect, configure or write anything in Google or in your store.
Which plan includes Google reports over MCP?
A paid StoreSEO plan with Google connected. Analytics reports also need a GA4 property selected in the app.
How far back can the agent look?
You can name any date range the report supports. When you do not, both tools default to the last 28 days and compare it with the 28 days before.
Keep going
Search Console and Analytics reports with other agents
More OpenCode guides