---
title: "Claude Code for SEO"
description: "Connect Claude Code to stored GSC data. Includes prompts for content decay, keyword cannibalization, and striking-distance reviews."
canonical_url: "https://gscdump.com/learn-google-search-console/ai-agents/claude-code-seo"
last_updated: "2026-07-20"
---

[Claude Code can call MCP tools](https://code.claude.com/docs/en/mcp) while it works with the files and commands in a repository. When you connect gscdump's hosted MCP server, Claude Code can analyze GSC data and then inspect the code that may explain a finding. The seven focused analytics tools require existing stored data, and the current hosted sync jobs require Pro access. Composed reports are unmetered during beta and can query Search Analytics live when stored coverage is unavailable.

In one session, you can query GSC and inspect the repository behind the affected pages. MCP returns bounded, structured results, so you do not have to load a complete CSV export into the context window.

## Where Claude Code Helps

Dashboards are a good fit for routine reporting. Reach for Claude Code when the next step is in the repository: trace a traffic drop to a route change, inspect titles and canonicals, update a template, or turn a verified finding into a testable patch.

A reusable prompt can still produce different calls or conclusions between runs. Use explicit dates, inspect the tool calls, and verify important totals before acting on a recommendation.

## Setup: gscdump MCP

Generate an API key in the gscdump dashboard, then follow Claude Code's [remote HTTP server setup](https://code.claude.com/docs/en/mcp) to add it at user scope:

```bash
claude mcp add --transport http --scope user --header "x-api-key: YOUR_KEY" \
  gscdump https://gscdump.com/mcp
```

Verify the saved configuration with `claude mcp get gscdump`. Inside Claude Code, run `/mcp` to check the connection, then ask:

```md
List my GSC sites
```

Claude should return the connected properties available to the API key, together with their permission levels and sync status. The package `@gscdump/mcp` and the file `~/.claude/mcp.json` are not part of the current hosted setup.

## SEO Prompts

### Basic: Traffic Analysis

```md
Show pages losing traffic over the last 28 days vs previous period
```

Claude requests two explicit date ranges from the page tool, calculates deltas, and returns a ranked list. Check the ranges it selected before relying on the comparison.

```md
Among the pages returned by get-pages, find those with an average position
of 4-15 and at least 100 impressions.
```

GSC's [average position](https://support.google.com/webmasters/answer/7576553) drives this filter. A page may have appeared above or below that average on individual impressions during the period, and the click-sorted 1,000-row list is not a complete inventory of a large property.

### Intermediate: Content Decay

```md
Find pages that lost 30%+ clicks in the last 3 months.
For each page, show which keywords declined and by how much.
```

This takes multiple calls: page data for both periods, then page details for both periods for the highest-priority URLs. On a large property, the 1,000-row list limit leaves part of the site outside the review.

### Advanced: Keyword Cannibalization

```md
Among the keywords returned by get-keywords, find those where 3+ returned pages
have an average position of 20 or better.
For each keyword, show:
- Returned ranking pages
- Average position for each returned page
- Click distribution across those pages
- Whether the case warrants consolidation review
```

Claude can use keyword-detail calls to find queries associated with multiple ranking pages. The detail tool is click-sorted and returns no more than 250 pages, so even this view can be truncated. Treat those cases as review signals. They do not prove harmful cannibalization, and the highest-clicked URL may still be the wrong canonical.

### URL Indexing Check

```md
Check if these URLs are indexed:
- https://example.com/blog/post-1
- https://example.com/blog/post-2
- https://example.com/products/item-3

Cross-reference with sitemap data.
```

The current MCP tool inspects one fully qualified URL per call and is subject to Google's [URL Inspection quota](https://developers.google.com/webmaster-tools/limits). It returns Google's indexed version of each page, not a live fetch of the current URL. Sitemap information in the result can support a targeted cross-check, but [Google does not guarantee that list is exhaustive](https://developers.google.com/webmaster-tools/v1/urlInspection.index/UrlInspectionResult).

## Building Automated SEO Scripts

**Example: Weekly decay report**

```md
Write a TypeScript script that:
1. Queries GSC for pages losing 20%+ clicks week-over-week
2. Groups by category (extract from URL path)
3. Sends Slack notification with top 10 decliners
4. Includes the date ranges, absolute click change, and source row for each page
5. Suggests a change only when repository evidence supports it
```

Claude can draft the analysis and notification code, but the interactive MCP connection is not itself a scheduler or a documented HTTP client library. Choose a verified data path, such as an MCP-capable automation runner or the Search Console API. Review its authentication, pagination, and failure behavior before scheduling it. Do not let generated code invent endpoint paths.

**Example: Cannibalization monitor**

```md
Create a script that runs daily and flags new cannibalization issues.
Store previous results in SQLite to track when issues appear/resolve.
Alert only when a case first appears.
```

The monitor also needs a persistent store, alert deduplication, and an explicit failure path. Make an empty or truncated API response fail the run, even when the process exits successfully.

## Real Workflow: Content Audit

Developer asks:

```md
Audit my blog content:
1. Find posts with declining CTR (28d vs prev)
2. For the top decliners, show the queries and position changes
3. Inspect title and description code for low-CTR pages
4. Find related pages in this repository that could link to the decliners
```

Claude:

1. Requests page data for two explicit periods
2. Calculates CTR trends and chooses a bounded set of pages
3. Requests page details for those URLs
4. Locates the corresponding files in the repository
5. Suggests title, description, or internal-link changes for review

Ask for a Markdown report that includes the date range, tool limits, evidence, and proposed changes. The MCP server has no featured-snippet ownership data, site crawler, or complete internal-link graph.

## Combine GSC and Repository Context

Claude Code can combine bounded tool results with repository files. Useful combinations include:

- Comparing two explicit GSC date ranges, then checking the affected route or template
- Inspecting the keywords associated with a page before changing its title
- Checking a specific URL's canonical and indexing verdict after a migration

The MCP result limits still apply. `get-pages` and `get-keywords` return at most 1,000 rows. Sitemap tools return feed-level summaries and do not enumerate every URL in a sitemap.

## Copy-Paste Prompts

**Striking distance keywords:**

```md
Run the opportunities report for the latest complete 28-day period.
From its striking-distance findings, show queries with an average position
of 4-15 and at least 100 impressions, sorted by impressions.
Treat these exact terms as branded and exclude them: [add terms].
Preserve the report's coverage and truncation status.
```

**Traffic decliners:**

```md
Use explicit dates for the most recent complete 28-day period and the preceding 28 days.
Show the top 20 pages losing clicks.
Build the comparison from the union of pages returned for both periods.
For up to 10 pages, call page details for both periods and show the leading
query by current-period clicks with its average-position change.
Report list limits and any truncation.
```

**Cannibalization check:**

```md
Among the keywords returned by get-keywords, find those where 2+ returned pages
have an average position of 20 or better.
Show the pages, clicks, impressions, and average position.
Flag them for review; do not assume the lower-clicked page should be canonicalized.
```

**CTR outliers:**

```md
Run the opportunities report for the latest complete 28-day period.
Show its underperforming-CTR findings, coverage, and truncation status.
Review the affected page titles and descriptions, but do not assume the snippet is the cause.
```

**Targeted migration check:**

```md
Inspect these fully qualified URLs and report the indexing verdict,
Google-selected canonical, user-declared canonical, and last crawl time.
```

## When to Use Claude Code or a Dashboard

Use Claude Code when:

- Building custom workflows (e.g., decay alerts)
- Combining GSC data with repository files or separately configured tools
- Generating reports that don't fit dashboard templates
- You're already in the terminal

Use traditional SEO tools when:

- Stakeholders need shareable dashboards
- You need backlink analysis, rank tracking, or keyword research
- You need full-site crawling or competitor data that GSC does not provide

## Turn One Monthly Task Into a Checked Workflow

1. Connect gscdump MCP to Claude Code
2. Run basic prompts to verify setup
3. Identify one manual SEO task you repeat monthly
4. Ask Claude to draft the workflow, then verify its date ranges and tool coverage

For scheduled automation, record date ranges, result counts, and failures. An empty response or expired credential should fail loudly.

## Related Articles

- [GSC MCP Server](/learn-google-search-console/ai-agents/mcp-server): Set up gscdump MCP for Cursor and Claude Code
- [AI SEO Workflows](/learn-google-search-console/ai-agents/seo-workflows): Automated analysis patterns beyond single prompts
- [GSC API Rate Limits](/learn-google-search-console/api/rate-limits): Understanding quotas when building automation
- [16 Month Data Limit](/learn-google-search-console/limits/16-month-data-retention): Why historical data preservation matters
