Vous pouvez créer un agent d'audit SEO dans Claude Code en lui fournissant l'outil Scavio MCP et une invite structurée. L'agent recherche les mots-clés cibles, vérifie la présence de l'AI Overview, identifie les lacunes de classement et génère un rapport sans collecte manuelle de données.
Prérequis
- Claude Code installé
- Scavio MCP configuré dans .mcp.json
- Liste de mots-clés cibles
Parcours
Étape 1: Configurer Scavio MCP dans Claude Code
Ajoutez le serveur Scavio MCP à votre projet .mcp.json si ce n'est pas déjà fait.
{
"mcpServers": {
"scavio": {
"command": "npx",
"args": ["-y", "@scavio/mcp-server"],
"env": { "SCAVIO_API_KEY": "your-scavio-api-key" }
}
}
}Étape 2: Créez le fichier d'invite d'audit
Enregistrez-le sous seo-audit.md dans votre projet. Ouvrez Claude Code et collez-le dans le chat.
# SEO Audit Task
Audit the following site for SEO performance: [YOUR DOMAIN]
For each keyword below, use the scavio search tool to:
1. Find the site's position in organic results (1-10 = page 1, 11-20 = page 2, not found = not ranking)
2. Check if an AI Overview is present (include_ai_overview: true)
3. Check if the site appears in the AI Overview sources
Keywords:
- [keyword 1]
- [keyword 2]
- [keyword 3]
Output a markdown table with columns: Keyword | Position | AI Overview | AIO Citation
Then write a 5-bullet action plan based on the findings.Étape 3: Exécutez l'audit et analysez les résultats
Claude Code appellera Scavio pour chaque mot-clé et compiler les résultats. Pour des exécutions automatisées, utilisez le script Python ci-dessous.
import requests
from datetime import date
API_KEY = "your-scavio-api-key"
YOUR_DOMAIN = "yoursite.com"
def audit_keyword(keyword: str) -> dict:
r = requests.post(
"https://api.scavio.dev/api/v1/search",
json={"query": keyword, "include_ai_overview": True, "num_results": 20},
headers={"x-api-key": API_KEY},
timeout=20
)
data = r.json()
results = data.get("organic_results", [])
position = next(
(i + 1 for i, r in enumerate(results) if YOUR_DOMAIN in r.get("link", "")),
None
)
ao = data.get("ai_overview")
aio_cited = False
if ao:
aio_cited = any(YOUR_DOMAIN in s.get("link", "") for s in ao.get("sources", []))
return {
"keyword": keyword,
"position": position or "not ranking",
"ai_overview": bool(ao),
"aio_citation": aio_cited
}Étape 4: Générez le rapport d'audit
Exécutez les audits pour tous les mots-clés et imprimez un tableau en markdown.
KEYWORDS = [
"best project management software",
"project tracker for teams",
"asana alternative",
"free task management tool"
]
print(f"# SEO Audit - {YOUR_DOMAIN} - {date.today()}\n")
print("| Keyword | Position | AI Overview | AIO Citation |")
print("|---------|----------|-------------|--------------|")
for kw in KEYWORDS:
result = audit_keyword(kw)
pos = str(result['position'])
aio = 'yes' if result['ai_overview'] else 'no'
cited = 'yes' if result['aio_citation'] else 'no'
print(f"| {kw} | {pos} | {aio} | {cited} |")Exemple Python
import requests
from datetime import date
API_KEY = "your-scavio-api-key"
YOUR_DOMAIN = "yoursite.com"
KEYWORDS = [
"best project management software",
"project tracker for teams",
"asana alternative 2026",
"free task management tool",
"kanban board online"
]
def audit_keyword(keyword: str) -> dict:
r = requests.post(
"https://api.scavio.dev/api/v1/search",
json={"query": keyword, "include_ai_overview": True, "num_results": 20},
headers={"x-api-key": API_KEY},
timeout=20
)
r.raise_for_status()
data = r.json()
results = data.get("organic_results", [])
position = next((i + 1 for i, res in enumerate(results) if YOUR_DOMAIN in res.get("link", "")), None)
ao = data.get("ai_overview")
aio_cited = bool(ao and any(YOUR_DOMAIN in s.get("link", "") for s in ao.get("sources", [])))
return {"keyword": keyword, "position": position, "ai_overview": bool(ao), "aio_citation": aio_cited}
def generate_report(keywords: list, domain: str) -> str:
rows = [audit_keyword(kw) for kw in keywords]
lines = [f"# SEO Audit: {domain} — {date.today()}\n",
"| Keyword | Position | AI Overview | AIO Citation |",
"|---------|----------|-------------|--------------|"]
not_ranking = [r for r in rows if not r["position"]]
p2 = [r for r in rows if r["position"] and r["position"] > 10]
cited = [r for r in rows if r["aio_citation"]]
for row in rows:
pos = str(row["position"]) if row["position"] else "not ranking"
lines.append(f"| {row['keyword']} | {pos} | {'yes' if row['ai_overview'] else 'no'} | {'yes' if row['aio_citation'] else 'no'} |")
lines.append("\n## Action Plan")
if not_ranking:
lines.append(f"- Create or optimize pages for: {', '.join(r['keyword'] for r in not_ranking[:3])}")
if p2:
lines.append(f"- Build links to pages targeting: {', '.join(r['keyword'] for r in p2[:3])}")
if not cited:
lines.append("- No AI Overview citations detected. Add FAQ schema and expand definition sections.")
if cited:
lines.append(f"- Maintain AIO citations for: {', '.join(r['keyword'] for r in cited)}")
return "\n".join(lines)
if __name__ == "__main__":
print(generate_report(KEYWORDS, YOUR_DOMAIN))Exemple JavaScript
const API_KEY = 'your-scavio-api-key';
const YOUR_DOMAIN = 'yoursite.com';
async function auditKeyword(keyword) {
const res = await fetch('https://api.scavio.dev/api/v1/search', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'x-api-key': API_KEY },
body: JSON.stringify({ query: keyword, include_ai_overview: true, num_results: 20 })
});
const data = await res.json();
const results = data.organic_results ?? [];
const position = results.findIndex(r => r.link?.includes(YOUR_DOMAIN)) + 1 || null;
const ao = data.ai_overview;
const aioCited = ao ? (ao.sources ?? []).some(s => s.link?.includes(YOUR_DOMAIN)) : false;
return { keyword, position, aiOverview: !!ao, aioCited };
}
const keywords = ['best project management software', 'asana alternative 2026'];
const rows = await Promise.all(keywords.map(auditKeyword));
console.log('| Keyword | Position | AI Overview | AIO Citation |');
for (const row of rows) {
console.log(`| ${row.keyword} | ${row.position ?? 'not ranking'} | ${row.aiOverview ? 'yes' : 'no'} | ${row.aioCited ? 'yes' : 'no'} |`);
}Sortie attendue
# SEO Audit: yoursite.com - 2026-05-22
| Keyword | Position | AI Overview | AIO Citation |
|---------|----------|-------------|-------------- |
| best project management software | 7 | yes | no |
| project tracker for teams | not ranking | no | no |
| asana alternative 2026 | 14 | yes | yes |
| free task management tool | 3 | yes | no |
| kanban board online | not ranking | yes | no |
## Action Plan
- Create or optimize pages for: project tracker for teams, kanban board online
- Build links to pages targeting: asana alternative 2026
- No AI Overview citations for most keywords. Add FAQ schema and expand definition sections.