Web Validator by DigestSEO
[npm version]
[CI]
[License: MIT]
[Indexed on TensorBlock MCP Index]
[mcp-web-validator MCP server]
An MCP server for HTML and CSS validation, technical SEO and accessibility checks, JSON-LD syntax validation, broken-link checks, and responsive screenshots. It is part of the DigestSEO suite of open-source SEO tools.
Choose the right surface
This repository contains two deliberately separate MCP surfaces:
Local installation:
Hosted endpoint:
Requirements
- Node.js 22.12.0 or newer
- An MCP client that supports stdio, or a client that supports Streamable HTTP for the hosted endpoint
The validation, SEO, schema, link, and report tools do not download a browser during installation. The local screenshot.capture tool installs its pinned headless browser into Puppeteer's cache on first use, then reuses that browser for later screenshots. Set PUPPETEER_CACHE_DIR if you need a custom cache location.
Tools
Large results: MCP structured diagnostic previews are bounded by serialized byte size. Exact totals and severity counts remain available, and truncated indicates omitted previews. links.broken also returns totalLinks. Extremely large report.validation results use a condensed Markdown summary instead of oversized tables; the score and check-status values still reflect the full audit.
The npm package exposes these exact runtime tool names:
Different links that differ only by query parameters may therefore appear under the same displayed URL. Do not submit private tokens in HTML or URL inputs.
For direct Node.js integrations, auditSeoMetadata(html, xRobotsTag) and
auditSeoMetadataDetailed(html, xRobotsTag) from dist/seo-auditor.js accept
an optional caller-observed X-Robots-Tag HTTP response-header value. Separate
multiple header fields with newlines. This inspection is offline and never
fetches headers; the MCP seo.metadata tool still analyzes supplied HTML only.
Hosted app tools
The hosted app exposes the tools below in its proposed source code (deployed catalog may differ):
audit_public_webpage follows at most three validated redirects, accepts a bounded text/html response, and records the final URL. It does not crawl additional pages, execute JavaScript, authenticate, or fetch linked stylesheets and assets. audit_public_site first locks the final public origin, then reads bounded robots.txt plus same-origin XML Sitemap, RSS 2.0, Atom 1.0, and plain-text sitemap representations before auditing at most eight eligible sitemap pages in one call. Robots discovery may follow up to five validated public redirects across authorities, as defined by the robots protocol; the resulting rules and relative Sitemap directives are still interpreted for the originally audited authority. Sitemap entries and audited pages remain same-origin, and private/reserved destinations, credentials, custom ports, service self-fetches, and HTTPS-to-HTTP redirect downgrades are rejected. The tool never follows HTML links or external sitemap entries; use page_offset when the response says more eligible pages remain. The fetched HTML is sent to https://html5.validator.nu/, the same external Nu HTML Checker used by validate_html and the report tool. CSS parsing, SEO analysis, and JSON-LD parsing run inside the DigestSEO Worker. Optional link checks make capped HEAD requests, with a bounded GET fallback where necessary, to eligible public HTTP(S) URLs; link redirects are reported but not followed. The site tool intentionally does not perform site-wide link checking. The hosted app does not retain tool inputs, fetched HTML, or results.
Sampled indexability evidence graph
The hosted audit_public_site result now includes per-page indexability static signals (canonical state/target, an observed noindex directive, bounded page title, and bounded hreflang declarations) and a new indexability_graph section. Findings are derived only from the HTML/headers already requested by the site audit: zero additional page requests, no JavaScript execution, no stored audit history, and no extra recipients.
The graph identifies evidence-supported canonical cycles and chains between sampled pages, sampled sitemap URLs observed with noindex, sampled canonicals pointing to other sampled noindex pages, potential duplicate titles for distinct canonical destinations, and missing sampled hreflang return links. coverage_limited and limitations explain why partial results cannot establish a site-wide pass.
A cross-page finding is not proof of deindexing, Google's selected canonical, a search ranking signal, or a traffic-change cause. Query-bearing/credentialed canonical and alternate URLs are not echoed and are excluded from cross-page assertions rather than incorrectly normalized to a different page. The graph does not follow canonical or hreflang links: targets must already be inside the bounded audited sample.
Before/after site regression checks
- Run
audit_public_site on an authorized website and preserve the returned structured result as a baseline.
- After a release or repair, rerun
audit_public_site using the same website and page-selection settings. If continuing paginated audits, use the fingerprint supplied by that run; do not reuse a stale continuation.
- Pass both structured results to
compare_site_audits as baseline and current. Check status, page_changes, limitations, and issue_group_comparison_available before deciding whether a change is safe.
The comparison never fetches pages or keeps audit history. It separately reports failures and incomplete coverage. When both snapshots contain the same fully checked selected URLs and the same discovery fingerprint, grouped findings may be compared within that sample, even if the whole sitemap was not audited; this is not a verified site-wide fix. It cannot determine Google indexing or ranking changes, prove why traffic changed, or replace a complete accessibility audit. The health_score_delta is a heuristic within this tool, not a Google ranking metric.
Optional local history: maximum 10 versions
The hosted app deliberately retains nothing. If you use the local npm/stdio MCP, audit.history can save the JSON structuredContent from audit_public_site on your own computer. Choose action: "save" and supply snapshotJson as a JSON string; use list to see saved version IDs and get with an ID to retrieve its compact JSON. You can then pass two retrieved snapshots to compare_site_audits. Saving is always opt-in; audits do not silently create history.
For multi-version comparisons use local audit.trends with 2–10 existing saved ids in oldest-to-newest order. It reads the current local archive once and never changes it. The hosted compare_historical_audits accepts 2–10 {saved_at, snapshot} objects supplied by the caller instead (the Worker has no persisted history). Both use the same M05 pure analyzer, limit conclusions to identically observed completed pages, and report coverage gaps separately. See docs/p2-01-historical-comparisons.md.
For gradual regression-monitor testing, invoke local audit.monitor with the same existing saved ids (oldest first) or hosted preview_regression_alerts with supplied versions. Set dry_run: true (the only supported mode) and optionally configure min_regressed_pages, min_net_error_increase, min_net_warning_increase, consecutive_regressing_steps and review-only coverage/discovery thresholds. This creates unsent alert previews only: no scheduler, background monitoring, notifications, email, webhooks, or external data adapters are present. See docs/p2-02-manual-regression-alert-preview.md.
One compact audit-history.json file lives at ~/.mcp-validator/audit-history.json; when MCP_WEB_VALIDATOR_WORKSPACE_ROOT is configured, the file instead lives in that root's .mcp-validator/ directory. It stores up to 10 total versions, newest first when listed. Saving the eleventh automatically deletes the oldest. Each source snapshot is limited to 60 KB and is reduced to comparison-relevant fields (no raw HTML, browser screenshots, widget state, or full indexability graph). The history file has a 660 KB cap. There are no database services, background processes, or network calls. Files stay on the user's computer and are readable only with local filesystem access.
Security: Do not save secrets in page diagnostics. URL fields containing query strings, credentials, or fragments are rejected; audit-history file symlinks and oversized or corrupt files fail closed. Concurrent saves from one local process are serialized. Separate concurrently running MCP processes should use separate workspace roots to avoid writing the same file.
Test the storage boundary
Run npm test to exercise the local history implementation through a real stdio MCP client: saving 11 versions, evicting only the oldest, retrieving a snapshot after the MCP process restarts, and isolating two different workspace roots. The hosted Worker test suite separately verifies that multiple ChatGPT-style HTTP clients can connect with no session cookie, that comparisons stay request-local, and that the hosted tool list does not expose audit.history.
Run npm run smoke:hosted to verify the actually deployed public MCP endpoint using read-only initialize, tools/list, and one offline JSON-LD check. This intentionally makes three small requests to the live service and does not crawl websites or save data. It fails if deployment still exposes an older tool catalog, even when repository CI is green. An HTTPS preview URL can be selected with MCP_WEB_VALIDATOR_HOSTED_URL. Do not mistake green source tests for a published deployment.
For a separately opt-in live cross-surface smoke test, from a repository checkout with dependencies installed, set MCP_AUDIT_TARGET_URL to the HTTPS root of a site you own or are authorized to inspect and run npm run smoke:interop. For example, in PowerShell: $env:MCP_AUDIT_TARGET_URL = 'https://digestseo.com/' followed by npm run smoke:interop. This makes one bounded, single-page hosted audit_public_site call, then checks local audit.history save/get and hosted compare_site_audits against the same snapshot. It saves only into a disposable temporary directory, cleans it up, and never creates cloud storage. Set MCP_WEB_VALIDATOR_LOCAL_ENTRYPOINT to an absolute path to test a separate installed stdio package rather than the repository build. A partial audit remains partial: the script reports validator coverage instead of claiming a site-wide clean bill of health. This check contacts the public site and W3C validator, so it is not run by CI automatically.
Local history is not a per-user cloud history system. ChatGPT users invoking the hosted MCP cannot retrieve local snapshots; cloud-side per-user persistence would require separately implemented authentication and storage. These tests prove the existing stateless architecture, not that unimplemented feature.
Privacy Policy
Only validate files, markup, and public webpages that you own or are authorized to inspect. Public page URLs can contain sensitive query values, so remove tokens and private identifiers before submitting them. Do not submit passwords, API keys, access tokens, payment data, health data, private source code, or other sensitive personal data.
The local server runs with the same operating-system permissions as its MCP client. Review tool inputs before approving file access, outbound validation, link checking, or screenshot creation. The hosted app has no access to your local filesystem.
For tighter local-file validation scope, optionally set MCP_WEB_VALIDATOR_WORKSPACE_ROOT to an absolute directory path in the local MCP server's environment. When set, html.local, css.local, local-file inputs to report.validation, and local screenshot targetPath accept only files whose resolved paths (including symlinks) stay within that directory. Screenshot outputDir must also remain within the resolved root, including when creating a new nested directory or following an existing symlink. Screenshots write PNG bytes through an exclusive open temporary sibling file before replacing the final filename, so an existing hard link or symlink cannot redirect the image write. Without this setting, the documented user-selected local-file and screenshot destination behavior is unchanged. This is a defense against unintended tool arguments, not an isolation boundary against a malicious local process concurrently changing filesystem paths.
See the published privacy policy for data-handling details and SECURITY.md for private vulnerability reporting.
Configure a local client
Claude Desktop
Add the server to claude_desktop_config.json:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
Restart Claude Desktop after saving the configuration.
Cursor and compatible clients
Create a command/stdio MCP server with:
This repository also includes a Cursor Marketplace plugin manifest. After the
plugin is published, install Web Validator by DigestSEO from Cursor's
Marketplace or add the repository from Cursor's plugin UI. The plugin bundles
the same local stdio server and does not require API keys or environment
variables.
Visual Studio Code with GitHub Copilot
In VS Code, run MCP: Add Server from the Command Palette and choose Command
(stdio) with npx -y mcp-web-validator. Or add the following to your own
workspace's .vscode/mcp.json (VS Code format):
For a remote-only connection, use this server entry instead (no local Node.js
required, but local-file and screenshot tools are unavailable):
Open MCP: List Servers to start/check the connection. In Copilot Agent
chat, ask it to run seo.metadata on an HTML snippet you provide (input field
htmlContent) and report its metadata issues. This is an offline, no-network
smoke test of the local stdio server; it should return structured issues and
totalIssues without contacting W3C or fetching a webpage. Use the local
server for this check, since the hosted surface has different tool names.
The repository also contains a portable root .mcp.json for compatible
Copilot harness clients. Its top-level key is mcpServers, not servers;
do not copy that object unchanged into .vscode/mcp.json. VS Code's
MCP configuration reference
explains the file formats and supported scopes. Review tool permissions before
allowing outbound validation or filesystem-writing screenshot calls.
OpenAI Codex
Codex CLI can add the published local stdio package directly:
Or add the existing hosted Streamable HTTP surface instead:
Verify either configuration with:
The local package includes workspace-file validation and responsive screenshot
capture. The hosted surface is remote-only and cannot access local files or
create screenshots.
Gemini CLI
Gemini CLI supports local stdio MCP servers. Add the published package with:
This writes the server definition to Gemini CLI's MCP configuration. No API
keys or environment variables are required by Web Validator.
GitHub Copilot CLI
Add the published local stdio server with:
When Copilot CLI is started inside a clone of this repository, it can also
discover the checked-in root .mcp.json, which already points
mcp-web-validator at npx -y mcp-web-validator.
Kiro
[Add to Kiro]
This installs the local stdio package, preserving its workspace-file and screenshot capabilities. Node.js 22.12.0+ is required.
Development
Optional safe update-on-activation for local source builds
The normal npx -y mcp-web-validator setup runs the published npm version;
merging GitHub changes does not publish them or refresh an already-running MCP.
For a trusted personal development setup that should pick up new main commits
at the next start, see safe activation.
It uses an isolated cache, rebuilds and smoke-tests each new revision, and
retains the last verified build when offline or when a new build fails. It does
not restart running sessions, change other Git worktrees, publish npm, deploy
the hosted Worker, or submit an OpenAI Platform release.
Clone the repository and install the locked dependencies:
Run the local quality gates:
Run the local stdio server:
Validate the hosted Worker separately:
See CONTRIBUTING.md for contribution expectations. Deployment and marketplace-review notes live in chatgpt-plugin/SUBMISSION.md.
For agent-assisted installation, see llms-install.md.
For a copy-ready, zero-paid-provider GitHub Actions metadata gate, see examples/github-actions.
Ecosystem
[LightNow capabilities]
License
Licensed under the MIT License.