Skip to content
Book a Call → mycocoon.life
Claude Code for SEO with live search data: keywords, SERPs and backlinks through one MCP. Cocoon blog.
← Back to Blog Tools 11 min read

Claude Code for SEO: Live Keyword, SERP and Backlink Data With treg

By Ammar Ahamed, Founder, Cocoon · 3 November 2026 · Facts checked against treg.to, its docs and its GitHub repository on 3 November 2026

THE SHORT ANSWER

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.

ⓘEvery number marked "we" or "our" comes from calls we ran through treg on 3 November 2026. Catalog prices are as listed on that day and change often. Facts about Semrush MCP and Ahrefs MCP come from their own help pages, linked under Sources. For what treg is and how it bills, start with What Is treg?

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:

KeywordMonthly searchesCompetitionCPC (USD)
mcp server201,000Low7.78
serp api74,000Medium3.92
dataforseo27,100Medium1.42
claude code mcp12,100Low5.65
semrush api2,900Low5.67
semrush mcp1,900Low19.94
ahrefs mcp1,900Low13.58
dataforseo mcp1,300Low2.96
seo api880Low13.41
claude code seo720Low6.59
claude code for seo390Lown/a
backlink api260Low15.59
keyword research api170Low26.75
seo mcp server110Medium9.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.

JobProviders in the catalog (examples)Listed price
Keyword volume, CPC, difficultySerpstat, 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 ideasSerpstat, Google Autocomplete, Keyword Plannerfrom $0.0005
Live Google results (with AI Overview)Seven routed providers, including DataForSEO and SerpApi$0.00015 to $0.015 per results page
Backlink summaryMoz, SE Ranking, DataForSEO, Majestic, Serpstat$0.0008 to $0.024 per domain
Referring domains listSE Ranking, Serpstat and othersfrom $0.000179
Anchors, individual backlinksRouted toolsvaries by provider
AI visibilityAI Overview citations, brand mentions in AI answers, cited sourcesvaries by provider
Search Console, GA4, Business ProfileYour own accounts through OAuthfree

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:

CallWhat came backServed byCost
Volume, CPC and competition for 70 keywordsA volume for 69 of the 70, with monthly history for eachDataForSEO$0.09
Google results for "claude code seo" (routed)7 organic results, the full AI Overview text and 8 related searches, in 2.4 secondsThe 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 dateMoz, 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

PROMPTUsing treg, get Google search volume, CPC and competition for every keyword in keywords.txt (worldwide, English). Use one bulk call, not one call per keyword. Show me the cost before you run it. Return a table sorted by volume and flag anything under 50 searches a month.

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

PROMPTUsing treg, pull the top 10 Google results for "[keyword]" with the AI Overview and related searches. Read the top 5 pages. Tell me what every top page covers, what none of them covers, and what the AI Overview says. Then write an outline that answers the searcher better, with the related searches as H2s where they fit.

3. Check whether AI answers cite you

PROMPTUsing treg, for each keyword in priority.txt, fetch the Google results with the AI Overview and list which domains the overview cites. Mark the keywords where our domain is cited, where a competitor is cited and where nobody is. Save the result to ai-visibility-[date].csv so we can compare next week.

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

PROMPTUsing treg, list the referring domains for competitor.com and for our domain. Show the domains that link to them and not to us, sorted by authority. Drop obvious spam and directories. Show the cost before you start and stop if it will pass $1.

5. Work your "striking distance" queries from Search Console

PROMPTUsing treg and our connected Search Console, list queries from the last 28 days where we average position 8 to 20 with at least 100 impressions. Group them by page. For the top 5 pages, open the file in this repo and suggest specific edits to the title, H2s and intro that target those queries.

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

PROMPTUsing treg, check our position for each keyword in tracked.txt in Google (country: [xx]). Compare with last week's file in /seo/ranks/ and write a short report: what moved up, what moved down, what dropped off page one. Use the cheapest results provider that answers.

7. Price programmatic pages before you build them

PROMPTHere are 10 topics and 12 locations. Build all 120 "[topic] in [location]" keywords and, using treg, get their search volumes in one call. Only keep combinations with real demand, and tell me how many pages that leaves.

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)

PROMPTGo through every page in /blog. List titles over 60 characters, missing or duplicate meta descriptions, pages without a canonical tag and pages whose JSON-LD doesn't parse. Fix them, show me the diff, and don't change any visible copy without asking.

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 needHow calls are paidBest for
Semrush MCPA Semrush One, SEO Classic or Trends API planAPI units from your plan; Semrush lists 50,000 units on the qualifying plans, with larger packages on higher tiersTeams already paying for Semrush who want its database in the agent
Ahrefs MCPAhrefs Lite or higherAPI units shared with the Ahrefs API: 200,000 a month on Lite, 800,000 on StandardTeams who already live in Ahrefs
DataForSEO MCPA DataForSEO accountPay as you go with DataForSEOHeavy SEO data use from one vendor
tregNothing with the vendorsOne prepaid balance, per call, 0% markup; your own vendor keys are used first and freeAgents 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

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

SEO

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 →

SEARCH IS CHANGING. SO IS THE JOB.

AI Overviews, answer engines and agents that edit your site: getting found now takes marketing judgement and comfort with AI tools. Cocoon teaches both, on real work:

Delivered on-site and online across Sri Lanka, Singapore, Malaysia, Cambodia, India and Dubai.

PRODUCT MARKETING & GTM →BOOK A FREE CALL