domdrift
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
domdrift
Structural HTML and JSON contract guard for scrapers and agents — separates HTTP 200 challenge pages (exit 3) from real layout changes (exit 2) and emits <2KB redacted repair snapshots.
uvx domdrift diff yesterday.html today.htmlSave a contract from a known-good response. Successful checks print nothing:
$ printf '<main><span class="price">$12</span></main>' > good.html
$ uvx domdrift init good.html --select 'price=main > .price' -o contract.json
$ uvx domdrift check -c contract.json good.html; echo $?
0
$ printf '<main><span class="sale-price">$10</span></main>' | uvx domdrift check -c contract.json --max-bytes 512 > repair.txt
$ echo $?
2
$ wc -c < repair.txt
256
$ cat repair.txt
DRIFT_DETECTED
violations: rule=price selector=main > .price reason=matched 0, need >= 1
survivors: selector=main count=1 broken=.price
candidates: selector=main > .sale-price count=1
candidates: selector=main > span count=1
<main>
<span.sale-price>
$ printf '<title>Just a moment...</title>' | uvx domdrift check -c contract.json
SOFT_BLOCK_DETECTED
Cloudflare: challenge page title. Keep existing selectors.
$ echo $?
3For an MCP client that launches local stdio servers:
{
"mcpServers": {
"domdrift": { "command": "uvx", "args": ["domdrift", "mcp"] }
}
}domdrift_init takes baseline content or a public URL. Pass its contract to domdrift_check with the next response. domdrift_diff compares two content strings directly. Check and diff return status, exit_code and report.
Installation
Run without installing via uv:
uvx domdrift --versionOr install into a persistent environment:
uv tool install domdrift
# or
pip install domdriftRequires Python 3.11+ and uses only the Python standard library (dependencies = []).
Related MCP server: websight
Contracts
init accepts a file path, an HTTP(S) URL or stdin. Without --select, it looks for landmarks, repeating HTML items and their fields, or infers JSON paths and types. Use --auto-landmarks to add automatic HTML rules to explicit selections.
uvx domdrift init catalog.json --select 'price=$.data.items[*].unit_price' -o catalog.contract
uvx domdrift check -c catalog.contract next.json --format json --max-bytes 1024HTML rules support min_count, max_count, min_non_empty_ratio, required_attr and a Python regex pattern on the attribute or visible text. CSS supports groups, descendant, child and sibling combinators, attribute operators, :not, :has, :contains, and first/last/nth-child. The parser works on supplied markup; it does not execute JavaScript.
JSON paths start at $ and use .key and [*]. Inferred rules record types, nullability, field presence, non-empty ratios and minimum array sizes. A check permits value changes that satisfy those rules. A snapshot diff also reports inventory additions, removals, count changes, moves between HTML containers and type changes in optional JSON fields.
Exit codes and limits
Code | Meaning |
0 | Contract holds, or no structural change in a diff. |
1 | Invalid arguments, contract or input, or a read error. |
2 | Structural drift. Inspect the surviving prefix, candidate and skeleton. |
3 | Likely challenge, access gate, rate limit or empty hydration shell. Keep the current selectors. |
Reports default to 2048 UTF-8 bytes. --max-bytes accepts budgets of 256 bytes or more. JSON output stays valid when details are trimmed. Evidence uses structural labels and JSON types rather than body text or JSON scalar values. Keep contracts from trusted sources: selectors and regexes are executable checks on incoming documents.
Input reads are capped at 10 MiB. URL connections use a 15-second socket timeout and check public addresses on each redirect and connection. --allow-private-net permits local HTTP fixtures on the CLI. MCP URL inputs always require public HTTP(S) addresses.
From a source checkout, run uv run domdrift --help. Python 3.11 or newer is required; the installed package uses only the standard library.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Semantic, structured or strict diffs of pages and documents, inline or from URLs.
Give agents eyes on any web page: structured context, and changes explained in plain language.
High-fidelity webpage screenshots, visual diffs, and Markdown extraction via MCP.
DNS, TLS, HTTP and SEO checks, plus stateful change watches that diff a page over time.
Related MCP Servers
- AlicenseAqualityAmaintenanceWeb content extraction for AI agents. 10 tools: scrape, crawl, map, batch, extract, summarize, diff, brand, search, research. Uses TLS fingerprinting to bypass anti-bot without a headless browser. Outputs LLM-optimized markdown with 67% fewer tokens than raw HTML.102,472AGPL 3.0
- AlicenseAqualityBmaintenanceEnables AI agents to see, analyze, and visually verify web page changes through pixel-perfect diffing, theme extraction, layout analysis, and interactive element detection.1MIT
- FlicenseNot gradedqualityCmaintenanceEnables monitoring of website changes through contracts, with automatic extraction, semantic diffing, and healing, triggering alerts and actions via email, Slack, or Telegram.-
- AlicenseAqualityCmaintenanceEnables agents to monitor websites for content changes with persistent baselines, durable notifications, and explicit review acknowledgement, using direct HTTPS fetches or isolated Playwright browser rendering for dynamic pages.4Apache 2.0