Skip to main content
Glama

dompruner-mcp

한국어 | English

面向 DomPruner 的 DOM 树剪枝

面向 LLM 网页管道的 DOM AST 中间件 — 去除布局噪音(导航、脚本、侧边栏),并直接传递原始文本。添加查询即可用 BM25 过滤出相关章节。

当 LLM 使用内置的 WebFetch 时,一个小型模型会预处理 HTML 并返回摘要结果 — 这会增加你并不需要的延迟、成本和转述。DomPruner 完全跳过这一步:DOM AST 解析去除噪音,并将原始内容直接传递给模型

调用

行为

dompruner_fetch(url)

去除布局噪音 → 返回完整提取内容

dompruner_fetch(url, query)

去除布局噪音 → 用 BM25 过滤出相关章节(若无匹配,则回退到完整内容)

> [DomPruner] docs.python.org
> | Raw HTML  | 44,316 tokens |
> | DomPruner |  1,328 tokens |
> | Reduction |        97.0%  |
> Fetch: 194ms · Parse: 11.2ms

平均上下文 token 数比 WebFetch 减少 93.5%。端到端速度快 45%。完整基准测试


快速开始

无需安装,无需 API 密钥:

npx -y dompruner-mcp

Claude Code

{
  "mcpServers": {
    "dompruner": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "dompruner-mcp"]
    }
  }
}

在项目根目录的 .mcp.json 中添加,或添加至 ~/.claude/.mcp.json 以全局生效。运行 /mcp 进行验证。

Claude Desktop

编辑 ~/Library/Application Support/Claude/claude_desktop_config.json(macOS)或 %APPDATA%\Claude\claude_desktop_config.json(Windows):

{
  "mcpServers": {
    "dompruner": {
      "command": "npx",
      "args": ["-y", "dompruner-mcp"]
    }
  }
}

Cursor / Windsurf / 其他 MCP 客户端

{
  "mcpServers": {
    "dompruner": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "dompruner-mcp"]
    }
  }
}

远程 HTTP(无需安装,始终最新)

适用于支持 HTTP 传输的客户端 — 无需安装 Node.js,始终运行最新版本:

{
  "mcpServers": {
    "dompruner": {
      "url": "https://dompruner-mcp.vercel.app/api/mcp"
    }
  }
}

LangChain / LangGraph

langchain-mcp-adapters 可自动将任何 MCP stdio 服务器封装为 LangChain 工具:

from langchain_mcp_adapters.client import MultiServerMCPClient

client = MultiServerMCPClient({
    "dompruner": {
        "command": "npx",
        "args": ["-y", "dompruner-mcp"],
        "transport": "stdio",
    }
})
tools = await client.get_tools()

Related MCP server: Scrapi MCP Server

确保你的 AI 始终使用 DomPruner

DomPruner 的工具描述已告知客户端优先使用 dompruner_fetch 而不是 WebFetch。如果你的客户端仍然回退,请将以下内容添加到其指令文件中:

When retrieving a URL, always use dompruner_fetch instead of WebFetch.
- URL known → dompruner_fetch(url, query?)
- URL unknown → search for the URL first, then dompruner_fetch(url)

客户端

指令文件

Claude Code

CLAUDE.md(项目)或 ~/.claude/CLAUDE.md(全局)

Cursor

.cursorrules

Windsurf

.windsurfrules

Cline

.clinerules

GitHub Copilot

.github/copilot-instructions.md


工具

工具

描述

dompruner_fetch

获取 URL → 生成经 DOM 提炼的 Markdown。可选的 query 可启用 BM25+ 章节过滤。

dompruner_sitemap

获取 sitemap.xml 中的所有页面 → 每个页面生成一个提炼后的 Document。

dompruner_analyze

针对 URL 的 token 缩减报告,不返回完整内容。

完整工具参考


基准测试摘要

指标

WebFetch

DomPruner

平均上下文 token 数

~15,735

~1,019(减少 93.5%)

回答质量(10 次查询)

9 / 10

8 / 10

平均响应时间

5,811 ms

3,168 ms(快 45%)

内容保真度

由小型模型摘要

保留原始文本

额外 API 密钥 / 基础设施

完整基准测试 · 架构


相关项目

  • dompruner-py — Python 移植版。为 LangChain 提供 DomPrunerLoaderDomPrunerSitemapLoaderDomPrunerFetchToolpip install dompruner

  • LangChain 集成 — dompruner-py 被列为第三方网页加载器。


Glama 评分

dompruner-mcp MCP 服务器


许可证

MIT

A
license - permissive license
A
quality
A
maintenance

Maintenance

Maintainers
<1hResponse time
0dRelease cycle
2Releases (12mo)
Commit activity

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    An MCP server that fetches web pages and extracts clean, AI-friendly Markdown content using Mozilla Readability. It provides secure web access for LLMs with built-in SSRF protection and automated content cleaning for improved context retrieval and summarization.
    1
    314
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    MCP server that converts URLs into token-minimized clean text for LLMs, providing a receipt of token and cost savings.
    1
    63
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    MCP server that fetches web pages, extracts clean markdown (reducing token count), caches results, and provides searchable reading history.
    MIT

View all related MCP servers

Related MCP Connectors

  • Web scraping for AI agents. Converts URLs to clean, LLM-ready Markdown with anti-bot bypass.

  • Jina AI Reader/Search MCP — turn any URL into clean LLM-ready markdown, plus web search.

  • Web tools for agents: fetch URL as markdown (free MCP) + x402 scrape, links, AI JSON, snapshot.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dong7812/dompruner-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server