DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to drive Moli from Playwright over CDP with Moli

Run a local Moli server and control it from an existing Playwright script.

Short answer: Install the Moli binary from the README installer; then run moli serve to start the automation server, which serves CDP, WebDriver Classic, and WebDriver BiDi on one endpoint; install Playwright in your project with npm install playwright. All steps.

  • Research
  • Advanced
  • 30 minutes
  • From the README
  • Any agent

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

  1. Install the Moli binary from the README installer.
  2. Run moli serve to start the automation server, which serves CDP, WebDriver Classic, and WebDriver BiDi on one endpoint.
  3. Install Playwright in your project with npm install playwright. (inferred, check the README)
  4. Run the README Playwright script that calls chromium.connectOverCDP("http://127.0.0.1:9222"), then page.goto and page.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

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer