Skip to main content

moli-cdp-server

Start Moli's CDP server and connect Playwright, Puppeteer, or raw CDP clients. Use to run a headless-browser CDP endpoint, replace a Chromium process, attach over CDP, enable real layout and screenshot surfaces, or diagnose CDP discovery, connection, and target startup—even when Moli is not named.

설치로 이동

소스 정보

저장소
lexmount/moli
최근 소스 활동
2026년 8월 24일 18:50
감지된 SKILL.md 언어
영어
스타
2,182
포크
147

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
3 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
moli-cdp-server
description
Start Moli's CDP server and connect Playwright, Puppeteer, or raw CDP clients. Use to run a headless-browser CDP endpoint, replace a Chromium process, attach over CDP, enable real layout and screenshot surfaces, or diagnose CDP discovery, connection, and target startup—even when Moli is not named.
# Run Moli's CDP Server Run one Moli CDP server and connect the requested CDP client to its endpoint. Preserve the client's existing API where Moli supports it. ## Workflow 1. Resolve `moli` from `PATH`. If it is unavailable, install the latest prebuilt release for the current platform: Linux or macOS: ```bash curl --proto '=https' --tlsv1.2 -fsSL \ https://github.com/lexmount/moli/releases/latest/download/moli-installer.sh | sh ``` On Windows, use PowerShell: ```powershell powershell -ExecutionPolicy ByPass -c "irm https://github.com/lexmount/moli/releases/latest/download/moli-installer.ps1 | iex" ``` Resolve the installed binary again and run `moli --version`. The default location is `~/.local/bin/moli` on Linux/macOS and `%LOCALAPPDATA%\Moli\bin\moli.exe` on Windows when it is not yet on `PATH`. 2. Start `moli serve` on the default loopback endpoint `http://127.0.0.1:9222`. 3. Add `--layout` when the workflow needs real element geometry, coordinate input, screenshots, PDFs, or screencasts. Add `--resource` only when all optional visual/media resources are required. 4. Probe `/json/version` before connecting the client. 5. Connect with the client's remote/attach API; do not launch a second bundled browser. 6. Close CDP clients cleanly, then stop the Moli server if this workflow owns it. ## Playwright 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(); ``` ## Integration rules - Bind to `127.0.0.1` by default. Expose another host only when the user explicitly needs remote access and has addressed network access controls. - Treat Moli as a remote endpoint. Avoid Chrome launch flags and assumptions that require a local Chromium executable. - Expect selected CDP coverage, not complete Chrome protocol parity. Preserve explicit unsupported errors. - Use a unique port for parallel isolated runs. - Persist state intentionally with `--profile-dir`; otherwise keep runs disposable. - Pass proxy, cookie, resource, user-agent, and private-network policy to the Moli server, not to a nonexistent child browser process. Read [references/protocols.md](references/protocols.md) for CDP discovery URLs, server options, client selection, and connection troubleshooting.
GitHub에서 보기