mcp-dom-extract
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-dom-extract Extract the price and title from https://example.com/product"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-dom-extract
MCP server that downloads a web page, parses its DOM and extracts precise data via CSS selectors, then returns the structured result (JSON) to the client.
Requirements
Node.js ≥ 20.18.1
Related MCP server: Ashra Structured Data Extractor MCP
Installation and development
npm install
npm run build # compiles src/ → dist/
npm run dev # runs the server in watch mode (tsx)
npm run smoke # end-to-end test against a local pageExposed tools
extract_data_from_url
Downloads a page and extracts values via CSS selectors.
Parameter | Type | Description |
| string | Absolute URL of the page |
| array | List of |
| number | Maximum length of each extracted value; longer values are truncated (default: 2000, cap: 100000) |
attribute: if set (e.g.href,src), returns the attribute value instead of the text.multiple: iftrue, returns an array of all matches.
extract_page_text
Downloads a page and returns its readable text, optionally scoped to a CSS
selector and truncated to max_length characters.
Parameter | Default | Description |
| — | Absolute URL of the page |
| — | CSS selector scoping the text; defaults to the whole document |
| 20000 | Maximum number of characters returned (cap: 100000) |
inspect_page_structure
Returns a condensed DOM outline — tags, ids, classes, truncated text
samples, repeated identical siblings aggregated (count + samples) — to pick
relevant selectors without loading the full page into the context.
Parameter | Default | Description |
| 200 | Maximum number of outline entries (cap: 500) |
| 40 | Maximum length of each sample (cap: 200) |
discover_selectors
The model describes what it is looking for with keywords; the server scans the DOM and returns candidate selectors whose text matches, with a sample. No full page enters the context.
{
"url": "https://example.com/product",
"targets": [
{ "name": "price", "keywords": ["19.99", "$", "price"] },
{ "name": "name", "keywords": ["Widget", "product"] }
]
}Parameter | Default | Description |
| — | Absolute URL of the page |
| — | List of |
| 5 | Maximum number of candidate selectors returned per target (cap: 10) |
probe_selectors
Checks selectors at low cost: for each, returns the number of matches and a sample of the first one, to refine before the final extraction.
Parameter | Type | Description |
| string | Absolute URL of the page |
| array | List of |
Recommended flow
discover_selectors(orinspect_page_structure) → candidate selectorsprobe_selectors→ verification and refinementextract_data_from_url→ final structured data
robots.txt compliance (RFC 9309)
Before each fetch, the server checks /robots.txt of the target origin and
applies the rules of the mcp-dom-extract group (or * if no specific group
exists). The cache is 24 h per origin, per the RFC.
404 / 4xx errors → access allowed (the file is "unavailable").
5xx / network / timeout errors → extraction blocked: the file is "unreachable", RFC 9309 requires a complete disallow. Unreachable states are re-checked after 5 minutes instead of being cached for 24 h.
Parsing limit of 512 KiB (the RFC requires at least 500 KiB).
crawl-delayis not supported (non-standard extension outside RFC 9309).
To disable the check (e.g. for internal test sites):
MCP_DOM_EXTRACT_IGNORE_ROBOTS=1 node dist/index.jsPage caching
Fetched pages are kept in an in-memory LRU cache, keyed by URL, so a
multi-step workflow (discover_selectors → probe_selectors →
extract_data_from_url) fetches each page once instead of once per tool
call. Cache entries expire after a TTL, the total size is bounded (oldest
entries are evicted first), errors are never cached, and concurrent requests
for the same URL share a single fetch.
Env var | Default | Description |
|
| How long a fetched page is reused before re-fetching |
|
| Total cache size limit; set to |
Client configuration
Claude Desktop standard (mcpServers)
This is the format used by Claude Desktop, Cherry Studio and most MCP clients (the emerging standard):
{
"mcpServers": {
"mcp-dom-extract": {
"command": "npx",
"args": ["-y", "--allow-git=all", "github:Llamatron2112/mcp-dom-extract"]
}
}
}Zed uses the same entry under the
mcp_serverskey instead.
Distribution from GitHub
For npx github:user/mcp-dom-extract to work without a build step on the
client side, the dist/ folder generated by npm run build must be
committed. The bin field of package.json points to dist/index.js.
Since npm 11.10+ (and by default in npm 12), installing packages directly from
Git is disabled for security reasons (EALLOWGIT). Pass --allow-git=all to
opt in:
npx -y --allow-git=all github:Llamatron2112/mcp-dom-extractKnown limitations
JavaScript-rendered pages (SPAs): client-side generated content is not visible without a headless browser (Playwright would be a future addition).
The sites' terms of use remain your responsibility: the server applies robots.txt, not ToS.
Page encoding is detected by cheerio; pages with exotic charsets may be decoded incorrectly.
Available Tools
5 toolsdiscover_selectorsA
Fetches a web page and finds CSS selectors for elements whose text matches the given keywords. The model describes what it is looking for with keywords; the server returns candidate selectors with short samples, without the full page entering the context.
Inputs: url (required), targets (required), max_candidates.
extract_data_from_urlB
Fetches a web page and extracts precise data from its DOM using CSS selectors.
Inputs: url (required), selectors (required), max_value_length.
extract_page_textB
Fetches a web page and returns its readable text, optionally scoped to a CSS selector.
Inputs: url (required), selector, max_length.
inspect_page_structureA
Fetches a web page and returns a condensed structural outline of its DOM (tags, ids, classes, short text samples, repeated siblings aggregated). Lets the model pick relevant CSS selectors without loading the full page into context.
Inputs: url (required), max_nodes, max_text_length.
probe_selectorsA
Fetches a web page and reports, for each CSS selector, how many elements match and a short sample of the first match. Use it to verify or refine candidate selectors cheaply.
Inputs: url (required), selectors (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Most tools have clear, distinct roles: structure inspection, selector discovery, selector probing, and extraction. The only slight overlap is between extract_data_from_url and extract_page_text, since both can retrieve content via CSS selectors, but the former emphasizes precise structured data while the latter focuses on readable text.
All tool names follow a consistent snake_case verb_noun pattern: extract_data, extract_page, inspect_page, discover_selectors, probe_selectors. The 'from_url' suffix on one tool is a minor variation but does not break the overall predictability.
Five tools is well-scoped for a DOM extraction server. Each tool represents a distinct step in the workflow of inspecting, discovering, probing, and extracting, with no redundancy or bloat.
The tool surface covers the full practical workflow for DOM extraction: inspect structure to understand the page, discover candidate selectors, probe selectors to verify them, then extract either precise data or readable text. There are no obvious dead ends or missing critical operations.
Maintenance
Related MCP Connectors
Turn any webpage into structured JSON with CSS-selector schemas - strings select text, attributes
Turn any website into structured JSON data matching your custom schema.
Fetch web pages and extract exactly the content you need. Select elements with CSS and retrieve co…
Static & headless web scraping, HTML-to-JSON extraction & compliance checks ($0.01-$0.05/call).
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables extracting data from websites using natural language prompts, allowing users to specify exactly what content they want in plain English and returning structured JSON data.35 npm8MIT
- -licenseNot gradedqualityCmaintenanceExtract structured data from any website with a simple SDK call. No scraping code, no headless browsers - just prompt and get JSON.62-
- FlicenseAqualityCmaintenanceEnables fetching, crawling, and analyzing web pages with 29 tools for SEO audits, content extraction, and more.29-
- AlicenseNot gradedqualityBmaintenanceEnables headless-Chromium web automation, including rendering fully-executed HTML, extracting structured data with CSS selectors, capturing screenshots, and AI-assisted smart scraping of web pages.293 npmMIT