Who it is forAn engineer building a browser-use agent who needs the agent to see page structure instead of pixels or full HTML.
The problemFull DOM dumps overflow the context window, and screenshots cost more to process than the agent needs.
The outcomeA compact semantic tree printed as text that lists the page structure the agent can act on.
What you need first
- A computer running Linux, macOS, or Windows
- Terminal access (PowerShell on Windows)
- Permission to download and run the Moli installer from GitHub
- A URL to fetch or test
Steps
- Install the Moli binary using the installer from the README.
- Run
moli fetch --dump semantic_tree_text --wait-selector body https://example.comto return the semantic tree. (inferred, check the README) - Swap in your target URL and, if the page loads content late, change the selector to one that appears only after the content is ready.
Prompt for your agent
Using the repo lexmount/moli, run `moli fetch --dump semantic_tree_text --wait-selector body <target-url>`. Return the semantic tree text. Verify that headings and links from the page appear in the output.
Caveat. The README describes the semantic tree as model-friendly but does not give a size limit, so check the output length against your model's context window.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for lexmount/moli and "Get a compact semantic tree of a page for a model"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer