# Moli

> A Rust headless browser for AI agents that only lays out and paints a page when asked

- Category: Agents & Automation / Computer & Browser Use
- Language: Rust
- Licence: Apache-2.0 or MIT (dual-licensed)
- Repository: https://github.com/lexmount/moli
- Canonical page: https://ai-tldr.dev/tools/moli/
- Updated: 2026-09-24

## In short

Moli is Lexmount's open-source headless browser for AI agents. It sits in the Computer & Browser Use category of the Agents & Automation tools and is open-source, written in Rust and licensed Apache-2.0 or MIT (dual-licensed). To get started: install the binary.

## Overview

Moli is Lexmount's open-source headless browser for AI agents. It is a standalone browser kernel written in Rust, not a Chromium wrapper: it runs real JavaScript on V8, parses HTML with html5ever, computes styles with Servo's Stylo, and handles networking, cookies and storage itself. Agents use it to fetch and extract web pages, search the web and automate browser tasks, through a CLI or through CDP, WebDriver Classic and WebDriver BiDi, on Linux, macOS and Windows.

Its central design choice is that most agent requests only need page structure, not pixels. By default Moli answers DOM queries, script evaluation, HTML/Markdown extraction and network inspection straight from the native DOM and style state without running layout or paint. When a request does need geometry, coordinate input or a screenshot, the --layout mode builds a layout for that one request, keeps only a frozen copy of the geometry and throws the paint state away afterwards. The README pitches this cost model at crawling, browser-use agents, retrieval pipelines, evaluation environments and reinforcement-learning workloads.

The project states its boundaries plainly: there is no GUI, persistent window or GPU compositor, it does not aim for pixel-for-pixel parity with Chrome or high-fidelity Canvas/WebGL/media playback, and unsupported protocol paths return explicit errors rather than pretending an action happened. Lexmount also runs a managed cloud service, Lexmount Browser, built around Moli, but the open-source browser is fully usable without it.

## What it does

- One binary serves CDP, WebDriver Classic and WebDriver BiDi on the same endpoint, so Playwright can connect over CDP with no separate ChromeDriver, geckodriver or browser install
- A moli fetch CLI that dumps a page as HTML, Markdown, JSON or a compact semantic text tree, with selector, script and response waits
- A complete web runtime: V8 JavaScript with modules and workers, iframes, CSS cascade, Fetch/XHR/WebSocket, cookies, WebCrypto and profile-scoped localStorage, IndexedDB and OPFS
- Opt-in --layout mode for real geometry, hit-testing, coordinate input, viewport and full-page screenshots, PDFs and DevTools screencast frames
- Explicit cost controls: optional image, font, audio, video and media resources are only fetched when flagged, alongside profiles, proxies, HTTP cache, timeouts and private-network policy
- Agent skills in the repo (moli-webfetch, moli-websearch, moli-cdp-server) that teach a coding agent to install and drive the binary

## Getting started

Moli ships as a prebuilt binary with installer scripts for Linux, macOS and Windows. The README also offers an agent-first route: point your coding agent at the skills folder and let it install the binary itself.

1. Install the binary

   On Linux or macOS run the installer script from the project's releases. On Windows the README gives the PowerShell equivalent: powershell -ExecutionPolicy ByPass -c "irm https://github.com/lexmount/moli/releases/latest/download/moli-installer.ps1 | iex".

```bash
curl --proto '=https' --tlsv1.2 -fsSL \
  https://github.com/lexmount/moli/releases/latest/download/moli-installer.sh | sh
```

2. Extract a page for a model

   fetch renders a page after its JavaScript runs and dumps it as Markdown, or as a compact semantic tree meant for an LLM. Run moli fetch --help for every output format and wait option.

```bash
moli fetch --dump markdown --wait-until done https://example.com

moli fetch --dump semantic_tree_text --wait-selector body https://example.com
```

3. Take screenshots or PDFs when you need pixels

   Visual output requires opting into on-demand layout with --layout.

```bash
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.pdf
```

4. Start the automation server

   serve exposes CDP, WebDriver Classic and WebDriver BiDi on one endpoint. Add --layout for real geometry, coordinate input and screenshots, and --resource to also load images, fonts and media.

```bash
moli serve
moli serve --layout
moli serve --layout --resource
```

5. Drive it from Playwright

   Playwright connects to the running server directly over CDP.

```js
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();
```

## When to use it

- Reach for it when an agent mostly reads pages — extracting Markdown, querying the DOM, running scripts — and a full Chrome per session is too much memory
- Reach for it to swap a lighter browser under existing Playwright, Puppeteer or Selenium code via CDP or WebDriver without rewriting the scripts
- Reach for it in crawling, retrieval, evaluation or reinforcement-learning environments that spin up many browser sessions and only occasionally need a screenshot
- Reach for it to give a coding agent web fetch and search through the bundled skills instead of a hosted scraping API

## Version history

- 2026-09-24 v1.1.10: Release focused on web-platform correctness: dozens of fetch, XHR and network-header fixes plus CSP, CORS and TLS fixes, including Apple SecTrust on macOS.
