{
  "markdown": "# dompruner-mcp\n\n[한국어](./README.ko.md) | English\n\n![DOM Tree Pruning for DomPruner](assets/banner.png)\n\n> DOM AST middleware for LLM web pipelines — strips layout noise (nav, scripts, sidebars) and passes original text directly. Add a query to filter to relevant sections with BM25.\n\nWhen an LLM uses the built-in WebFetch, a smaller model pre-processes the HTML and hands back a summarized result — adding latency, cost, and interpretation you didn't ask for. DomPruner skips that entirely: DOM AST parsing strips noise and passes the **original content directly to the model**.\n\n| Call | Behavior |\n|---|---|\n| `dompruner_fetch(url)` | Strips layout noise → returns full extracted content |\n| `dompruner_fetch(url, query)` | Strips layout noise → BM25 filters to relevant sections (falls back to full content if no match) |\n\n```\n> [DomPruner] docs.python.org\n> | Raw HTML  | 44,316 tokens |\n> | DomPruner |  1,328 tokens |\n> | Reduction |        97.0%  |\n> Fetch: 194ms · Parse: 11.2ms\n```\n\n**93.5% fewer context tokens than WebFetch on average. 45% faster end-to-end.**\n→ [Full benchmark](https://github.com/dong7812/dompruner-mcp/blob/main/docs/benchmark.md)\n\n---\n\n## Quick Start\n\nNo installation, no API key:\n\n```bash\nnpx -y dompruner-mcp\n```\n\n### Claude Code\n\n```json\n{\n  \"mcpServers\": {\n    \"dompruner\": {\n      \"type\": \"stdio\",\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"dompruner-mcp\"]\n    }\n  }\n}\n```\n\nAdd to `.mcp.json` in your project root, or `~/.claude/.mcp.json` for global. Run `/mcp` to verify.\n\n### Claude Desktop\n\nEdit `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\\Claude\\claude_desktop_config.json` (Windows):\n\n```json\n{\n  \"mcpServers\": {\n    \"dompruner\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"dompruner-mcp\"]\n    }\n  }\n}\n```\n\n### Cursor / Windsurf / other MCP clients\n\n```json\n{\n  \"mcpServers\": {\n    \"dompruner\": {\n      \"type\": \"stdio\",\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"dompruner-mcp\"]\n    }\n  }\n}\n```\n\n### Remote HTTP (no install, always up to date)\n\nFor clients that support HTTP transport — no Node.js install required, always runs the latest version:\n\n```json\n{\n  \"mcpServers\": {\n    \"dompruner\": {\n      \"url\": \"https://dompruner-mcp.vercel.app/api/mcp\"\n    }\n  }\n}\n```\n\n### LangChain / LangGraph\n\n[`langchain-mcp-adapters`](https://pypi.org/project/langchain-mcp-adapters/) wraps any MCP stdio server as LangChain tools automatically:\n\n```python\nfrom langchain_mcp_adapters.client import MultiServerMCPClient\n\nclient = MultiServerMCPClient({\n    \"dompruner\": {\n        \"command\": \"npx\",\n        \"args\": [\"-y\", \"dompruner-mcp\"],\n        \"transport\": \"stdio\",\n    }\n})\ntools = await client.get_tools()\n```\n\n---\n\n## Ensuring Your AI Always Uses DomPruner\n\nDomPruner's tool description already tells clients to prefer `dompruner_fetch` over WebFetch. If your client still falls back, add this to its instruction file:\n\n```markdown\nWhen retrieving a URL, always use dompruner_fetch instead of WebFetch.\n- URL known → dompruner_fetch(url, query?)\n- URL unknown → search for the URL first, then dompruner_fetch(url)\n```\n\n| Client | Instruction file |\n|--------|-----------------|\n| Claude Code | `CLAUDE.md` (project) or `~/.claude/CLAUDE.md` (global) |\n| Cursor | `.cursorrules` |\n| Windsurf | `.windsurfrules` |\n| Cline | `.clinerules` |\n| GitHub Copilot | `.github/copilot-instructions.md` |\n\n---\n\n## Tools\n\n| Tool | Description |\n|------|-------------|\n| `dompruner_fetch` | Fetch a URL → DOM-refined Markdown. Optional `query` enables BM25+ section filtering. |\n| `dompruner_sitemap` | Fetch all pages in a sitemap.xml → one refined Document per page. |\n| `dompruner_analyze` | Token-reduction report for a URL without full content. |\n\n→ **[Full tool reference](https://github.com/dong7812/dompruner-mcp/blob/main/docs/tools.md)**\n\n---\n\n## Benchmark Summary\n\n| Metric | WebFetch | **DomPruner** |\n|---|:---:|:---:|\n| Avg context tokens | ~15,735 | **~1,019 (93.5% less)** |\n| Answer quality (10 queries) | 9 / 10 | **8 / 10** |\n| Avg response time | 5,811 ms | **3,168 ms (45% faster)** |\n| Content fidelity | Summarized by small model | **Original text preserved** |\n| Extra API key / infra | No | **No** |\n\n→ **[Full benchmark](https://github.com/dong7812/dompruner-mcp/blob/main/docs/benchmark.md)** · **[Architecture](https://github.com/dong7812/dompruner-mcp/blob/main/docs/architecture.md)**\n\n---\n\n## Related\n\n- **[dompruner-py](https://github.com/dong7812/dompruner-py)** — Python port. `DomPrunerLoader`, `DomPrunerSitemapLoader`, `DomPrunerFetchTool` for LangChain. `pip install dompruner`.\n- **[LangChain integrations](https://docs.langchain.com/oss/python/integrations/document_loaders)** — dompruner-py listed as a third-party web loader.\n\n---\n\n## Glama Score\n[![dompruner-mcp MCP server](https://glama.ai/mcp/servers/dong7812/dompruner-mcp/badges/card.svg)](https://glama.ai/mcp/servers/dong7812/dompruner-mcp)\n\n---\n## License\n\nMIT\n\n",
  "bytes": 4941,
  "sha": "a0f56c93ab0502c7e9f6f810fb948b2217f8bf49f413a90c77c90c520587b338",
  "repo_slug": "dong7812/dompruner-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_dong7812_dompruner_mcp_4eb56d40/readme"
}