Why an MCP server for this
Research and archiving
Turn a folder of saved pages into clean Markdown notes with a batch index, ready for a knowledge base or RAG corpus.
Table harvesting
Extract HTML tables from saved pages straight into an Excel workbook or a set of CSV files for analysis.
Link auditing
Export every link as JSON with relative URLs resolved to absolute, to check targets or build sitemaps offline.
Compliance and forensics
Process captured pages in an air-gapped environment where the agent is forbidden from making any outbound request.
What it does
- extract_page(input, output, mode) — parse one local .html/.htm:
allyields body Markdown,tablesexports XLSX (or a CSV directory),linksexports a link list as JSON. - extract_batch(input_dir, output_dir, ...) — process a whole directory, one sub-folder per page plus a
_batch_index.json; recursive option for nested folders. - Automatically strips script, style, noscript and SVG content; separates tables from body text.
- Relative links resolved to absolute using the page's
<base>tag or an explicit base_url. - Optionally retain JSON-LD / inline JS and add YAML frontmatter to Markdown output.
- Built on the standard-library HTMLParser (openpyxl only needed for XLSX). Never accesses the network; includes a selftest tool.
Install and connect
Published to the official MCP Registry as io.github.diyaluo/web-extract-mcp and as an OCI image on GHCR. Run locally over stdio:
pip install -e .
web_extract_mcp
Client configuration (Claude Desktop / Cursor / any MCP client):
{
"mcpServers": {
"web-extract": {
"command": "web_extract_mcp",
"env": {}
}
}
}
Frequently asked questions
What does this MCP server do?
It gives an MCP-compatible agent tools to parse locally saved HTML files: extract_page handles one file and can output Markdown text, spreadsheet tables or a link JSON, while extract_batch processes a whole directory with an index.
Does it crawl websites or fetch URLs?
No. It only parses .html/.htm files already saved on disk and never makes a network request, which makes it safe for offline and air-gapped environments.
How are tables exported?
With mode=tables, an .xlsx output path produces a workbook with multiple sheets; otherwise tables are written as CSV files into a directory.
How are relative links handled?
Relative href values are converted to absolute URLs using the page's base tag or a base_url argument you supply, so the exported link JSON is directly usable.
Which MCP clients are supported?
Any Model Context Protocol client over stdio, including Claude Desktop and Cursor. It is published to the official MCP Registry as io.github.diyaluo/web-extract-mcp and on GHCR.