Claude Code for SEO: Live Keyword, SERP and Backlink Data With treg
Claude Code is already good at the on-page half of SEO: it can rewrite titles, fix JSON-LD, build sitemaps and draft pages straight into your repo. What it can't do alone is see live search data. Connect one MCP server, treg, and the same agent can pull keyword volumes, live Google results with AI Overviews, backlink profiles, rank tracking and your own Search Console data, paying per call instead of per seat. For this post we priced 70 keywords in one call for $0.09, read a live results page for $0.00015 and pulled a backlink summary for $0.013.
What Claude Code can do for SEO, and what it can't see
Point Claude Code at a website repo and it will happily do the work most SEO audits end with: shorten titles that truncate, add missing meta descriptions, write BlogPosting and FAQPage structured data, fix broken internal links, generate a sitemap and compress images. Open-source skills make this even more thorough. When we searched Google for "claude code seo", the top two organic results were the same free audit plugin, claude-seo, and its site.
But an audit skill gives your agent a method, not data. Ask it "how many people search for this?", "who ranks on page one right now?" or "which sites link to our competitor and not to us?" and it has two choices: say it doesn't know, or guess. A guessed search volume reads exactly like a real one, which is why it's dangerous. The fix is a data layer the agent can call. That is the gap treg fills: the skill brings the method, treg brings the numbers.
What people search for: "Claude Code SEO" and its neighbours
To show the workflow rather than describe it, we did this post's keyword research with Claude Code and treg. One call to DataForSEO's Google Ads volume endpoint priced 70 keywords at once. A few of the results:
| Keyword | Monthly searches | Competition | CPC (USD) |
|---|---|---|---|
| mcp server | 201,000 | Low | 7.78 |
| serp api | 74,000 | Medium | 3.92 |
| dataforseo | 27,100 | Medium | 1.42 |
| claude code mcp | 12,100 | Low | 5.65 |
| semrush api | 2,900 | Low | 5.67 |
| semrush mcp | 1,900 | Low | 19.94 |
| ahrefs mcp | 1,900 | Low | 13.58 |
| dataforseo mcp | 1,300 | Low | 2.96 |
| seo api | 880 | Low | 13.41 |
| claude code seo | 720 | Low | 6.59 |
| claude code for seo | 390 | Low | n/a |
| backlink api | 260 | Low | 15.59 |
| keyword research api | 170 | Low | 26.75 |
| seo mcp server | 110 | Medium | 9.59 |
Our data: Google Ads monthly averages, all locations, English, via DataForSEO through treg, 3 November 2026. One call, 70 keywords, $0.09.
Two things stand out. People search for the plumbing far more than the use case: "claude code mcp" gets about seventeen times the searches of "claude code seo". And the vendor-specific servers ("semrush mcp", "ahrefs mcp") already draw nearly 2,000 searches a month each, with high ad prices, which tells you SEO teams are actively shopping for a way to get their data into an agent.
The SEO data treg gives Claude Code
Here is the SEO part of the catalog as listed on 3 November 2026. Where several providers do the same job, treg shows them side by side with price, measured success rate and speed, and a routed tool can pick for you.
| Job | Providers in the catalog (examples) | Listed price |
|---|---|---|
| Keyword volume, CPC, difficulty | Serpstat, SE Ranking, DataForSEO; Google Ads Keyword Planner on your own account | $0.0005 per keyword (Serpstat) to $0.09 per call of up to 1,000 keywords (DataForSEO); free on your own Google Ads account |
| Keyword ideas | Serpstat, Google Autocomplete, Keyword Planner | from $0.0005 |
| Live Google results (with AI Overview) | Seven routed providers, including DataForSEO and SerpApi | $0.00015 to $0.015 per results page |
| Backlink summary | Moz, SE Ranking, DataForSEO, Majestic, Serpstat | $0.0008 to $0.024 per domain |
| Referring domains list | SE Ranking, Serpstat and others | from $0.000179 |
| Anchors, individual backlinks | Routed tools | varies by provider |
| AI visibility | AI Overview citations, brand mentions in AI answers, cited sources | varies by provider |
| Search Console, GA4, Business Profile | Your own accounts through OAuth | free |
Note the shape of the pricing. Serpstat bills per keyword it returns (and bills a minimum even when it returns nothing), SE Ranking bills per keyword too, and DataForSEO bills per call regardless of how many keywords are in it. For a long list of niche, long-tail terms, one DataForSEO call is usually the safer buy. For a handful of head terms, Serpstat is cheaper. Your agent can read this off catalog get and choose.
Set up Claude Code for SEO with treg
In Claude Code, paste:
set up treg - https://treg.to/llms.txt
or run the installer yourself:
curl -fsSL https://treg.to/install.sh | sh treg login treg catalog search "keyword search volume"
Then connect Google Search Console and GA4 through OAuth from your treg dashboard, so your agent can read your own clicks, impressions and positions. Those calls run on your account and aren't metered. New verified accounts start with $1.00 of credit, which at the prices above is a lot of keyword research.
What we ran, and what it cost
Three calls, made through treg's MCP tools from Claude Code on 3 November 2026:
| Call | What came back | Served by | Cost |
|---|---|---|---|
| Volume, CPC and competition for 70 keywords | A volume for 69 of the 70, with monthly history for each | DataForSEO | $0.09 |
| Google results for "claude code seo" (routed) | 7 organic results, the full AI Overview text and 8 related searches, in 2.4 seconds | The cheapest provider that answered | $0.00015 |
| Backlink summary for mycocoon.life (routed) | Domain Authority, spam score, linking root domains, total links and the last crawl date | Moz, tried first as the cheapest of three | $0.0133 |
The results page was the most useful call for writing. The AI Overview for "claude code seo" described three things: audit plugins installed with /plugin or npx skills add, Claude Code fixing meta tags, sitemaps and structured data in the codebase, and scripts that pull Search Console and GA4 data into files the agent can query. The related searches ("Claude Code SEO agent", "Claude Code SEO skill", "Claude Code SEO plugin") told us which sub-topics this post should cover. That's a content brief for less than a fiftieth of a cent.
8 Claude Code SEO workflows, with prompts you can copy
Each prompt asks the agent to show the cost first. Keep that habit: it turns a surprise bill into a two-second check.
1. Price a keyword list before you write anything
Why it works: one bulk call is cheaper than many small ones, and the "flag under 50" line stops you writing for terms nobody searches.
2. Build a brief from the live results page
3. Check whether AI answers cite you
Answer engines are now a second front page. A weekly snapshot of who gets cited is the simplest way to track it.
4. Find backlink gaps against a competitor
5. Work your "striking distance" queries from Search Console
This is where Claude Code is at its best: the data comes from treg, and the edits land in your codebase in the same session.
6. Track rankings weekly without a rank-tracker seat
7. Price programmatic pages before you build them
Pricing 120 combinations costs cents. Building 120 pages nobody searches for costs weeks, and risks Google treating them as scaled, low-value content.
8. Fix the technical basics in the repo (no data needed)
Not every SEO job needs paid data. Run this one first; it's free and often the biggest win.
Semrush MCP, Ahrefs MCP, DataForSEO MCP or treg?
If you searched for "semrush mcp" or "ahrefs mcp", you've probably noticed both vendors now ship official MCP servers. They're good, and they suit a different situation from treg:
| What you need | How calls are paid | Best for | |
|---|---|---|---|
| Semrush MCP | A Semrush One, SEO Classic or Trends API plan | API units from your plan; Semrush lists 50,000 units on the qualifying plans, with larger packages on higher tiers | Teams already paying for Semrush who want its database in the agent |
| Ahrefs MCP | Ahrefs Lite or higher | API units shared with the Ahrefs API: 200,000 a month on Lite, 800,000 on Standard | Teams who already live in Ahrefs |
| DataForSEO MCP | A DataForSEO account | Pay as you go with DataForSEO | Heavy SEO data use from one vendor |
| treg | Nothing with the vendors | One prepaid balance, per call, 0% markup; your own vendor keys are used first and free | Agents that need SEO plus other data (social, enrichment, ads) without a seat for each |
Our view: if your team opens Semrush or Ahrefs every day, keep it and use the vendor's MCP server. If you're a smaller team, an agency running occasional audits, or you need SEO data alongside social and enrichment data, treg is the lighter choice. And they combine: connect your Semrush key to treg and your agent reaches Semrush through the same token, unmetered.
Guardrails for an SEO agent
- Cap the spend. Give the agent its own treg token with a spend cap (
treg org agent-new --cap), and ask for the expected total before any loop. A routed call already stops at $1 by default. - Check big decisions twice. Keyword tools disagree. Before you commit a quarter's content plan to a term, check its volume with a second provider.
- Keep a person on "publish". Let the agent research, brief and draft. A person reads before anything goes live. Google's spam policies target pages produced at scale mainly to rank, however they were made.
- Save raw answers. Ask the agent to write each response to a file. You can re-read it later without paying twice, and you'll catch parsing mistakes.
- Mind the terms. Data from a provider comes with that provider's terms. Don't republish raw third-party datasets as your own.
The on-page side still matters as much as the data. If you want a ranked list of the AI SEO tools worth trying beyond Claude Code, see our best AI SEO tools guide. If outbound is your next job after organic, the same setup powers the workflow in GTM Engineering With Claude Code.
Frequently asked questions
Can Claude Code do SEO?
Yes. It can edit titles, meta descriptions, structured data, internal links and sitemaps directly in your codebase, and run audit skills. For keyword volumes, rankings, backlinks and AI Overviews it needs live data through an MCP server such as treg, a vendor's own MCP server, or an API.
What is the best MCP server for SEO?
It depends on what you already pay for. Semrush MCP and Ahrefs MCP suit teams on those plans. DataForSEO's MCP server suits heavy use of one vendor. treg suits agents that need SEO data from several vendors, plus social or enrichment data, without a subscription to each.
Is there a Semrush MCP server?
Yes. Semrush's official MCP server is available on Semrush One, SEO Classic and Trends API plans. Semrush One Starter, Semrush One Pro+, SEO Classic Pro and SEO Classic Guru include 50,000 MCP API units that refresh at renewal, and larger unit packages are sold with higher tiers.
Is there an Ahrefs MCP server?
Yes. Ahrefs MCP is available on Lite and higher plans. Calls use API units shared with the Ahrefs API: 200,000 a month on Lite, 800,000 on Standard and 2,000,000 on Advanced.
How much does keyword research cost in Claude Code with treg?
Listed prices on 3 November 2026 ran from $0.0005 per keyword (Serpstat) to $0.09 per call of up to 1,000 keywords (DataForSEO). We priced 70 keywords in one DataForSEO call for $0.09.
Can Claude Code check Google AI Overviews?
Yes, with a search results tool that returns them. treg's routed Google results tool returned the AI Overview text with the organic results and related searches; our call for one keyword cost $0.00015.
Can Claude Code connect to Google Search Console?
Yes. Through treg you connect Search Console and GA4 with OAuth, and calls to your own accounts aren't metered. You can then ask for striking-distance queries and have Claude Code edit the matching pages in your repo.
Will SEO content written with Claude Code be penalised?
Google's spam policies target content produced at scale mainly to manipulate rankings, however it was made. Pages that genuinely help searchers, checked and edited by a person, are judged like any other page.
Sources
treg
Other MCP servers
- Understanding Semrush MCP, Semrush Knowledge Base
- Getting started with Ahrefs MCP, Ahrefs Help Center
- DataForSEO MCP server, DataForSEO
SEO
- claude-seo, an open-source SEO plugin for Claude Code
- Spam policies for Google web search, Google Search Central
Never wired an agent to an API? Our free API Lab has you send real requests to a live feed, then hand the same API to an agent over MCP.
Open API Lab →