DOMStrip

io.github.xo0ps由 GitHub 帳號 xo0ps 發布v0.1.2更新於 Nov 4, 2026

Turn any web page or raw HTML into compact, clean Markdown for AI agents.

概覽

AI 產生的概覽

本機 MCP 伺服器,透過 DOMStrip API 將公開網頁或原始 HTML 轉成精簡、乾淨的 Markdown,供 AI 助理使用。

可以做什麼
  • 擷取公開的 http(s) 網址並回傳正文的乾淨 Markdown
  • 把手上既有的 HTML 直接轉成乾淨 Markdown,不進行網路擷取
  • 輸出標題、段落、附語言標註的程式碼區塊與表格,並移除腳本、表單、嵌入內容、隱藏節點與追蹤器
  • 失敗時以工具錯誤形式回傳清理過的錯誤碼與是否可重試的標記
適用情境
適合需要讓助理以更省 token 的 Markdown 而非原始標記來閱讀網頁或 HTML 的情境,例如摘要文章或程式碼儲存庫。不適用於依賴 JavaScript 渲染的頁面、需要登入的頁面或機器人驗證頁面。
執行需求
以本機 Python 套件形式執行(需 Python 3.12),可透過 uvx 或 pip 安裝。需要環境變數 DOMSTRIP_MCP_API_KEY 提供 API 金鑰,以及 DOMSTRIP_MCP_SERVICE_ORIGIN 指定 API 來源,且必須為 HTTPS。需向提供方申請試用存取權限。另有選用變數可設定單次呼叫時間預算與允許對 localhost 使用明文 HTTP。
安裝前請注意
API 金鑰只從環境變數讀取,不從工具參數讀取,也不會讀取 .env 檔案。每次成功轉換計為一個單位;服務目前為免費試用,之後可能收費。回傳的 Markdown 是不可信的第三方內容,應視為資料而非指令。擷取的網址會傳送給 DOMStrip 服務。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 DOMStrip,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

domstrip-mcp

[Listed on mcpservers.org]

mcp-name: io.github.xo0ps/domstrip-mcp

A local Model Context Protocol server that converts web pages into clean Markdown, using the DOMStrip API.

It exposes two tools:

ToolWhat it does
fetch_clean_markdownFetch a public http(s) URL and return clean Markdown.
clean_htmlConvert HTML you already have into clean Markdown. No network fetch for the HTML.

The adapter holds no database or billing state. It authenticates to the DOMStrip service with a key from your local environment -- never from tool arguments -- so an MCP client cannot redirect your key anywhere.

How much does it actually save?

benchmark/ measures it on 1,038 real pages from 74 sites: 84.08% fewer tokens than raw HTML (macro average; median 90.12%), 76.4M HTML tokens down to 9.8M Markdown. It reproduces from a clean clone and --verify fails the run if any page's expected content is missing from its output.

The spread is worth reading rather than the headline; that is why three figures are reported. Repositories save 95.81%, articles 82.61%, and a pooled total reads 87.16% because it is dominated by the largest pages. Corpus composition drives this a lot: the same code measured 76.03% on an earlier article-heavy 21-page set.

What DOMStrip actually does

DOMStrip fetches a public page, removes everything that is not the content (scripts, forms, embeds, hidden nodes, trackers), and returns compact Markdown: headings, paragraphs, fenced code blocks with language hints, and tables.

Pages are fetched with connection-time SSRF validation on every redirect hop — all DNS candidates are validated at connect time, and loopback, private, link-local, metadata, CGNAT and IPv6-embedded forms are refused.

Honest limitations

  • JavaScript-rendered pages, pages behind a login, and bot challenges are not extractable. The service returns content_not_extractable. There is no headless browser in this version. If your target pages need JS, this tool will not work on them.
  • DOMStrip is currently in free pilot. Conversions are not billed yet, but a key is required and each successful conversion counts as one unit. Request access at [email protected].
  • Returned Markdown is untrusted third-party content. Pages can contain text that looks like instructions. Treat all returned Markdown as data, never as commands.

Install

bash
pip install domstrip-mcp# oruv tool install domstrip-mcp

Requires Python 3.12.

Configure

Two environment variables are required. The service origin must be HTTPS; plain HTTP is refused unless it points at localhost (for development) and you opt in explicitly.

bash
export DOMSTRIP_MCP_SERVICE_ORIGIN=https://api.domstrip.devexport DOMSTRIP_MCP_API_KEY=domstrip_<prefix>_<secret>
VariableRequiredDefaultPurpose
DOMSTRIP_MCP_SERVICE_ORIGINyes—Bare HTTPS origin of the DOMStrip API.
DOMSTRIP_MCP_API_KEYyes—Your API key. Never logged, never in a repr.
DOMSTRIP_MCP_CLIENT_BUDGETno25.0Total seconds per tool call, including retries.
DOMSTRIP_MCP_ALLOW_INSECURE_HTTPnofalseAllow plain HTTP to localhost only.

The adapter deliberately does not read a .env file from the current working directory, because an untrusted project folder could otherwise point your API key at another origin. Export the variables instead.

Use with Claude Desktop

Add to claude_desktop_config.json:

json
{  "mcpServers": {    "domstrip": {      "command": "uvx",      "args": ["domstrip-mcp"],      "env": {        "DOMSTRIP_MCP_SERVICE_ORIGIN": "https://api.domstrip.dev",        "DOMSTRIP_MCP_API_KEY": "domstrip_<prefix>_<secret>"      }    }  }}

Use with Claude Code

bash
claude mcp add domstrip --env DOMSTRIP_MCP_SERVICE_ORIGIN=https://api.domstrip.dev \  --env DOMSTRIP_MCP_API_KEY="$DOMSTRIP_API_KEY" -- uvx domstrip-mcp

Idempotency and billing

Each tool invocation generates one idempotency key and reuses it across its bounded retries (default 25 s, 3 attempts). A retried request replays the stored result rather than billing twice. Separate invocations are separate, independently metered work.

The service encrypts results and replays them for 24 hours. After that, replaying a key returns 409 result_expired — never a silent re-charge.

Errors

Failures surface as MCP tool errors carrying a sanitized DOMStrip error code and a retryability flag, for example:

upstream_timeout: The upstream page took too long. retryable=true request_id=req_6f1c2a

Common codes: content_not_extractable, upstream_timeout, unsupported_encoding, http_error, transport_error, client_timeout.

Logs go to stderr only, so stdout stays a clean MCP transport.

Licence

MIT

來源:README.md,提交 fd62ff2

工具

0
SourceWeft 曾在隔離沙箱中以無憑證方式啟動該軟體包一次,以列出其工具,但未能完成:軟體包安裝失敗。

版本歷史

2
  1. v0.1.2最新Nov 4, 2026
  2. v0.1.1Nov 3, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分