- Search has split in two. SEO wins the blue links; AEO (Answer Engine Optimization) wins citations inside ChatGPT, Claude, Perplexity and Google AI Overviews. In 2026 you need both.
- The data already exists — it's just siloed. Google Search Console knows where you rank and where you're losing clicks. GA4 knows what converts and which AI engines send traffic. Joined, they're an optimization map.
- Claude Code turns that map into a loop. Pull GSC + GA4 via 1ClickReport's MCP → find gaps → draft titles, meta and content briefs → re-pull next week to see what moved.
- You stay the editor. The agent analyzes and drafts; you approve and publish. Nothing touches your live site without you.
Most "AI SEO" tooling is a content spinner with a thesaurus. This is not that. This is the build for the person who already lives in a terminal, already runs Claude Code, and wants a recurring agent that does the unglamorous, high-leverage work every week: read the search data, find the handful of changes that matter, and write them up so you can ship them.
The engine underneath is 1ClickReport — a Claude-native marketing analyst and MCP server. You connect Google Ads, Meta, GA4, Google Search Console and Stripe once over OAuth, and from then on Claude can read your live data. The part this post leans into: because it's an MCP server, the same connection works in Claude Code — so you can go past chatting and actually build a custom agent that runs your SEO and AEO on a schedule you control.
SEO vs AEO in 2026 — and why both matter now
For twenty years, "search optimization" had one meaning: get your page to rank in the ten blue links. That game still pays — Google is still the largest single source of intent online — but it is no longer the whole board.
A growing share of buyer questions never reach a results page. Someone asks ChatGPT "what's the best AI marketing analytics tool for a small agency?" or asks Perplexity to compare two platforms, and the model answers in prose, citing a few sources inline. If you're one of those cited sources, you get the visit, the trust, and the mention — at the exact moment of decision. If you're not, you're invisible, no matter how well you rank on Google.
That second game is AEO — Answer Engine Optimization: getting your content cited inside AI-generated answers from ChatGPT, Claude, Perplexity and Google's AI Overviews. It overlaps with SEO but the signals diverge:
| Dimension | SEO (classic search) | AEO (answer engines) |
|---|---|---|
| Goal | Rank in the blue links | Be cited inside the AI's answer |
| Surface | Google / Bing results page | ChatGPT, Claude, Perplexity, AI Overviews |
| Rewards | Rankings, CTR, backlinks | Clear, extractable, well-attributed answers |
| Winning format | Comprehensive page on a query | Direct answer up top, then the depth |
| How you measure | GSC positions & clicks | GA4 AI-referral traffic + prompt-testing |
The good news: they pull the same direction far more often than not. Content that answers a question clearly and then earns the depth to back it up tends to rank well and get quoted. It's the same work — you just measure and aim for both. That's exactly what an agent is good at.
Why an agent and not a checklist? SEO/AEO isn't a one-time project — it's a maintenance loop. Pages decay, queries shift, competitors publish, AI engines re-crawl. A checklist rots the day you finish it. An agent re-runs the same disciplined analysis every week against fresh data and tells you only what changed.
The architecture: GSC + GA4, joined through one MCP
Before the agent, understand the two data sources it stands on — and why neither is enough alone.
Google Search Console is the only place that tells you, for real, how Google sees you: every query you appear for, your average position, impressions, clicks, and the click-through rate Google actually observed. It's the ground truth for ranking. What it can't tell you is what happened after the click.
GA4 is the other half. It knows which landing pages convert, which keep people, and — critically for AEO — which AI answer engines are sending you referral traffic. When a visit arrives from chatgpt.com or perplexity.ai, that's an AI answer that cited you doing its job. GA4 sees those referrals; GSC never will.
Each on its own is a half-picture. Joined, they're an optimization map: GSC says where you rank and where you're leaking clicks; GA4 says what that traffic is worth and which AI engines already trust you. 1ClickReport's MCP exposes both — get_gsc_metrics and get_ga4_metrics, among others — through one connection, which is the whole reason an agent can reason across them in a single pass.
The agent loop, conceptually
Strip away the prompts and the agent is one tight loop, run on a cadence you choose (weekly is the sweet spot):
- Pull. Query Search Console (last 28 days vs the prior 28) and GA4 (sessions, conversions, and AI-referral hosts) through the MCP.
- Diagnose. Find the four opportunity types: striking-distance keywords, CTR gaps, decaying pages, and content gaps (queries you almost rank for but have no strong page).
- Draft. For each opportunity, write the actual fix — a rewritten title tag, a sharper meta description, or a content brief with the answer block AEO needs.
- Track. Re-pull next cycle. Did the fixed pages move up? Did AI-referral traffic grow? Are you newly cited for the prompts you're testing? Log it, then loop.
Steps 1–3 are fully automatable. Step 4 is what makes it an agent rather than a one-off report: it closes the loop and measures its own work. Let's make each step concrete.
Step 1 + 2 — Pull and diagnose
You don't write code for this. You describe the job, and Claude makes the tool calls. The diagnosis prompt below is the heart of the agent:
Claude runs the Search Console queries, does the period-over-period math, and hands back a ranked list — not a data dump, an opportunity list. The "estimated click upside" framing forces prioritization: fix the three changes worth a hundred clicks before the thirty worth five.
Step 3 — Draft the fixes
A list of problems isn't leverage; a list of ready-to-paste fixes is. This is where having GA4 in the same context pays off — Claude can weight its recommendations toward the pages that actually convert, not just the ones that rank.
Now you have artifacts. You paste the title and meta into your CMS, hand the brief to whoever writes (or to Claude), and ship. The answer block is the AEO move: a clean, quotable, self-contained answer is exactly what an LLM reaches for when it builds a response — and it cites the page it took it from.
Step 4 — Track AEO visibility (are the AI engines citing you?)
This is the part almost nobody automates, and it's the difference between guessing and knowing. AEO visibility has two measurable signals, and your agent can watch both.
Signal one — GA4 AI-referral traffic. When an answer engine cites you and the user clicks through, GA4 logs a referral from that host. Trend it and you can see AEO working in aggregate:
Signal two — prompt-testing. Referrals tell you when a citation got a click; they don't tell you whether you're being mentioned at all for the questions that matter. So the agent also keeps a short list of buyer-intent prompts and records, on each run, whether your domain shows up as a cited source. Over weeks that becomes an AEO-visibility score you can actually watch move.
Why this closes the loop: Step 3's "answer blocks" are a hypothesis — make the content quotable and the engines will quote it. Step 4 is the test. If AI-referral traffic and prompt-test hits climb after you ship answer blocks, the strategy is working and you do more of it. That feedback is what separates an agent from a content generator.
Building it in Claude Code
Everything above runs as a normal Claude conversation. The reason to move it into Claude Code is repeatability: a saved agent definition, the same MCP, and a job you can re-run with one command instead of re-typing prompts.
The setup is short. Connect Google Search Console and GA4 to 1ClickReport with OAuth, then point Claude Code at the same 1ClickReport MCP server you already use — the tools (get_gsc_metrics, get_ga4_metrics, list_gsc_sites, and the rest) show up natively. Then you capture the agent's job once, in plain English, as a reusable instruction:
With that saved, a single instruction kicks off the whole loop:
Claude Code makes the MCP calls, runs the analysis, drafts the fixes, updates your AEO-visibility log, and hands you one markdown report — the highest-leverage hour of your search week, compressed into a few minutes of review. The last line of the instruction is the important one: the agent never publishes. It proposes; you ship.
Manual SEO vs a Claude Code agent
The point isn't that the agent does things you can't. It's that it does the recurring things you won't — reliably, every week, against fresh data.
| Task | Manual, by hand | Claude Code agent |
|---|---|---|
| Pull GSC + GA4 and join them | 30–45 min of exports & VLOOKUPs | Seconds, in one pass via MCP |
| Find striking-distance keywords | Manual filtering, easy to miss | Ranked by click upside, automatically |
| Spot decaying pages early | Usually noticed after the drop | Flagged period-over-period |
| Draft titles, meta & briefs | 15–20 min per page | 5 pages drafted in one prompt |
| Track AI-citation / AEO visibility | Rarely done at all | Logged and trended every run |
| Run it again next week | Depends on willpower | One command, same rigor |
Build your SEO & AEO agent — free for 7 days
Connect Google Search Console & GA4 in about 60 seconds, then run the loop in Claude or wire it into Claude Code. Find the wins, draft the fixes, and watch whether the AI engines start citing you.
How to start
You don't need to build the whole agent on day one. The fastest path to value is a single prompt against live data:
- Connect. Sign in to 1ClickReport and link Google Search Console + GA4 over OAuth — about a minute each.
- Run the diagnosis once. Paste the Step-1+2 prompt into Claude and read the opportunity list. You'll likely find three striking-distance wins on the first run.
- Ship one fix. Take the highest-upside keyword, have Claude draft the title, meta and answer block, and publish it. Prove the loop on one page.
- Make it recurring. Once you trust the output, move it into Claude Code with the saved instruction above and run it weekly.
Start with the chat, graduate to the agent. Either way the data — and the AI engines — are already deciding who gets cited. This is how you make sure it's you.
Go deeper
This is the technical build. The rest of the cluster covers the strategy and the adjacent channels:
Frequently asked questions
What is the difference between SEO and AEO?
SEO (Search Engine Optimization) is about ranking your pages in the classic blue-link results on Google and Bing. AEO (Answer Engine Optimization) is about getting cited as a source inside AI-generated answers — ChatGPT, Claude, Perplexity, and Google's AI Overviews. They overlap, but the signals differ: SEO rewards rankings and clicks, while AEO rewards clear, extractable, well-structured answers an AI is comfortable quoting and attributing to you.
Can Claude Code actually optimize my SEO automatically?
It runs the analysis loop end to end: it pulls Google Search Console and GA4 through 1ClickReport's MCP server, finds opportunities like striking-distance keywords and decaying pages, and drafts the fixes — titles, meta descriptions, and content briefs. Publishing to your CMS stays in your hands, so you review every edit before it goes live. It automates the analysis and drafting, not the publishing.
What is a striking-distance keyword?
A query where you already rank around positions 5–15 — close enough that a focused improvement (a better title, added depth, internal links, or a snippet-friendly answer block) can push you onto page one. Because you already have impressions and partial relevance, these are usually the fastest, highest-ROI wins — and an agent surfaces them from Search Console in seconds.
How do I track whether AI answer engines are citing me?
Two signals together. First, GA4 referral traffic from hosts like chatgpt.com, perplexity.ai and claude.ai shows when an AI answer sent a real visitor. Second, periodic prompt-testing — asking the engines the questions your buyers ask and recording whether your domain appears as a cited source. Your Claude Code agent pulls the GA4 side automatically and logs the prompt-test results over time so you can watch AEO visibility trend.
Do I need to know how to code to build a Claude Code SEO agent?
You need to be comfortable in a terminal, but not a developer. Connect Search Console and GA4 to 1ClickReport with OAuth, point Claude Code at the same MCP server, and describe the agent's job in plain English in a CLAUDE.md or saved prompt — Claude Code handles the tool calls and analysis. Prefer not to touch a terminal? The same workflow runs as a normal chat in Claude. The agent build is the power-user path, not a requirement.
