Who it is forA developer with an existing Playwright automation who wants a lighter browser backend, triggered by high memory use from a full Chromium install.
The problemChromium-based automation uses a lot of memory per session, and moving existing Playwright scripts to another browser usually means rewriting them.
The outcomeA Playwright script that loads a page and prints its body text through the Moli server, with no code changes beyond the connection.
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 from the README installer.
- Run
moli serveto start the automation server, which serves CDP, WebDriver Classic, and WebDriver BiDi on one endpoint. - Install Playwright in your project with
npm install playwright. (inferred, check the README) - Run the README Playwright script that calls
chromium.connectOverCDP("http://127.0.0.1:9222"), thenpage.gotoandpage.locator("body").innerText().
Prompt for your agent
Using the repo lexmount/moli, start the server with `moli serve` and connect Playwright to http://127.0.0.1:9222 with connectOverCDP. Navigate to <target-url> and print the body innerText. Verify that the printed text matches the visible text of the page.
Caveat. The README says DOM-first mode is the default and that geometry, coordinate input, and screenshots need `moli serve --layout`, so some Playwright calls will fail without that flag.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for lexmount/moli and "Drive Moli from Playwright over CDP"
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