Doruva SEO MCP
<p align="center">
<img src="https://raw.githubusercontent.com/doruva/doruva-seo-mcp/main/.github/assets/social-preview.png" alt="Doruva SEO MCP: SEO tools for AI assistants" width="100%">
</p>
# Doruva SEO MCP
[](https://pypi.org/project/doruva-seo-mcp/)
[](https://pypi.org/project/doruva-seo-mcp/)
[](LICENSE)
[](https://github.com/doruva/doruva-seo-mcp/actions/workflows/test.yml)
<!-- mcp-name: io.github.doruva/doruva-seo-mcp -->
An open-source [Model Context Protocol](https://modelcontextprotocol.io) server that gives AI assistants
real SEO analysis tools: on-page audits, a polite site crawler, structured data validation, robots.txt and
sitemap checks, redirect tracing, PageSpeed Insights and Google Search Console.
It works with any client that speaks MCP over stdio: Claude Desktop, Claude Code, Codex, Cursor, VS Code,
Windsurf, Zed and others. Ask your assistant things like *"audit https://example.com/pricing and tell me what
to fix first"* or *"crawl my site and list broken internal links with the pages that link to them"*.
Made by [Doruva](https://doruva.com), who also make free tools for agencies: the Doruva SEO WordPress plugin
and the Doruva SEO Inspector browser extension.
- Free and open source (GPL-2.0-or-later), no account, no telemetry.
- Honest user agent: `DoruvaSEO-MCP/1.0.0 (+https://github.com/doruva/doruva-seo-mcp)`.
- Safe by default: SSRF protection, size and time limits, robots.txt respected by the crawler.
> **Static HTML only.** Pages are analysed as delivered by the server. JavaScript is never executed, so
> content that is rendered client-side is not seen. For JavaScript-heavy sites, compare with Google's
> URL Inspection (the `gsc_inspect_url` tool) or a rendering crawler.
## Tools
| Tool | What it does |
| --- | --- |
| `audit_page(url)` | On-page report: status, redirect chain, response time, title and meta description with length and estimated pixel width, canonical, meta robots / X-Robots-Tag, robots.txt verdict, lang, hreflang, viewport, H1-H6 outline, word count, Open Graph / Twitter tags, link counts, images missing alt, JSON-LD types, an indexability verdict and a prioritised issue list with fix hints. |
| `crawl_site(start_url, max_pages=50, max_depth=3, same_host_only=True)` | Polite crawler (robots.txt, 4 parallel requests, delay, time budget, hard cap 500 pages). Per-URL summaries plus broken internal links with source pages, redirect chains, duplicate titles/descriptions, missing H1, noindex pages, canonical mismatches, orphan candidates (in the sitemap only) and indexable pages missing from the sitemap. |
| `validate_schema(url=None, json_ld=None)` | Extracts JSON-LD (including `@graph`), reports parse errors with line/column and checks required/recommended properties for Article, Product/Offer/AggregateRating, Organization, LocalBusiness, BreadcrumbList, FAQPage, HowTo, Event, Recipe, VideoObject, JobPosting and SoftwareApplication. Returns the Rich Results Test link. |
| `check_robots(url, user_agent="Googlebot")` | RFC 9309 / Google matching: most specific group, longest match, Allow wins ties, `*` and `$` wildcards; 4xx = allow-all, 5xx/429 = disallow-all. Returns the matched rule and listed sitemaps. |
| `check_sitemap(url, sample_size=20)` | Discovers sitemaps (robots.txt, `/sitemap.xml`, `/sitemap_index.xml`, `/wp-sitemap.xml`), parses indexes, urlsets and gzip, counts URLs, lastmod stats, and samples URLs for non-200, noindex and canonicalised entries. Flags other-host and robots-blocked URLs. |
| `check_redirects(url, check_variants=True)` | Full redirect chain with status codes and timings, loop detection, and http/https + www/non-www consistency. |
| `pagespeed(url, strategy="mobile")` | Google PageSpeed Insights v5: performance score, Core Web Vitals field data (LCP, INP, CLS), lab metrics and top opportunities. |
| `gsc_list_sites()` | Search Console properties available to your credentials. |
| `gsc_search_analytics(site_url, start_date, end_date, dimensions=["query"], row_limit=100, filters=None)` | Clicks, impressions, CTR and position by query, page, country, device, date. |
| `gsc_inspect_url(site_url, url)` | URL Inspection API: index status, coverage, Google-selected canonical, rich results, mobile usability. |
| `gsc_sitemaps(site_url)` | Submitted sitemaps with errors and warnings. |
All tools return structured JSON. Errors come back as `{"error": "..."}` rather than exceptions.
**Prompts:** `technical_seo_audit(domain)` (a step-by-step audit using every tool), `schema_review(url)`
and `page_review(url, keyword)`.
**Resource:** `doruva://seo-checklist`, a short technical SEO checklist.
### Example
```text
You: Audit https://wordpress.org/ and summarise the top issues.
Assistant -> audit_page({"url": "https://wordpress.org/"})
<- {"status": 200, "title": {"text": "Blog Tool, Publishing Platform, and CMS | WordPress.org",
"length": 55, "pixel_width": 512, "max_pixel_width": 580},
"canonical": {"status": "self", "href": "https://wordpress.org/"},
"indexability": {"indexable": true, "reasons": [], "notes": []},
"issues": [{"severity": "warning", "code": "description_multiple",
"message": "2 meta descriptions found.", "fix": "Keep one meta description."}, ...],
"summary": {"errors": 0, "warnings": 2, "notices": 0}, ...}
```
More things to ask:
- "Is `/wp-admin/` blocked for GPTBot on example.com?" (`check_robots`)
- "Check example.com's sitemap and tell me which URLs return redirects or are noindex." (`check_sitemap`)
- "Do http://, https://, www and non-www all end up on one URL?" (`check_redirects`)
- "Validate this JSON-LD for a Product rich result: `{...}`" (`validate_schema`)
- "Top 20 queries for sc-domain:example.com in the last 28 days with CTR under 2 %." (`gsc_search_analytics`)
## Install
You need [uv](https://docs.astral.sh/uv/getting-started/installation/). `uvx` downloads and runs the server
in an isolated environment; there is nothing else to install.
```bash
uvx doruva-seo-mcp --version
```
### Claude Desktop
Edit `claude_desktop_config.json` (Settings > Developer > Edit Config):
```json
{
"mcpServers": {
"doruva-seo": {
"command": "uvx",
"args": ["doruva-seo-mcp"],
"env": {
"PAGESPEED_API_KEY": "optional-google-api-key",
"DORUVA_GSC_CREDENTIALS": "/path/to/service-account.json"
}
}
}
}
```
If Claude Desktop cannot find `uvx`, use its full path (`which uvx` on macOS/Linux, `where uvx` on Windows,
for example `C:\\Users\\you\\.local\\bin\\uvx.exe`).
### Claude Code
```bash
claude mcp add doruva-seo -- uvx doruva-seo-mcp
# with environment variables, available in every project:
claude mcp add doruva-seo --scope user -e PAGESPEED_API_KEY=your-key -- uvx doruva-seo-mcp
```
### Codex
`~/.codex/config.toml`:
```toml
[mcp_servers.doruva-seo]
command = "uvx"
args = ["doruva-seo-mcp"]
# crawls and PageSpeed runs can take a while
tool_timeout_sec = 300
[mcp_servers.doruva-seo.env]
PAGESPEED_API_KEY = "optional-google-api-key"
```
Or: `codex mcp add doruva-seo -- uvx doruva-seo-mcp`
### Cursor
`~/.cursor/mcp.json` (global) or `.cursor/mcp.json` (project):
```json
{
"mcpServers": {
"doruva-seo": {
"command": "uvx",
"args": ["doruva-seo-mcp"]
}
}
}
```
### VS Code
`.vscode/mcp.json` in your workspace (or run *MCP: Add Server* from the command palette):
```json
{
"servers": {
"doruva-seo": {
"type": "stdio",
"command": "uvx",
"args": ["doruva-seo-mcp"]
}
}
}
```
### Other clients
Any MCP client that can launch a stdio server works: the command is `uvx` with the argument
`doruva-seo-mcp`. You can also `pip install doruva-seo-mcp` and run `doruva-seo-mcp`.
## Google Search Console setup
The `gsc_*` tools are optional. Without credentials they return setup instructions instead of failing.
1. In the [Google Cloud Console](https://console.cloud.google.com/) create (or pick) a project.
2. Enable the **Google Search Console API** (APIs & Services > Library).
3. Create a **service account** (IAM & Admin > Service Accounts), open it, go to *Keys* > *Add key* >
*JSON* and download the key file. Keep it private.
4. In [Search Console](https://search.google.com/search-console), for each property open
*Settings* > *Users and permissions* > *Add user*, paste the service account e-mail
(`name@project.iam.gserviceaccount.com`) and give it *Restricted* (read) or *Full* permission.
5. Point the server at the key with `DORUVA_GSC_CREDENTIALS` (or `GOOGLE_APPLICATION_CREDENTIALS`) in your
client's `env` block, then restart the client.
Use `sc-domain:example.com` for domain properties and `https://www.example.com/` (with the trailing slash)
for URL-prefix properties.
**OAuth instead of a service account:** set `DORUVA_GSC_CLIENT_ID`, `DORUVA_GSC_CLIENT_SECRET` and
`DORUVA_GSC_REFRESH_TOKEN` (an OAuth client of type *Desktop* and a refresh token with the
`https://www.googleapis.com/auth/webmasters.readonly` scope). An `authorized_user` JSON file created by
`gcloud auth application-default login --scopes=...webmasters.readonly` also works as
`DORUVA_GSC_CREDENTIALS`.
The server only requests the read-only Search Console scope.
## Environment variables
| Variable | Purpose |
| --- | --- |
| `PAGESPEED_API_KEY` | Optional Google API key for PageSpeed Insights (higher quota than anonymous use). |
| `DORUVA_GSC_CREDENTIALS` | Path to a service account JSON key (or the JSON itself) for Search Console. |
| `GOOGLE_APPLICATION_CREDENTIALS` | Used when `DORUVA_GSC_CREDENTIALS` is not set. |
| `DORUVA_GSC_CLIENT_ID`, `DORUVA_GSC_CLIENT_SECRET`, `DORUVA_GSC_REFRESH_TOKEN` | OAuth refresh-token alternative. |
| `DORUVA_SEO_ALLOW_PRIVATE` | Set to `1` to allow private and loopback addresses, for auditing local development sites. Cloud metadata addresses stay blocked. |
## Safety and limits
An AI agent may call these tools with any URL, so the server is defensive:
- Only `http` and `https` URLs. Host names are resolved and every address is checked; private, loopback,
link-local, multicast, reserved and cloud metadata ranges are refused, for IPv4 and IPv6 (including
IPv4-mapped, 6to4, NAT64 and decimal/hex/octal IPv4 forms). The check runs in the connection layer and the
socket connects to the checked address, so every redirect hop is re-checked and DNS rebinding does not work.
- At most 10 redirects; 5 MB per HTML page, 50 MB per (uncompressed) sitemap with gzip bomb protection;
connect/read timeouts and a 60-second limit per fetch.
- Crawls: at most 500 pages, depth 10 and 300 seconds, whatever the parameters say; 4 parallel requests, a
delay after each request, `Crawl-delay` honoured up to 5 seconds, automatic back-off on 429/503.
- Sitemap XML with DOCTYPE/ENTITY declarations is refused.
- Logs go to stderr only; stdout carries the MCP protocol.
## Privacy
No telemetry, no analytics, no accounts. Network requests go only to the sites you ask about and, when you
call those tools, to Google's PageSpeed Insights and Search Console APIs. See [PRIVACY.md](PRIVACY.md).
## Development
```bash
git clone https://github.com/doruva/doruva-seo-mcp
cd doruva-seo-mcp
uv sync # creates .venv with dev dependencies
uv run pytest # unit, integration (local fixture server) and live tests
uv run pytest -m "not live" # skip tests that need the internet
uv run ruff check .
uv build # sdist and wheel in dist/
```
Try the server with the MCP Inspector (needs Node.js): `npx @modelcontextprotocol/inspector uv run doruva-seo-mcp`.
The banner is generated with `.github/assets/make_banner.py` (Pillow).
## License
GPL-2.0-or-later. Copyright (C) Doruva. See [LICENSE](LICENSE).
TDQS
Scored across 11 tools
Tools are mostly distinct: audit_page vs. crawl_site differ by scope, and the check_* tools clearly target robots.txt, sitemaps, and redirects. Minor overlap exists between audit_page and validate_schema (JSON-LD reporting) and between audit_page/crawl_site and check_robots (robots verdicts), but descriptions make the intended division reasonably clear.
Most tools follow a snake_case verb_noun pattern (audit_page, crawl_site, check_robots, gsc_inspect_url, gsc_list_sites). A few deviate with noun-only names (pagespeed, gsc_sitemaps), but the gsc_ prefix groups Search Console tools predictably, so the set remains readable and mostly consistent.
At 11 tools, the server is well-scoped for technical SEO work. Each tool covers a distinct workflow area (page audit, crawl, schema, GSC, robots, sitemap, redirects, PageSpeed) without redundant entries.
The technical SEO surface is strong: on-page auditing, site crawling, structured data validation, Search Console data, robots/sitemap/redirect checks, and PageSpeed are all covered. Obvious adjacent gaps remain (backlink analysis, rank tracking, sitemap submission), but core technical audit workflows are largely complete.