Producing a single well-researched SEO article is a surprising amount of repetitive work: pulling keyword data, reading the top-ranking pages, mapping search intent, building an outline, drafting against that outline, and checking everything for accuracy. Most of those steps are mechanical. They follow the same pattern every time, which makes them a natural fit for automation.
This guide is a technical walkthrough of how to build that automation using a large language model (LLM) connected to live SEO data through the Model Context Protocol (MCP). The examples use Claude and the Ahrefs MCP because that combination is well documented, but the same architecture works with other models and tools like ChatGPT, the OpenAI API, and orchestration platforms like n8n.
The goal here is to explain how the system works so you can build it with whatever stack you already pay for, rather than to endorse any single product.
By the end you will understand the data flow, the prompt patterns, how “skills” actually work under the hood, and how to wire the whole thing into an automated pipeline.
The architecture in one paragraph
Every version of this system has the same shape. An LLM provides the reasoning and writing. An SEO data source provides ground-truth numbers (search volume, difficulty, SERP composition, backlinks). A connector protocol that is usually MCP, lets the model call that data source as a tool instead of guessing. And an optional orchestration layer chains the steps together and runs them on a schedule. Swap any single component and the architecture still holds. That is the important takeaway: you are building a pattern, not installing a product.
Why ground the model in real data
The single most important design decision is forcing the model to use real SEO data rather than its training memory.
Left to its own devices, any LLM will happily produce confident-sounding statistics search volumes, difficulty scores, “according to recent data” claims that are entirely fabricated. The model is optimizing for plausible text, not factual accuracy. For SEO work this is fatal: an outline built on hallucinated keyword volumes targets the wrong terms, and an article citing invented numbers is a liability.
The fix is to connect the model to a live data source so it retrieves facts instead of inventing them. This is what the Model Context Protocol enables.
What MCP is
MCP (Model Context Protocol) is an open standard, originally introduced by Anthropic and now adopted broadly, that defines how an AI assistant calls external tools and data sources. An MCP “server” exposes a set of typed functions for SEO data these are things like “get keyword overview” or “get SERP results” and any MCP-compatible client (Claude, and increasingly other assistants) can call them.
Several SEO platforms now ship MCP servers, including Ahrefs and SEMrush. There are also generic data providers like DataForSEO that you can reach through an MCP wrapper or a direct API. The data source is interchangeable. The examples below use the Ahrefs MCP, but the prompt patterns translate directly to any equivalent server and you would just change the tool names.
The Ahrefs MCP is available on its paid plans and connects with a single HTTP endpoint:
https://api.ahrefs.com/mcp/mcp
Choosing your model
The reasoning-and-writing layer is also interchangeable. The three common options:
Claude (Anthropic). Strong at following long, structured instructions and at multi-step tool use, which is why it appears in most published walkthroughs of this workflow. Native MCP support. Usable via the web app, the API, or Claude Code (a terminal-based agent).
ChatGPT (OpenAI). The most widely used assistant. It supports connectors and custom GPTs, and it can call external tools. For a no-code setup, many people connect SEO data to ChatGPT and prompt it conversationally. It is a perfectly capable substitute for the drafting and reasoning steps.
OpenAI API (or any model API directly). If you want full programmatic control, call a model API directly from your own code or from an orchestration tool. You handle the tool-calling loop yourself: the model requests a tool, your code executes the SEO data call, you feed the result back, and the model continues. This is more work but gives you complete control over cost, logging, and behavior. The same applies to Anthropic’s API, Google’s Gemini API, or open-weight models you host yourself.
The rest of this guide is written model-agnostically. Where a prompt is shown, it works in any of these, you are just pasting it into a chat, a custom GPT’s instructions, or an API call.
What “skills” actually are
The Claude ecosystem talks a lot about “skills,” and the term sounds more mysterious than it is. A skill is just a Markdown file containing structured instructions plus a short description of when to use it. That is the entire concept. There is no special runtime, no compiled code — it is a prompt, organized and saved so it can be reused consistently.
A skill file has two parts: a metadata header (a name and a description that tells the model when the instructions apply) and the body (the instructions themselves). Here is a complete example:
markdown
---
name: keyword-qualify
description: >
Use when the user provides a target keyword and asks whether it
is worth writing about. Triggers on "should I write about",
"qualify this keyword", "is this keyword worth it".
---
# Keyword Qualification
1. Pull search volume, keyword difficulty, traffic potential, and
parent topic from the SEO data source.
2. Pull the SERP overview and identify the dominant content format.
3. Calculate the average domain rating of the top 10 results.
4. Output a verdict — PURSUE / NICHE DOWN / SKIP — with one
paragraph of reasoning that cites the specific numbers.
The reason to formalize prompts this way is consistency. If you paste a slightly different instruction every time, you get slightly different output every time. A saved skill file removes that variance. The “magic” is purely organizational: it is documentation that the model reads.
This means the concept ports anywhere. In ChatGPT, the equivalent is the instructions field of a custom GPT, or a saved prompt. In an API workflow, it is a system-prompt string you load from a file. In n8n (covered below), it is the text inside a prompt node. Same idea, different container.
The seven-step pipeline
Here is the full workflow, broken into the steps a human editor performs. Each step is shown as a reusable prompt. The prompts reference an SEO data source generically — substitute your MCP server’s actual tool names.
Step 1 — Keyword qualification
Validate that a keyword is worth the effort before generating anything.
“Using the connected SEO data source, pull search volume, keyword difficulty, traffic potential, parent topic, and global volume for . Then pull the SERP overview and report the dominant content format, the average domain rating of the top 10, and whether any weak pages in the top 10 could be displaced by a well-optimized article. End with a verdict: pursue, niche down, or skip.”
Step 2 — Search intent mapping
Volume tells you how many people search a term; the SERP tells you what they want.
“Pull the top 10 organic results for . For each, infer the user intent (informational, commercial, transactional, navigational), the article angle, and the format. Summarize the dominant intent and any blended sub-intents. If intent is mixed, flag it explicitly.”
Mixed-intent SERPs are a common trap — if half the results are tutorials and half are product comparisons, you have to commit to one angle.
This is where automation saves the most time.
“For each of the top 10 URLs, fetch the page and extract the H1, all H2 and H3 headings, approximate word count, and whether it has FAQs, tables, or a table of contents. Then build a consensus map: topics covered by 5+ pages (must-haves), by 3-4 pages (differentiators), and by only 1-2 pages (rare angles or opportunities).”
The output is effectively a content brief derived from the SERP itself, where every recommended topic is justified by ranking evidence.
Step 4 — Content gap analysis
Once you know what the SERP covers, find what it misses.
“Find keywords that the top 3 ranking sites for collectively rank for but [your-domain.com] does not. Filter to at least 100 monthly volume and difficulty under 40. Group results by topical cluster.”
These gaps often become a whole content series, plus internal-link targets for the article you are about to write.
Step 5 — Outline generation
With validated data, mapped intent, competitor consensus, and gaps in hand, the outline is straightforward.
“Build an H1/H2/H3 outline targeting . Cover every must-have consensus topic, include differentiators that fit naturally, and add two or three rare angles for a competitive edge. Under each H2, add a one-line note on what data, example, or argument belongs there. Target length: [range].”
The outline is the highest-leverage artifact in the pipeline. A strong outline with average drafting beats brilliant drafting of a weak outline every time. Review it carefully before continuing.
Step 6 — Drafting against the outline
“Draft the article section by section, following the approved outline exactly. Write each section in a [your voice] tone. Where the outline references data, retrieve it live from the SEO data source rather than estimating. Pause after each section for approval before continuing.”
The pause-per-section instruction matters: unsupervised long generations tend to drift in tone and quality.
Step 7 — Quality control
“Review the full draft: 1) Does every data claim cite a real retrieved figure? 2) Any hallucinated statistics or invented quotes? 3) Does each H2 deliver what its heading promises? 4) Suggest internal links to relevant existing pages on [your-domain.com]. 5) Flag any section that reads as generic boilerplate and propose a more specific rewrite.”
Having the model audit its own output against an explicit checklist catches most of the obvious problems before a human ever opens the draft.
Orchestrating the pipeline with n8n
Running each step manually works, but the real efficiency gain comes from chaining the steps so a keyword goes in and a reviewable draft comes out. You have two broad options.
Code-based orchestration. Agentic tools like Claude Code, or a custom script calling a model API, can read a sequence of skill files and execute them in order, saving each step’s output to disk. This suits developers who are comfortable in a terminal.
No-code / low-code orchestration with n8n. n8n is an open-source workflow automation tool (self-hostable or cloud) that connects services with a visual node graph. It is a strong fit for this pipeline because it can call AI models, hit SEO APIs, and pass data between steps without you writing a full application. n8n also has native AI/LLM nodes and supports MCP, so it can act as the orchestration layer that ties the model and the data source together.
A typical n8n flow for this workflow looks like:
- Trigger node — a schedule (e.g., daily) or a manual/webhook trigger that supplies the target keyword.
- SEO data node — an HTTP request to your SEO API (or an MCP node) that pulls keyword and SERP data.
- AI node (qualification) — sends the data plus your qualification prompt to the model; routes “skip” verdicts to a dead end.
- HTTP / scraping nodes — fetch the top-ranking competitor pages.
- AI node (outline) — generates the outline from the consensus map.
- AI node (draft) — produces the draft section by section.
- Output node — writes the result to Google Docs, a CMS draft, Notion, or email for human review.
Because each node passes structured data to the next, you can inspect and debug any single stage in isolation — which is exactly the kind of troubleshooting visibility the manual version lacks. The same flow can be rebuilt in other automation tools (Make, Zapier, or a plain cron job calling a script); n8n is simply a convenient, open option.
A crucial design rule for any orchestration: always output every intermediate step to its own file or node. If a ten-minute automated run produces a bad article, you need to see where it went wrong — at qualification, intent, outline, or drafting rather than re-running the whole thing blind.
Cost and time, realistically
The economics depend on which components you choose, but a representative setup looks like this:
Model access — a consumer AI subscription runs roughly $20/month, or you pay per token via an API (often cheaper for low volume, more expensive at scale). API pricing varies widely by model and provider, so check current rates.
SEO data — the main recurring cost. SEO platforms with MCP or API access typically start in the low hundreds per month. Pay-per-request data providers can be cheaper for occasional use.
Orchestration — n8n is free to self-host; its cloud tier and commercial alternatives charge monthly. A plain script costs only your time.
Time per article — expect roughly 15-25 minutes of automated runtime from approved outline to draft, plus 30-60 minutes of human editing, versus the 5-8 hours a comparable manual article typically takes.
The setup cost that actually matters is not money but the time spent writing good prompt/skill files. Those files encode your editorial standards, and they are only as good as the process you put into them.
Where automation should stop
Being honest about the limits is what separates a useful system from an AI-slop factory. This pipeline handles a large class of informational content well. It should not be pointed at everything. Or at least it should not be used to create thousands of articles without any control or value.
Topics you cannot personally verify. Automation amplifies your judgment; it does not replace it. If you cannot tell whether a generated claim is true, you cannot safely publish it.
Original research and genuine expertise. Proprietary studies, first-hand case data, and contrarian takes grounded in real experience cannot be generated from nothing. The model can format them; it cannot originate them.
YMYL niches. Medical, legal, and financial content needs credentialed human authorship.
Volume-for-volume’s-sake. Publishing hundreds of undifferentiated AI articles is a reliable way to damage a domain. Search engines and AI answer engines increasingly demote thin, derivative content. Use the pipeline to publish better, not just more.
Strategy and link building. Deciding which topic clusters to pursue, how to build topical authority, and how to earn editorial backlinks is upstream strategic and relational work that no pipeline performs for you.
Teams that want the strongest results often combine in-house automation for execution with outside expertise for strategy; one neutral reference point for what that strategic layer involves is a typical seo agency service scope, which spans authority mapping, technical fixes, and off-page work that sits outside any content-drafting tool.
Common implementation mistakes
Not mandating the data source. If your prompts do not explicitly require live data retrieval, the model will fabricate numbers. State the requirement in every relevant step.
Skipping human review. The pipeline is fast enough to publish unread. Resist that. A human should read every piece before it ships.
Treating prompts as set-and-forget. Your skill files should evolve. After each article, note what went wrong and refine the relevant prompt. The system compounds in quality only if you maintain it.
No intermediate outputs. Without saving each step, debugging a bad run is guesswork. Persist every stage.
Ignoring brand voice. Default model prose is competent but interchangeable. Feed your best human-written pieces in as voice examples and the difference is immediate.
Frequently asked questions
Do I have to use Claude?
No. Claude appears in most published examples because of its strong tool-use behavior, but ChatGPT, the OpenAI API, Gemini, and self-hosted models can all perform the reasoning and drafting. The architecture is model-agnostic.
Do I have to use Ahrefs?
No. Any SEO data source with an API or MCP server works — SEMrush, DataForSEO, and others. The prompt patterns stay the same; only the tool names change.
Is AI-assisted content allowed by Google?
Google’s stated position is that AI-assisted content is acceptable when it is genuinely helpful and high quality. The line they care about is content produced primarily to manipulate rankings rather than to help users. A reviewed, data-grounded article is on the right side of that line; a bulk scrape-and-spin operation is not.
Can I run this entirely no-code?
Largely, yes. A consumer AI assistant with a connected SEO data source covers the manual workflow, and n8n (or a similar tool) covers automation without traditional programming. Full API-based setups give more control but require code.
A starter prompt to test the concept
Before building any automation, validate the idea with a single prompt in any AI assistant that has an SEO data source connected:
“I want to write an SEO article targeting . Run this workflow: (1) pull keyword overview metrics; (2) pull the SERP overview and identify dominant intent, format, and average domain rating of the top 10; (3) fetch the top 5 ranking pages and extract their H1 and H2s; (4) build a consensus map of H2-level topics appearing in 3+ of those pages; (5) propose an outline of one H1 and 8-12 H2s covering every consensus topic plus two differentiating angles; (6) under each H2, note the data, example, or argument it should contain. Pause after step 6 for my review.”
In about two minutes you get a complete, evidence-based content brief. Drafting from there is a matter of asking the model to write each section against the outline while retrieving any additional data it needs.
Summary
The system has four interchangeable parts: a model for reasoning and writing, an SEO data source for ground truth, MCP (or a direct API) to connect them, and an optional orchestrator like n8n to chain and schedule the steps. “Skills” are simply saved, structured prompts — documentation the model reads, nothing more. Build the pattern with whatever stack you already use, force the model to rely on real data, keep a human in the loop, and reserve automation for the work it genuinely does well. The tooling is finally good enough; the remaining bottleneck is editorial judgment.

