@mcp-b/smart-dom-reader is a DOM extraction library for agent workflows. It turns a live document into structured data, interactive element maps, and stable selectors while keeping token usage low.
When to use this package
- You are building DOM-aware tools for agents or browser automation.
- You need structured page summaries or ranked selectors.
- You want DOM extraction without bringing in a full MCP runtime.
When not to use this package
- You only need to expose browser-page tools. Use the runtime packages instead.
- You need Chrome extension API tools rather than DOM extraction. Use
@mcp-b/extension-tools.
Where it sits in the package graph
This package sits in the tooling layer and can be used standalone. Other tooling packages, including@mcp-b/extension-tools, can build on top of it.
First step
Choose whether you need one-shot extraction or staged extraction. The reference page documents both approaches, selector outputs, and the optional MCP integration.Related pages
Reference
Extraction APIs, selector ranking, and result shapes.
@mcp-b/extension-tools overview
Tool classes that build on smart-dom-reader in extension contexts.
@mcp-b/chrome-devtools-mcp overview
Tooling path when you want DevTools-based automation instead.
Tool design
Design guidance for tools that expose DOM-derived capabilities.
