Moli
A Rust-built headless browser for AI agents: structure first, pixels only on demand.
- Source repo
- lexmount/moli
- Stars
- ★ 2.5k
- Last updated
- 1mo ago
- FARS reviewed
- Sep 28, 2026
- License
- Apache-2.0
- Primary language
- Rust
- FA score
- 66/100 · Some gaps
At a glance
- How it runs
- Works with
- Universal · cross-platform
- Cost
- Free, no paid service needed
- Setup effort
- Low · running in minutes
- You'll need
- Typical use
- Crawling and retrieval teams that need to harvest many public pages into Markdown or semantic trees without paying a full render per page.
- Not a fit if
- Teams needing pixel-perfect Chrome parity or full Canvas/WebGL/media playback
- Workflows that require a GUI browser, a persistent window, or GPU compositing
- Migrations that assume every Chrome protocol path is implemented
- Maintenance
- Commits in the last 6 monthslast commit 2026-09-28
- Source review
- 66/100 · Some gaps
What does this agent do, and when should you use it?
Moli is a standalone headless browser kernel written in Rust, aimed at AI agent workloads such as page fetching, content extraction and browser automation. It treats the native DOM plus Stylo computed style as the single source of truth and defaults to LayoutPolicy::Mock, skipping real layout and paint; only when geometry, coordinate input, screenshots or PDFs are needed does it switch to the on-demand --layout mode, freezing one FrozenLayoutTree and discarding the working tree and paint state. A single moli serve endpoint speaks CDP, WebDriver Classic and WebDriver BiDi at once, and Playwright can attach through chromium.connectOverCDP. The moli fetch CLI emits HTML, Markdown, JSON, semantic text trees, screenshots and PDFs directly. Internals lean on libcurl for networking, html5ever for parsing, rusty_v8/V8 for JavaScript, Servo/Stylo for selectors and cascade, Taffy + Parley for box and text layout, and AnyRender/Vello CPU plus usvg for software rendering. Prebuilt installers cover Linux, macOS and Windows, the code is dual-licensed Apache-2.0 or MIT, and the open-source browser is fully usable without the Lexmount Browser cloud runtime.
moli fetch runs the whole pipeline for one URL: load the page, execute JavaScript, perform network requests, then serialize according to --dump (markdown, semantic_tree_text, screenshot, screenshot_full, pdf and more), with load timing controlled by --wait-until done, --wait-selector, response waits and script waits. Inside a page the runtime does streaming HTML parsing, maintains a native DOM, runs V8 JavaScript with modules, timers, microtasks and events, handles iframes and workers, CSS cascade, Fetch/XHR/WebSocket, cookies, WebCrypto, and profile-scoped localStorage, IndexedDB and OPFS. moli serve exposes an automation server where the same endpoint carries CDP, WebDriver Classic and WebDriver BiDi; DOM-first work is on by default, while --layout unlocks real geometry, layout-backed hit testing and coordinate input, viewport screenshots and low-frequency CPU-rendered DevTools screencast frames. Optional image, font, audio, video, media and text-track resources are only fetched with --resource or the individual family flags. Operational knobs cover profile directories, HTTP cache, cookie files, proxies, resource families, connection limits, timeouts, private-network policy, user-agent overrides, diagnostic logging and network tracing. Unsupported protocol paths return explicit errors rather than pretending an action, event, observation or visual result happened.
- Crawling and retrieval teams that need to harvest many public pages into Markdown or semantic trees without paying a full render per page.
- Builders of browser-using agents who run many episodes in memory-constrained containers and want a CDP-compatible target without launching Chromium.
- Teams with an existing Playwright or Puppeteer suite who want to point chromium.connectOverCDP at moli serve and measure how much of their suite passes before switching.
- RL and evaluation harnesses that need high-concurrency, fast-starting browser instances with screenshots enabled only when a visual check is required.
- Backend content services where most requests only need HTML or text but a minority need a viewport screenshot or paginated PDF, gated per request with --layout.
- Intranet or policy-constrained scraping that needs proxies, private-network rules, cookie and profile persistence, and trimmed resource families.
How do you install or deploy this agent?
On Linux or macOS, the official script pulls the latest prebuilt binary (no separate browser, ChromeDriver or geckodriver install):
curl --proto '=https' --tlsv1.2 -fsSL \
https://github.com/lexmount/moli/releases/latest/download/moli-installer.sh | shOn Windows, run this in PowerShell:
powershell -ExecutionPolicy ByPass -c "irm https://github.com/lexmount/moli/releases/latest/download/moli-installer.ps1 | iex"You can also let an AI agent follow the repository's skills instructions and verify the install itself:
Install the skills under https://github.com/lexmount/moli/tree/main/skills,
follow their instructions to download and install the latest prebuilt Moli
binary, then use moli-webfetch to fetch https://example.com and show me the
result.Not documented: build-from-source steps, the build-time dependency list and the required Rust toolchain version are absent from the README, so anyone compiling locally has to establish those separately.
How do you use this agent?
Render a page to Markdown with the default completion strategy, or return a compact semantic tree:
moli fetch \
--dump markdown \
--wait-until done \
https://example.commoli fetch \
--dump semantic_tree_text \
--wait-selector body \
https://example.comFor visual output, opt into layout and write a viewport PNG, a full-document PNG, or a paginated PDF:
moli fetch --layout --dump screenshot https://example.com > page.png
moli fetch --layout --dump screenshot_full https://example.com > full-page.png
moli fetch --layout --dump pdf https://example.com > page.pdfStart the automation server (DOM-first by default; --layout adds geometry and screenshots; --resource adds optional media resources):
moli serve
moli serve --layout
moli serve --layout --resourcePlaywright attaches over CDP to that endpoint:
import { chromium } from "playwright";
const browser = await chromium.connectOverCDP("http://127.0.0.1:9222");
const context = browser.contexts()[0];
const page = context.pages()[0] ?? await context.newPage();
await page.goto("https://example.com");
console.log(await page.locator("body").innerText());
await browser.close();Run moli fetch --help for the full option list covering output formats, page-load and response waits, profiles, proxies, resource policies and tracing.
Safety boundaries, hardening & integrations
Operational blast radius, source-verified safety controls, and first-run hardening steps before connecting this agent to real workspaces.
Declared capability surface (blast radius)
Can run terminal commands; pair with approval gates or container/OS sandboxing.
Modifies local files; work on a clean Git branch or dedicated worktree.
Makes outbound requests; verify telemetry settings and model data routing on private repos.
FARS trust-control audit
- least-privilege scoping
What are this agent's strengths and limitations?
- Structure-first cost model: extracting HTML/Markdown, querying the DOM, running JS, and inspecting network or storage never trigger layout or paint, and the default LayoutPolicy::Mock skips real rendering entirely.
- Measured resource savings: on the sample agent workload, peak PSS 102.46 MiB and CDP ready in 34.85 ms versus Chromium's 348.82 MiB and 169.37 ms; the mixed crawl run shows median RSS 73 MiB against 773 MiB for Chrome Headless.
- One binary serves CDP, WebDriver Classic and WebDriver BiDi from the same kernel and scheduler, removing separate ChromeDriver, geckodriver or browser installs.
- The CLI ships extraction-oriented outputs directly: HTML, Markdown, JSON and semantic text trees, plus viewport screenshots, full-page screenshots and paginated PDFs under --layout.
- Costs are opt-in and explicit: media resource families, profiles, HTTP cache and cookie files all require deliberate flags, so the default footprint stays small.
- Cross-platform and permissively licensed: installers for Linux, macOS and Windows, Apache-2.0 or MIT at your option, and the open-source build needs no Lexmount Browser subscription.
- Explicitly not pixel-for-pixel with Chrome and no high-fidelity Canvas/WebGL/media playback; some Chrome screenshot and print modes are unimplemented.
- The architecture has no GUI browser, persistent window, GPU compositor or retained multi-frame paint, so workflows depending on those cannot be ported as-is.
- Protocol coverage still trails: on 1,308 comparable Lexbench-Headless-Browser tasks, Moli 0.1.1 passed 81.88% versus Chrome's 99.85%, and uncovered paths return errors.
- The default mode has no real geometry, so element boxes, coordinate hit testing and screenshots all require --layout, which changes the resource profile and often implies a separate deployment for visual tasks.
- Real-web success is uneven: in the 192-URL mixed crawl only 103 pages produced useful content (53.6%), with login walls and challenge pages still failing.
- Only prebuilt installation is documented; the README omits source-build steps and build dependencies, and agent-facing setup depends on the skills directory in the repo.
How does this agent compare with similar options?
The README benchmarks Moli directly against Chrome Headless, Lightpanda, Obscura and Kitesurf. On the 192-URL public crawl, Moli produced 103 useful pages at a 1.43 s median and 73 MiB median RSS, while Chrome Headless produced 101 at 773 MiB, Lightpanda 85 at 40 MiB and Obscura 57 at 39 MiB. On 1,308 comparable Lexbench-Headless-Browser tasks, Chrome reached 99.85%, Moli 81.88%, Kitesurf 62.08%, Lightpanda 53.29% and Obscura 44.88%; across a 557-task set completed by all four local engines, Moli used 100.6 ms median CPU and 92 MiB median peak memory against Chrome's 687 ms and 697 MiB. The positioning is clear: Chrome is the compatibility reference, Lightpanda and Obscura trade success rate for even smaller footprints, Kitesurf is remote-only, and Moli sits in between by making layout and paint on-demand. Playwright, Puppeteer and Selenium are clients rather than peer browsers and can drive Moli over CDP or WebDriver.
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| Moli This agent | 66 · Some gaps | CLIFree | ★ 2.5k | 1mo ago | Rust | — |
| Lightpanda Browser | 67 · Some gaps | CLIFree | ★ 43k | today | Zig | OpenAI API · Claude API |
| Obscura Headless Browser | 68 · Some gaps | CLIFree | ★ 37k | today | Rust | Claude.ai |
| OpenCLI Browser Automation CLI | 61 · Some gaps | CLIFree | ★ 31k | 18d ago | JavaScript | Claude Code |
How does FollowAgents rate this agent?
Why each dimension lost points
Evidence shows expensive operations (layout/paint/resource loading/persistence) are off by default and require explicit opt-in; CI workflows use minimal permissions and SHA-pinned actions; a robots module exists. Deductions: curl|sh one-line install executes a remote script without user confirmation; cookie/cache persistence is only mentioned as flags, with no explicit handling statement for sensitive data (cookies, localStorage, proxy credentials); some dependencies (stylo) are pinned to branches, not revisions.
README is consistent with the workspace structure (90+ moli-* crates) and version (0.1.1), and explicitly states unsupported paths never fake results. Deductions: many dependencies are vendored or forked to the author's personal repos (lexmount/curl-rust, ldm0/cookie-rs 'priority' branch); branch references do not guarantee availability and no lockfile evidence is shown; failure-message quality is asserted but not evidenced with concrete error text specs.
Target scenarios (crawling, browser-use agents, retrieval pipelines, RL environments) and platforms (Linux/macOS/Windows) are clearly described, with explicit boundaries (no GUI, no pixel-parity with Chrome). Deductions: trigger precision rests on documented flags; the agent skills files themselves are not in the reviewed evidence; environment fit lacks system dependency or minimum version requirements.
Multi-language READMEs, clear project structure, dual licensing with license-metadata., and an explicit known-limitations section are strong evidence. Deductions: no changelog evidence; version 0.1.1 appears only in benchmark text; maintenance responsibility is asserted as 'active development' plus a Discord link with no governance or maintainer roster; install notes rely on a remote script pipe without checksums or a fully documented alternative path.
Model-oriented outputs (Markdown, semantic tree), the on-demand rendering cost model, and memory/CPU comparisons against Chrome and Lightpanda are valuable product claims. Deductions: an 81.9% task success rate versus Chrome's 99.8% shows a capability trade-off; benchmarks are self-built (Lexbench) and not independently reproduced, so benefit claims partly rest on the author's own tests.
Benchmarks link to reports with methodology, and the differing conditions for Kitesurf are explicitly disclosed, showing good fact/inference separation. Deductions: all comparative data comes from the author's own Lexbench repository with no third-party corroboration; performance figures (e.g., 1.612 million WPT tests) cannot be traced to inspectable raw data in a static review.
- The installer pipes remote content directly into sh/iex; enterprise users should prefer verified offline installation with checksum verification of release artifacts.
- Several dependencies come from the author's personal forks and are referenced by branch (e.g., stylo 'moli' branch), introducing supply-chain variability; pin revisions and review vendored code.
- All benchmark data is self-published via the author's Lexbench; verify key performance and success-rate claims independently before relying on them.
- The browser can reach internal networks (a private-network policy option exists); confirm the default policy in deployment and restrict proxy and cookie persistence.
- The project is at version 0.1.1 with no changelog; assess API and behavior stability commitments before production adoption.
FAQ
What do I lose if I never pass --layout?
Do I need to pay for Lexmount Browser to use this?
How do I move an existing Playwright suite over?
Does it fail silently on pages it cannot handle?
Can it double as a desktop browser or drive heavy graphics pages?
Is Moli open source?
Is Moli safe to use?
Is Moli still maintained?
Who makes Moli?
Thanks — we use this to improve the page.
Subscribe to the FollowAgents RSS feed, or save this agent to your browser shortlist to compare on your next visit.