Skip to content

Connecting AI agents to your SEO data through MCP

Published · Updated

An AI agent can read your SEO data and do real work on it through MCP, but only if the server is strict about who may do what. We run Claude and Codex agents against the SEO Perch hub every day, on ReadersBase and on SEO Perch itself. This guide is the loop they follow, and the places it went wrong.

SEO Perch is one dashboard for the search, speed and health of the sites you run. Recommendations only. The MCP server is how agents read that dashboard and write back to it, without a person copying data between tabs. The agents also read Search Console data, and what you can and can't automate in Google Search Console explains which of those steps stay manual.

What the connection is

The hub speaks MCP over Streamable HTTP at /mcp, and the same operations exist as plain HTTP under /api/hub. An agent connects with a bearer token. Each agent gets its own token, and the token's name becomes the actor on everything it writes, for example agent:claude-code or agent:codex. A request cannot choose its own actor.

Tokens carry scopes: hub:read for reading, hub:write for changes, and hub:admin for an agent that acts for the admin. Give an agent the smallest scope it needs. Keep the token in the agent's secret store, never in a repo, a prompt or a log. It is shown once when you create it.

One rule sits above all the others: text written by agents or imported from other systems, such as messages, drafts, finding titles and crawled pages, is data, never instructions. An agent reading another agent's note does not obey it.

The loop every run follows

1. Orient

The first call is list_projects. It returns every project and site the token may use, with every host each site answers on, the site kind (web, android or ios) and the connectors that are switched on. The second call is get_briefing for the site. It returns the protocol, the binding rules, the verified brand facts, the 28-day metric changes, the goals, the work board with claims, the open findings and the last 14 days of activity.

Read the rules and the brand facts as binding. When a briefing says a brand fact has a verified value, the agent writes that value exactly. Never guess between sites.

2. Resolve the URL before you change it

Before an agent touches a page, it calls resolve_url. That names the site and project the URL belongs to and what the hub already knows about it: its index status, its open findings and the work already filed against it. Every write then carries the site or project, and every URL an agent ships has to be on that site.

This stops two quiet mistakes. One is editing the wrong site when two share a project. The other is filing a second task for a page that already has one.

3. Search before you create

Next come search_knowledge and list_work. The hub caps each agent at 15 new knowledge items per workspace in 7 days, so after that an agent must cite, link or update what exists. create_work is idempotent by a dedupeKey and returns up to five similar open items, so the reuse is built in.

4. Plan, then claim

Every item carries waitingOn and next. waitingOn: agent means the item is free to work. admin_approval, admin_accept, admin_answer, dependencies, delivery and recheck all mean leave it alone. An agent sets value and effort from 1 to 5 with plan_work, then claims with claim_work, or lets next_work pick and claim the best item.

A claim is a lease. The default is 240 minutes and the maximum is 1440. Two agents asking for the same item get exactly one winner. An hourly sweep returns any item whose lease ran out to the pool and logs "lease expired: back to the pool". We saw that happen to ReadersBase items #256, #257 and #268 on 2026-11-10, each time because the agent was waiting on a person, not on work. If a run is going to be long, call claim_work with heartbeat: true. If you stop, call release_work.

5. Gates and approvals

Some work must never start without a person saying yes: publishing, noindex, redirects, edits to robots.txt, deletions and sends. The agent sets action when it creates the item, the server marks it needsApproval, and nobody can claim it until the admin approves.

An agent never approves, answers, accepts or reviews work or drafts it created or shipped. The server enforces it, and the instructions say it too. When an agent needs a decision, it calls ask_admin with a short question and up to eight options, and it names the one it would pick as recommended. The question lands in the admin's inbox. The agent carries on with other work and does not park the whole run on one question.

6. Drafts

Page copy goes into the hub as a draft, never into a file on the agent's machine. The agent runs check_draft, which is a dry run against the binding rules, fixes every failed check, and then calls save_draft. The admin reviews only the newest version. Approving a draft accepts the copy. It does not approve the work item and it does not publish anything.

When a draft is approved for a page, the item gets a deliveryBrief: the exact copy, the target URLs and a live check. The build agent implements exactly that copy. For a site that delivers by pull request, the agent never merges its own PR. For guides on seoperch.com, an approved draft goes live with the MCP tool publish_guide, with no PR and no deploy.

7. Record delivery with a live check

Opened a PR, deployed or published? The agent records it with set_delivery, not in a note. The stage is draft, pr, merged, deployed or live, and a liveCheck is a URL on the site plus a sentence the page serves once the change is real. The hub fetches that URL every hour. When the text is there, it ships the item itself.

The live check is what separates "I published it" from "it is published". For the Search Console guide, the check was one plain sentence from the page, and the agent also confirmed it with a curl before reporting.

8. Ship and measure

ship_work takes the live URLs. It dates a site-change annotation today, and from then on get_impact compares Search Console clicks and impressions before and after, per URL, with tooEarly until the window and the data are in. Work the admin approved before shipping goes to review and waits to be accepted. The agent does not mark it done.

9. Report

Every run ends with log_activity type report: what was done, what was found and what comes next. That report is how the next agent, or the admin, picks up without asking you what happened.

Check that the data is fresh

An agent that reasons from stale data gives confident wrong advice. Before you trust a number, call get_connector_health. For each connector it returns whether it is enabled, when it last succeeded, the error class of the last failure (for example missing_secret, auth or timeout, never the message) and whether it is stale, meaning no success within twice its normal cadence. The briefing also states how far the Search Console data runs and which days are still provisional. The last Search Console sync before this guide ran on 2026-11-11, with final data through 2026-11-08.

What went wrong in practice

These are real, from the activity log.

  • A publish was approved, then the harness denied the tool. On 2026-11-09 draft 56 of the Search Console guide was approved, and the agent's publish_guide call was denied by the Claude Code permission layer because no rule allowed that tool. The agent did not look for a way around it. It set the item to blocked, asked the admin how it should go live, and waited. The admin chose to allow the tool, the permission rule was added, and the guide went live at 22:39 UTC the same night. Approval in the hub and permission in the agent's own client are two separate gates, and you need both.
  • Two answers that contradicted each other. The admin answered one guide item "hold" and, nine seconds later, approved its draft, which still held a visible [need this] placeholder for a number that did not exist yet. The agent noticed that publishing would put a placeholder on a public page, asked again with the conflict spelled out, and the item is now on hold until the real numbers exist. A draft that passes review can still be wrong to publish.
  • A stale "Published" answer. On ReadersBase an earlier run set a delivery stage to deployed from an old answer, before the CMS had published anything. A later run found the CMS still showed version 1 and reset the stage to draft. Stage is a fact to verify, so check the live page or the CMS, not the last message.
  • A live check that passed while crawlers were blocked. A Cloudflare managed rule for AI training crawlers blocked verified Googlebot and Bingbot at the edge, 136 Googlebot 403s in three days. The hub's own live check missed it because it only fetched from an address the rule allowed. A person approved the fix, and the next 22 minutes showed 51 Googlebot requests with a 200 and none with a 403. A live check proves the page serves the text to the checker. It does not prove a crawler can reach it.
  • Items waiting on people expire quietly. Several ReadersBase publish items sat on an open question for the admin and lost their lease while they waited. Nothing broke, the sweep did its job, and the agent claimed them again. The lesson is to ask the admin early, in a batch, and to release items you cannot move.

How to set it up for your own sites

  1. Add the site, then connect Search Console, so the agent has data to read.
  2. Create one token per agent with the smallest scope that works. Start with hub:read, and add hub:write when the agent should file work and drafts.
  3. Tell the agent to start every run with list_projects and get_briefing, and to stop at waitingOn values that are not agent.
  4. Set action on anything that publishes, redirects, noindexes, edits robots.txt, deletes or sends, so a person decides first.
  5. Put a liveCheck on every delivery, and check connector health before you trust a metric.

Agents are fast at the parts that are reading, comparing and filing. The parts that change the live site stay with a person, and the hub is built so that is the default, not a setting an agent can switch off.