# Read Search Console and Analytics with OpenCode

> Query Google Search Console and GA4 from the OpenCode terminal. StoreSEO returns clicks, queries, pages and sources with the change since the last period.

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.

## 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 show Search Console clicks, impressions, CTR and position by page for the last 28 days, top 20 by clicks."

## 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.

### Example session (illustrative)

**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)
**Agent:** 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)
**Agent:** Done: both tables are in reports/google-28d.md, with the previous period beside each metric.

## 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.

Tools: `storeseo_get_search_console_insights`, `storeseo_get_analytics_report`

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

| Setting or limit | What applies |
|---|---|
| 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 can you ask OpenCode to do?

- 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?

## Frequently asked 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.

## Search Console and Analytics reports with other agents

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

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

## Related documentation

- [StoreSEO with Google Search Console](https://storeseo.com/docs/storeseo-with-google-search-console)
- [How to use Search Console insights](https://storeseo.com/docs/how-to-use-google-search-console-insights)
- [Connect StoreSEO with Google Analytics](https://storeseo.com/docs/how-to-connect-storeseo-with-google-analytics)

---

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