# cdp

> Claude/Codex skill by [@browser-use](https://omgskills.com/library/browser-use/index.md) · 476 stars · Updated 2026-04-20

Drive Chrome via the DevTools Protocol from JavaScript. Run JS snippets through the \`browser-harness-js\` CLI — it auto-spawns a long-lived bun HTTP server holding a fully-typed CDP \`Session\`, and every call (\`browser-harness-js 'await session.Page.navigate(...)'\`) executes against the same persistent connection. Session, active target, and globals survive across calls. Use when the user wants to automate, script, or inspect a Chrome browser via CDP — single tab or multi-tab, attach to existing Chrome or to a new one launched with --remote-debugging-port.

## Install

```sh
git clone https://github.com/browser-use/browser-harness-js ~/.claude/skills/cdp
```

## From README

CDP — browser-harness-js skill Custom codegen'd CDP SDK (every method from browserprotocol.json + jsprotocol.json gets a typed wrapper) plus a tiny HTTP server that holds one persistent CDP Session. The browser-harness-js CLI auto-starts the server on first use and forwards JS snippets to it. The SDK lives in the skill's sdk/ directory. In the rest of this doc, refers to wherever npx skills add installed the skill (Claude Code: /.claude/skills/cdp; Cursor: /.cursor/skills/cdp; other agents vary). The CLI should be on PATH as browser-harness-js. (once, first use) npx skills add drops the skill into your agent's skills directory but does NOT put the CLI on PATH. Before the first call, verify it's reachable and symlink it into any directory on your PATH if not: The CLI auto-installs bun on first run if it's missing (the server is Bun-native). Set BROWSERHARNESSSKIPBUNINSTALL=1 to opt out. How to use Just run browser-harness-js ' '.

## Links

- HTML page: https://omgskills.com/skills/browser-use/browser-harness-js/cdp/
- GitHub: https://github.com/browser-use/browser-harness-js
- Author: [@browser-use](https://omgskills.com/library/browser-use/index.md)

## More skills by this author

- [browser-use](https://omgskills.com/skills/browser-use/browser-use/browser-use/index.md) — Direct browser control via CDP for web interaction: automation, scraping, testing, screenshots, and site/app work.
   - [@browser-use](https://omgskills.com/library/browser-use/index.md) · 109k stars
- [cloud](https://omgskills.com/skills/browser-use/browser-use/cloud/index.md) — Documentation reference for using Browser Use Cloud — the hosted API and SDK for browser automation.
   - [@browser-use](https://omgskills.com/library/browser-use/index.md) · 109k stars
- [open-source](https://omgskills.com/skills/browser-use/browser-use/open-source/index.md) — Documentation reference for writing Python code using the browser-use open-source library.
   - [@browser-use](https://omgskills.com/library/browser-use/index.md) · 109k stars
