A headless browser written in Zig from scratch for AI agents and automation, with CDP and WebDriver BiDi servers.
lexmount/moli
A headless browser built in Rust for AI agents, offering CDP, WebDriver and BiDi automation with on-demand layout and rendering.
Open-source alternative to:Chrome Headless
- Stars
- 22,828
- Forks
- 631
- Open issues
- 520
- Last commit
- 24 hours ago
What is it?
Moli is a headless browser built in Rust for AI agents that fetch pages, extract content, search the web and automate browser tasks. It is a standalone browser kernel rather than a Chromium wrapper, using V8 for JavaScript, html5ever for parsing, Stylo for CSS and Taffy with Parley for layout.
The browser keeps the DOM and style state as the source of truth and only builds layout or software paint when a request needs them, such as screenshots, coordinate input or hit-testing. Structure-only operations like extracting Markdown, querying the DOM or running JavaScript skip visual work entirely. Output formats include HTML, Markdown, JSON, semantic text trees, screenshots and PDF.
A single binary serves CDP, WebDriver Classic and WebDriver BiDi, so Playwright can connect over CDP without a separate ChromeDriver or browser install. It runs on Linux, macOS and Windows and is licensed under Apache-2.0 or MIT.
Key features
- 01Serves CDP, WebDriver Classic and WebDriver BiDi from one binary.
- 02Builds layout and screenshots only on demand, keeping DOM-only operations cheap.
- 03Exports pages as Markdown, HTML, JSON, semantic text trees, PNG screenshots or PDF.
- 04Runs JavaScript, fetches network resources and manages cookies and profile storage.
- 05Supports proxies, resource policies, HTTP cache and network tracing.
Use cases
- Fetching and extracting clean Markdown or structured text from web pages for an LLM pipeline.
- Driving browser-use agents through Playwright or other CDP clients without installing Chromium.
- Running large crawls where memory use per page matters.
- Generating screenshots or PDFs of pages on demand for evaluation workflows.
Quick start
- 1
Run the official install script for Linux or macOS from the README
- 2
Fetch a page as Markdown
moli fetch --dump markdown --wait-until done https://example.com - 3
Start the automation server (CDP, WebDriver and BiDi)
moli serve
Things to know
- Chrome scored higher than Moli on the README's Lexbench task-success benchmark (99.8% vs 81.9%).
- Visual features such as screenshots, PDF export and real layout require the opt-in --layout flag.
Featured in Repolode Weekly
- Issue #2 · A Rust headless browser for agents, and typed .sql imports
A Rust headless browser that serves CDP, WebDriver Classic and BiDi from one binary. Layout and screenshots are only built on demand, so DOM-only work stays cheap, and pages export to Markdown or semantic text trees as a Chrome Headless replacement.
In collections
Topics
FAQ
- What is moli?
- A headless browser built in Rust for AI agents, offering CDP, WebDriver and BiDi automation with on-demand layout and rendering. Moli is a headless browser built in Rust for AI agents that fetch pages, extract content, search the web and automate browser tasks. It is a standalone browser kernel rather than a Chromium wrapper, using V8 for JavaScript, html5ever for parsing, Stylo for CSS and Taffy with Parley for layout.
- Is moli free to use? What license does it have?
- moli is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
- Is moli still maintained?
- Actively maintained. The last commit to moli was on Nov 6, 2026.
- What can I use moli for?
- Fetching and extracting clean Markdown or structured text from web pages for an LLM pipeline. Driving browser-use agents through Playwright or other CDP clients without installing Chromium. Running large crawls where memory use per page matters. Generating screenshots or PDFs of pages on demand for evaluation workflows.
- How do I install moli?
- Run the official install script for Linux or macOS from the README Fetch a page as Markdown: moli fetch --dump markdown --wait-until done https://example.com Start the automation server (CDP, WebDriver and BiDi): moli serve
- Where can I get moli?
- The source code and installation instructions are on GitHub: https://github.com/lexmount/moli
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Open-source Python library for building AI agents that control a real browser, with optional Browser Use Cloud stealth browsers and hosted agent API.
Open-source browser API for AI agents and apps, running a managed Chrome sandbox you can drive with Puppeteer, Playwright, or Selenium.
A Go HTTP server that gives AI agents token-efficient control over Chrome, with multi-instance orchestration and a live dashboard.
Cloud browser infrastructure and a Playwright-based framework for running web automations with AI agents, with stealth, CAPTCHA solving and proxies.
Open-source Chrome/Edge extension where an AI agent runs in your own logged-in browser to carry out web tasks from a side panel.