What it does
Self-healing browser harness that enables LLMs to complete any task
- Connects Instruction files the AI reads
- Account or key No key found in README or SKILL.md
- Category Other
For makers: add a badge to your README
If you made this, paste this code into your README. The badge links back to this page.
[](https://mcp.popnx.com/en/skills/browser-use-browser-harness-js)Similar Skills
Same kind of work, ordered like the Skills list
| This one browser-harness-js | llmfit | claude-video | VideoCaptioner | claude-cookbooks | |
|---|---|---|---|---|---|
| Maker | browser-use | AlexsJones | bradautomates | WEIFENG2333 | anthropics |
| Skills | 1 | 1 | 1 | 1 | 4 |
| GitHub stars | 500 | 39,018 | 20,999 | 16,544 | 54,763 |
| Last code change | Nov 11, 2026 | Nov 16, 2026 | Sep 25, 2026 | Sep 12, 2026 | Nov 5, 2026 |
| License | MIT | MIT | MIT | GPL-3.0 | MIT |
1 skills (instruction sets) by browser-use that an AI reads and follows · not an MCP server
How a Skill differs from MCP
MCP = the hands
Connects the AI to an outside service or data, such as reading Notion or creating an invoice. A program or server has to be running.
Skill = the manual
A text file that teaches the AI how to do a task. It connects to nothing.
Some overlap: a few Skills run scripts that call tools, and a few MCP servers only send knowledge. Start from the task you want done.
Works with
Not stated by the maker · SKILL.md skills work in apps that support Agent Skills, such as Claude Code, Codex and Cursor
Install
Is it safe?
- Who made it
GitHub account browser-use (organization), 1 years old
- Use and upkeep
★ 500 stars · code last changed Nov 11, 2026
- Any scripts?
6 scripts that can run on a computer: sdk/browser-harness-js, sdk/gen.ts, sdk/generated.ts, sdk/repl.ts and 2 more
- Uses the internet?
Scripts that go online: sdk/browser-harness-js, sdk/repl.ts, sdk/session.ts, sdk/generated.ts
- Changes machine-wide settings?
No hooks or writes to machine settings found
Checked automatically from the repo files at commit c92722e (read only, nothing was run). Not a safety guarantee: read it and decide for yourself
First: which AI do you use?
Pick your app and this page shows only how to install it there
Option 1Upload to claude.ai (web and app)
Uploading to claude.ai would fail: the description is over 200 characters (560). Use "Let the AI install it" instead
Option 1Let Claude Code install it
Copy this sentence and paste it into a Claude Code chat
For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing
The AI tells you what it will do first and asks your permission at every step
Restart Claude Code, then type /browser-harness-js or ask for a matching task and Claude picks it up
Checked against official docs Nov 12, 2026 · Source: code.claude.com
For Terminal users
A Skill is instructions the AI will follow. Read the files before installing, and install only from makers you trust.
Open Terminal
Mac: press Command+Space and type Terminal · Windows: the command below does not work in PowerShell; use “Let AI install it” above instead
Copy the skill folder to ~/.claude/skills
This downloads the repo to a temporary folder and copies only the folders that contain a SKILL.md
Checking the commands · copy buttons appear once they pass
Restart Claude Code, then type /browser-harness-js or ask for a matching task and Claude picks it up
ChatGPT desktop app
The ChatGPT desktop app has Codex built in, and Codex reads skills from ~/.agents/skills
Option 1Let ChatGPT install it
Open Codex in the ChatGPT desktop app and paste this sentence into the chat
The AI always shows you the path before installing
The AI tells you what it will do first and asks your permission at every step
Option 2Put the folder there yourself
Put the cdp folder at ~/.agents/skills/cdp
~ is your home folder ($HOME)
For Terminal users
A Skill is instructions the AI will follow. Read the files before installing, and install only from makers you trust.
Open Terminal
Mac: press Command+Space and type Terminal · Windows: the command below does not work in PowerShell; use “Let AI install it” above instead
Copy the skill folder to ~/.agents/skills
This downloads the repo to a temporary folder and copies only the folders that contain a SKILL.md
Checking the commands · copy buttons appear once they pass
After installing
- ChatGPT desktop app: open Skills in the sidebar to see that the skill is there
- To use it: in ChatGPT type @ and pick the skill · in Codex CLI or the IDE extension run /skills or type $ and the skill name
- Codex picks up newly installed skills by itself; if one does not show up, restart Codex
Checked against official docs Nov 15, 2026 · Source: learn.chatgpt.com
ChatGPT on the web and mobile
Skills you install yourself do not work here; only skills that come with a plugin from the directory
To use this skill with ChatGPT, use the ChatGPT desktop app as above
Checked against official docs Nov 15, 2026 · Source: learn.chatgpt.com
Option 1Let Codex install it
Copy this sentence and paste it into a Codex chat · Works in Codex inside the ChatGPT desktop app, Codex CLI and the IDE extension
For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing
The AI tells you what it will do first and asks your permission at every step
Codex picks up newly installed skills by itself; if one does not show up, restart Codex · To use it: in ChatGPT type @ and pick the skill · in Codex CLI or the IDE extension run /skills or type $ and the skill name
Checked against official docs Nov 15, 2026 · Source: learn.chatgpt.com
For Terminal users
A Skill is instructions the AI will follow. Read the files before installing, and install only from makers you trust.
Open Terminal
Mac: press Command+Space and type Terminal · Windows: the command below does not work in PowerShell; use “Let AI install it” above instead
Copy the skill folder to ~/.agents/skills
This downloads the repo to a temporary folder and copies only the folders that contain a SKILL.md
Checking the commands · copy buttons appear once they pass
Restart Codex, then ask for a matching task; Codex lists the skill
Option 1Let Cursor install it
Copy this sentence and paste it into a Cursor chat
For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing
The AI tells you what it will do first and asks your permission at every step
In Cursor’s Agent chat, type / and pick browser-harness-js
Checked against official docs Nov 12, 2026 · Source: cursor.com
For Terminal users
A Skill is instructions the AI will follow. Read the files before installing, and install only from makers you trust.
Open Terminal
Mac: press Command+Space and type Terminal · Windows: the command below does not work in PowerShell; use “Let AI install it” above instead
Copy the skill folder to ~/.cursor/skills
This downloads the repo to a temporary folder and copies only the folders that contain a SKILL.md
Checking the commands · copy buttons appear once they pass
In Cursor’s Agent chat, type / and pick browser-harness-js
Option 1Let the AI install it
For other apps that read skills. The sentence gives the paths for Claude Code, Codex and Cursor so the AI picks the one for your app · Copy this sentence into the app’s chat
For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing
The AI tells you what it will do first and asks your permission at every step
Checked against official docs Nov 12, 2026 · Source: code.claude.com, learn.chatgpt.com, cursor.com
For Terminal users
Other apps that support Agent Skills (such as Gemini CLI or GitHub Copilot) use different folders. Check that app’s guide, then copy the folder with the SKILL.md there.
Skill folders checked against the official Claude Code, Codex and Cursor guides on Nov 11, 2026
View the original SKILL.md
The text below comes from the maker’s repo, not from PopNx MCP
Showing the first 8,000 characters · Open the full file on GitHub
---
name: cdp
description: 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.
---
# CDP — `browser-harness-js` skill
Custom codegen'd CDP SDK (every method from browser_protocol.json + js_protocol.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, `<skill-dir>` 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`.
## Setup (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:
```bash
# macOS (Apple Silicon + Homebrew)
command -v browser-harness-js >/dev/null || ln -sf <skill-dir>/sdk/browser-harness-js /opt/homebrew/bin/browser-harness-js
# macOS (Intel) / most Linux — may need sudo
command -v browser-harness-js >/dev/null || ln -sf <skill-dir>/sdk/browser-harness-js /usr/local/bin/browser-harness-js
# Linux without sudo (ensure ~/.local/bin is on PATH)
command -v browser-harness-js >/dev/null || { mkdir -p ~/.local/bin && ln -sf <skill-dir>/sdk/browser-harness-js ~/.local/bin/browser-harness-js; }
```
The CLI auto-installs `bun` on first run if it's missing (the server is Bun-native). Set `BROWSER_HARNESS_SKIP_BUN_INSTALL=1` to opt out.
## How to use
Just run `browser-harness-js '<JS>'`. The first call spawns the server in the background; subsequent calls hit the same process and so reuse the same `session`, the same WebSocket to Chrome, and any globals you set.
```bash
browser-harness-js 'await session.connect()'
browser-harness-js 'await session.Page.navigate({url:"https://example.com"})'
browser-harness-js '(await session.Runtime.evaluate({expression:"document.title",returnByValue:true})).result.value'
```
Output is the **raw result content** — no `{ok,result}` envelope.
| Result type | stdout |
|---|---|
| string | bare text, no JSON quotes (e.g. `Example Domain`) |
| number / boolean | `42`, `true` |
| object / array (non-empty) | compact JSON (e.g. `{"frameId":"..."}`, `[1,2,3]`) |
| `undefined` / `null` / `""` / `{}` / `[]` | empty (no output) |
**Errors** go to **stderr**, exit code `1`. The CDP error message and JS stack are printed verbatim, e.g.:
```
Error: CDP -32602: invalid params
at _call (.../session.ts:117:33)
...
```
Detect failure with `if browser-harness-js '...'; then ...; else handle_error; fi` or by checking `$?`.
**Multi-line snippets via stdin (heredoc).** Important: a multi-statement snippet does NOT auto-return the last expression — write `return X` explicitly. Single-expression snippets passed as the first argument DO auto-return.
```bash
browser-harness-js <<'EOF'
const tabs = await listPageTargets();
globalThis.tid = tabs[0].targetId;
await session.use(globalThis.tid);
return globalThis.tid;
EOF
```
## CLI commands
| Command | Behavior |
|---|---|
| `browser-harness-js '<js>'` | Auto-start server if needed, eval the JS, print result. |
| `browser-harness-js <<EOF…EOF` | Same, code from stdin. |
| `browser-harness-js --status` | Print health JSON (uptime, connected, sessionId) or exit 1 if down. |
| `browser-harness-js --start` | Explicit start (no-op if already running). |
| `browser-harness-js --stop` | Graceful shutdown. Drops session state. |
| `browser-harness-js --restart` | Stop + start fresh. |
| `browser-harness-js --logs` | `tail -f` the server log (`/tmp/browser-harness-js.log`). |
Env vars: `CDP_REPL_PORT` (default `9876`), `CDP_REPL_LOG` (default `/tmp/browser-harness-js.log`).
## API surface inside snippets
These globals are pre-loaded — no imports needed:
- `session` — the persistent `Session`. Has every CDP domain mounted: `session.Page`, `session.DOM`, `session.Runtime`, `session.Network`, … 56 domains, 652 methods total.
- `listPageTargets()` — list real page targets via CDP's `Target.getTargets` (works on Chrome 144+ too), with `chrome://` and `devtools://` URLs filtered out. No args — uses the connected session.
- `detectBrowsers()` — scan OS-specific profile dirs for running Chromium-based browsers with remote debugging on. Returns `[{name, profileDir, port, wsPath, wsUrl, mtimeMs}]`, sorted by most recently launched.
- `resolveWsUrl(opts)` — resolve a WS URL from `{wsUrl}` | `{port, host?}` | `{profileDir}`. For the no-args auto-detect flow, call `session.connect()` directly instead.
- `CDP` — the generated namespaces (`CDP.Page`, `CDP.Runtime`, …) for type-name reference.
### Calling a CDP method
Every method takes a single object argument matching the CDP wire params; it resolves to the typed return value (no `result` envelope, no `id` correlation — handled for you).
```js
// no params
await session.DOM.enable()
// required params
await session.Page.navigate({ url: 'https://example.com' })
// all-optional params (object also optional)
await session.Page.captureScreenshot()
await session.Page.captureScreenshot({ format: 'png', quality: 80 })
// returns are stripped to the typed shape
const { root } = await session.DOM.getDocument()
const { nodeId } = await session.DOM.querySelector({ nodeId: root.nodeId, selector: 'h1' })
```
### Connecting
**Default: just call `session.connect()` with no args.** It auto-detects running Chromium-based browsers (Chrome, Chromium, Edge, Brave, Arc, Vivaldi, Opera, Comet, Canary) by scanning OS-specific profile dirs for a `DevToolsActivePort` file, ordered by most-recently-launched, and picks the first one whose WebSocket accepts. OS-agnostic — works on macOS, Linux, Windows.
```js
await session.connect() // auto-detect
```
Use `detectBrowsers()` first if you want to see what's available (or let the user pick) before connecting:
```js
const found = await detectBrowsers()
// [{ name: 'Google Chrome', profileDir, port, wsPath, wsUrl, mtimeMs }, ...]
```
**Explicit forms** — use these only when auto-detect picks the wrong browser, or when you already know where to connect:
| Form | When to use |
|---|---|
| `{ profileDir }` | Target a specific browser when several are running. Reads `<profileDir>/DevToolsActivePort` directly. |
| `{ wsUrl }` | You already have `ws://…/devtools/browser/<uuid>` (e.g. piped from elsewhere). |
```js
await session.connect({ profileDir: '/Users/<you>/Library/Application Support/Google/Chrome' })
await session.connect({ wsUrl: 'ws://127.0.0.1:9222/devtools/browser/<uuid>' })
```
Profile paths by OS — use these with `{ profileDir }`:
- macOS: `~/Library/Application Support/<Browser>` (e.g. `Google/Chrome`, `Comet`, `BraveSoftware/Brave-Browser`, `Arc/User Data`)
- Linux: `~/.config/<browser>` (e.g. `google-chrome`, `chromium`, `BraveSoftware/Brave-Browser`)
- Windows: `%LOCALAPPDATA%\<Browser>\User Data` (e.g. `Google\Chrome`, `Microsoft\Edge`, `BraveSoftware\Brave-Browser`)
Per-candidate WS-open timeout defaults to **5s** — live browsers answer with open/close within ~100ms, so 5s is already generous. The only case where 5s is too short is when Chrome is showing the **Allow** popup and waiting on the user to click. If you expect that, pass `timeoutMs: 30000`:
```js
await session.connect({ profileDir: '/Users/<you>/Library/ApplicatDiscussion
Ask, share a tip or report that it does not work. Sorted by what people marked helpful.
No posts yet. Be the first to ask or share.
Posts here are written by users, not the PopNx team.
From GitHub
- GitHub stars
- 500
- Maker
- browser-use
- License
- MIT
- Last code change
- Nov 11, 2026
- SKILL.md files in the repo (including translated copies and templates)
- 1