Agent Skillslexmount/moli › moli-cdp-server

moli-cdp-server

GitHub

启动 Moli CDP 服务器并连接 Playwright/Puppeteer 等客户端,支持无头浏览器控制、截图及调试。提供自动安装、端口管理、布局与资源模式配置,以及通过 CDP 协议进行远程连接的标准化工作流。

skills/moli-cdp-server/SKILL.md lexmount/moli

Trigger Scenarios

需要启动本地或远程的无头浏览器服务 使用 Playwright 或 Puppeteer 连接 CDP 端点 需要获取页面截图、PDF 或实时布局信息 调试浏览器自动化连接或目标发现问题

Install

npx skills add lexmount/moli --skill moli-cdp-server -g -y
More Options

Use without installing

npx skills use lexmount/moli@moli-cdp-server

指定 Agent (Claude Code)

npx skills add lexmount/moli --skill moli-cdp-server -a claude-code -g -y

安装 repo 全部 skill

npx skills add lexmount/moli --all -g -y

预览 repo 内 skill

npx skills add lexmount/moli --list

SKILL.md

Frontmatter
{
    "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:

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

    On Windows, use 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

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 for CDP discovery URLs, server options, client selection, and connection troubleshooting.

Version History

  • 62b1600 Current 2026-09-08 17:40

Same Skill Collection

skills/moli-webfetch/SKILL.md
skills/moli-websearch/SKILL.md

Metadata

Files
0
Version
5b5015d
Hash
06240516
Indexed
2026-09-08 17:40

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-16 07:14
浙ICP备14020137号-1 $방문자$