# Ferramentas e APIs - SEO Audit

## 1. SEO Tools API (http://localhost:3000)

```bash
# Auditoria basica
curl "http://localhost:3000/seo-audit?url=URL"

# Velocidade PageSpeed Insights style
curl "http://localhost:3000/page-speed-analyzer?url=URL"

# Backlinks + DR/UR
curl "http://localhost:3000/backlink-checker?url=URL"

# Rankings para keywords
curl "http://localhost:3000/rank-checker?url=URL&keywords=keyword1,keyword2"

# Optimizacao conteudo on-page
curl "http://localhost:3000/content-optimization?url=URL"

# Internal linking structure
curl "http://localhost:3000/internal-linking?url=URL"

# Sitemap XML generator
curl "http://localhost:3000/sitemap-generator?url=URL"

# Analise concorrencia
curl "http://localhost:3000/competitor-analysis?url=URL&competitors=site1.com,site2.com"
```

## 2. Lighthouse MCP

| Tool | Funcao | Output |
|------|--------|--------|
| `run_audit(url)` | Auditoria completa | Performance, SEO, A11y, Best Practices |
| `get_performance_score(url)` | Score performance | 0-100 |
| `get_core_web_vitals(url)` | LCP, INP, CLS | Mobile + Desktop |
| `get_accessibility_score(url)` | Acessibilidade | 0-100 + issues |
| `get_seo_analysis(url)` | Analise SEO tecnico | Meta, headings, indexabilidade |
| `get_security_audit(url)` | Seguranca | HTTPS, mixed content, headers |
| `compare_mobile_desktop(url)` | Comparacao | Diferencas performance |
| `get_lcp_opportunities(url)` | Optimizacoes LCP | Preload, lazy load |
| `find_unused_javascript(url)` | JS nao usado | Tamanhos, % savings |

## 3. SEO Ahrefs MCP (via API)

| Tool | Funcao | Dados |
|------|--------|-------|
| `get_backlinks_list(domain)` | Lista backlinks | DR, UR, anchor text |
| `keyword_generator(keyword, country)` | Ideias keywords | Volume, KD, CPC |
| `get_traffic(domain)` | Trafego estimado | Visitas mensais, keywords |
| `keyword_difficulty(keyword)` | Dificuldade keyword | 0-100 (KD score) |

## 4. Google Search Console MCP

| Tool | Funcao | Dados Reais |
|------|--------|-------------|
| `list_properties` | Listar sites verificados | URLs properties |
| `get_search_analytics(site, period)` | Queries, cliques, CTR | Ultimos 16 meses |
| `inspect_url_enhanced(site, url)` | Inspeccionar URL | Indexacao, mobile usability |
| `check_indexing_issues(site, urls)` | Problemas indexacao | Erros, avisos |
| `get_sitemaps(site)` | Listar sitemaps | Status, URLs submetidos |

## 5. Google Analytics MCP

| Tool | Funcao | Metricas |
|------|--------|----------|
| `get_account_summaries` | Listar contas | Properties disponiveis |
| `run_report(property, metrics, dimensions)` | Relatorio custom | Sessions, users, bounce rate |
| `run_realtime_report(property)` | Tempo real | Utilizadores activos now |

## Propriedades GSC Disponiveis

```
sc-domain:descomplicar.pt
https://emanuelalmeida.pt/
https://carstuff.pt/
https://solarfvengenharia.com/
https://aquisevende.pt/
https://alojadamaria.com/
https://e-commerce.descomplicar.pt/
```

## Requisitos

- **SEO Tools API** deve estar a correr: `~/mcp-servers/seo-tools-api/start.sh`
- **GSC** requer autenticacao OAuth na primeira utilizacao
- **GA** requer ADC credentials configuradas (`gcloud auth application-default login`)

## Limitacoes

- Ahrefs API tem rate limiting (100 req/day free tier)
- GSC data maximo: 16 meses historico
- Lighthouse scores variam +/- 5 pontos entre execucoes (network dependent)
