---
name: browserious
description: >
  Control a real browser through the Browserious CLI or its bundled local MCP
  compatibility server. Use for JavaScript-rendered pages, visual verification,
  authenticated browsing, form entry, screenshots, CAPTCHA detection, DOM/CDP
  automation, hardware-level mouse and keyboard input, and localhost tunnels.
---

# Browserious browser control

Browserious is one Python distribution with a CLI-first interface. Install it, sign in with the
device flow, and use CLI commands directly. Source code and the Browserious private wiki are not
required.

```bash
pip install browserious
browserious login
browserious whoami
browserious session create
```

For an isolated invocation without a persistent installation:

```bash
uvx browserious --help
uvx browserious login
```

`uvx` caches environments. Pin the version for reproducible automation and add `--refresh` when
you need it to resolve the requested release again:

```bash
uvx --refresh --from browserious==0.2.0 browserious --version
```

## Authentication

`browserious login` uses RFC 8628 device authorization. It opens the verification page when
possible, prints the URL and user code to stderr, polls until approval, and stores an OAuth access
token plus rotating refresh token. Use `browserious login --no-browser` on a headless host. The CLI
refreshes an expiring stored token under a cross-process lock; a refresh retry re-reads the store so
concurrent invocations share the rotated credential family. `browserious logout` revokes the active
stored refresh family, stops the tunnel daemon, and deletes the local profile only after successful
server revocation.

API URL precedence is:

1. `--api-url`
2. `BROWSERIOUS_API_URL`
3. `http://localhost:8100` when `BROWSERIOUS_API_KEY` is set
4. the current stored profile origin
5. `https://api.browserious.com`

Credential precedence is:

1. `--access-token`
2. `BROWSERIOUS_ACCESS_TOKEN`
3. legacy `BROWSERIOUS_API_KEY`, sent as `X-API-Key`
4. the stored login for the selected API URL

Explicit and environment tokens are non-refreshable. Empty explicit values fail instead of falling
through. Normal interactive setup should use device login; `br_live_*` and deployment API keys are
migration/operations compatibility credentials, not tokens issued by OAuth.

Credential profiles are keyed by API origin. Linux uses
`$XDG_CONFIG_HOME/browserious/credentials.json` or `~/.config/browserious/credentials.json`, macOS
uses `~/Library/Application Support/browserious/credentials.json`, and Windows uses
`%APPDATA%\browserious\credentials.json`. The directory, credential file, and lock are validated as
owner-only. Windows uses a protected DACL containing only the current user's SID, rejects reparse
points and wrong owners, uses a cross-process byte-range lock, and retries atomic replacement when a
reader briefly holds the file. Permission/security failures stop rather than weakening protection.

## Output, secrets, and exit status

Human output is the default. Use `--json` or `--output json` for compact JSON on stdout. Diagnostics
and errors go to stderr. Returned secrets are recursively redacted by default, including tokens,
passwords, cookies, proxy credentials, CDP URLs, VNC URLs, and authorization headers.

`--show-secrets` is bounded to `session create`, `file get`, `profile get`, and `profile export`.
It warns before writing secrets to an interactive terminal. `profile export --output-file PATH`
requires `--show-secrets` and reports that the saved artifact contains secrets. Screenshots and
other non-JSON responses write to `--output-file` or `browserious-output.bin`.

Exit codes are stable classes: `0` success, `2` local validation/platform error, `3` authentication
or credential error, `4` forbidden, `5` not found, `6` conflict, `7` rate limited, `8` transport or
server failure, `9` other HTTP failure, and `130` interrupted foreground tunnel. Argparse usage
errors also use `2`.

## Core browser loop

Sessions are server-owned and survive CLI process exit, so separate invocations work with the same
session ID:

```bash
browserious --json session create
browserious page create SESSION_ID --url https://example.com
browserious page goto SESSION_ID PAGE_ID https://example.com --wait-until load
browserious screenshot page SESSION_ID PAGE_ID --output-file page.png
browserious page close SESSION_ID PAGE_ID
browserious session delete SESSION_ID
```

Always delete a session when finished. CLI and MCP browser commands use authenticated shared REST
operations, which makes sessions usable across invocations without a process-local MCP registry.
Only the local tunnel owner obtains a short-lived, owner- and scope-bound tunnel capability and
forwards its opaque routing headers; capability and session secrets stay out of the credential store.

## Tabs cost memory — reuse one, and close it

A session runs in a container with **2 GB of RAM** shared by Chromium, its renderers and the node
services. Every open tab is a renderer process holding that budget, so a long run that keeps opening
tabs ends in an out-of-memory kill, a Chrome crash or sluggish input rather than a clean error.

Three habits keep a session healthy:

- **Reuse a tab.** `page goto SESSION_ID PAGE_ID URL` navigates an existing tab. Prefer it over
  `page create` whenever you are done with the current page's content.
- **Close what you finished with.** `browserious page close SESSION_ID PAGE_ID` closes the tab and
  frees its renderer.
- **Keep one tab open.** Closing the session's *only* tab is refused with exit 6 and
  `LAST_PAGE`: Chrome runs standalone on the node and quits when its last window closes, which would
  end the session. To free that tab's memory without ending anything, navigate it to `about:blank`
  (`browserious page goto SESSION_ID PAGE_ID about:blank`). To end the session, use
  `browserious session delete SESSION_ID`.

A session may hold **at most 5 tabs open at once** (the deployment default; a tenant limit can raise
or lower it). `page create` past that exits 6 with `PAGE_LIMIT_REACHED` and an error naming the open
page ids and the close verb, so recovery is one command — close a tab you are finished with and
retry. Nothing is auto-closed: evicting the oldest tab would invalidate a page id you are still
holding.

Page IDs are never reused, so a closed ID stays a `404` forever rather than silently addressing some
other tab. `page list SESSION_ID` shows what is actually open, including tabs the site opened itself
via `window.open` or `target=_blank` — those count against the limit too, and closing them is up to
you.

Use DOM commands first (`page click`, `page fill`, `page type`, `page eval`, `page wait`, `page
content`). Escalate to `input play` for real X11/XTEST cursor movement, key presses, Unicode typing,
drag-and-drop, and pixel-level interaction. See
[advanced-input.md](references/advanced-input.md) for the accepted action JSON and easing names.

## Profiles — keep a login across sessions

A profile holds a browser's cookies, localStorage and native Chromium state. Name it when you
create the session, and a later session with the same name starts already logged in:

```bash
browserious --json session create --profile-id acme-admin   # log in inside this session
browserious session delete SESSION_ID                        # closing it saves the profile
browserious --json session create --profile-id acme-admin   # starts logged in
```

Without `--profile-id` the profile is named after the session ID, which you will not reuse, so
name every profile you want to come back to. A name that does not exist yet is created on first save.

**Closing a session saves its profile.** `session delete` returns once the browser has shut down
and uploaded its state, so a new session with that profile can start straight away. You do not need
to call save first.

**`profile save-session SESSION_ID` is a mid-session checkpoint**, not a prerequisite for closing.
Use it right after a hard-won login, before something that might crash the browser, or part-way
through a long run. On success it prints `{"status":"saved"}` and the name appears in
`profile list`. On failure it exits non-zero with a specific `error_code`:

| `error_code` | Meaning | What to do |
|---|---|---|
| `PROFILE_SAVE_UNAVAILABLE` | Node not reachable (`retryable`) | Retry after a few seconds |
| `PROFILE_SAVE_IN_PROGRESS` | Another save is running (`retryable`) | Wait, then retry |
| `SESSION_TERMINATED` | The session already ended | Nothing: it was saved on close if it shut down cleanly |
| `PROFILE_SNAPSHOT_FAILED` / `PROFILE_SAVE_FAILED` | Save failed; the stored profile is unchanged | Keep the session open, retry once, then report it |
| `PROFILE_SAVE_UNSUPPORTED` / `PROFILE_SAVE_NODE_REJECTED` | Server-side fault | Don't retry; report it. Closing the session still saves |

**Do not verify a save with `profile get`.** While a session using the profile is live,
`profile get` reads that live browser, not storage, so a 200 proves nothing was stored. Check
`profile list` for the name instead. For proof, close the session and read it back.

Two sharp edges:

- **Keep the tab you logged in on open until a mid-session save.** A mid-session checkpoint can miss
  localStorage for a site first opened in this session if its tab was already closed. Cookies are
  kept either way, and closing the session saves everything. Navigate that tab elsewhere rather than
  closing it, or rely on closing the session.
- **Use one live session per profile.** Two sessions opened with the same `--profile-id` each get
  their own copy, and whichever closes last overwrites the other. Delete the first session before
  opening the profile again.

`profile delete PROFILE_ID` removes a profile you no longer need. `profile import` and `profile
export` move cookies/localStorage state as JSON. Import is refused with `PROFILE_IN_USE` while a
session is using the profile.

## Command inventory

Run `browserious --help` and `browserious GROUP --help` against the installed wheel for the normative
inventory. The complete 0.2.0 forms are:

```text
browserious [--api-url URL] [--access-token TOKEN] [--json|--output human|json] [--show-secrets] COMMAND
browserious login [--no-browser]
browserious logout | whoami | status | mcp
browserious session create [--timeout N] [--profile-id ID] [--user-agent UA] [--timezone TZ] [--locale LOCALE] [--language LANG ...] [--proxy-server URL] [--viewport-width N] [--viewport-height N] [--chrome-arg=--FLAG ...] [--block-resource TYPE ...] [--browser-environment-webgl-vendor STR] [--browser-environment-webgl-renderer STR] [--machine-size XS|S]
browserious session list
browserious session get SESSION_ID
browserious session delete SESSION_ID
browserious page create SESSION_ID [--url URL]
browserious page list SESSION_ID
browserious page close SESSION_ID PAGE_ID
browserious page goto SESSION_ID PAGE_ID URL [--wait-until STATE] [--timeout MS]
browserious page click SESSION_ID PAGE_ID SELECTOR [--strategy STRATEGY] [--timeout MS]
browserious page type SESSION_ID PAGE_ID SELECTOR TEXT [--strategy STRATEGY] [--delay MS] [--clear]
browserious page fill SESSION_ID PAGE_ID SELECTOR VALUE [--strategy STRATEGY]
browserious page eval SESSION_ID PAGE_ID SCRIPT [--args JSON_OR_@FILE]
browserious page wait SESSION_ID PAGE_ID SELECTOR [--strategy STRATEGY] [--state STATE] [--timeout MS]
browserious page content SESSION_ID PAGE_ID
browserious page init-script SESSION_ID SCRIPT [--page-id PAGE_ID]
browserious screenshot page SESSION_ID [PAGE_ID] [--output-file PATH] [--cursor] [--store] [--full-page] [--fullscreen] [--crop-x N --crop-y N --crop-width N --crop-height N | --crop-selector SEL [--crop-strategy css|xpath|text|role|js] [--crop-padding N]] [--type png|jpeg] [--quality N]
browserious screenshot display SESSION_ID [--output-file PATH] [--cursor] [--store]
browserious input play SESSION_ID JSON_OR_@FILE
browserious input cursor SESSION_ID
browserious input element-at-point SESSION_ID PAGE_ID X Y
browserious captcha detect SESSION_ID PAGE_ID
browserious tunnel open SESSION_ID --local-port PORT [--remote-port PORT] [--detach]
browserious tunnel close SESSION_ID --remote-port PORT | tunnel list
browserious daemon start | status | stop
browserious file list [--session-id ID] [--file-type TYPE] [--limit N]
browserious file get FILE_ID | delete FILE_ID
browserious file upload PATH [--session-id ID] [--file-type TYPE]
browserious profile list
browserious profile get PROFILE_ID
browserious profile delete PROFILE_ID
browserious profile save-session SESSION_ID
browserious profile import PROFILE_ID PATH
browserious profile export PROFILE_ID [--output-file PATH]
browserious extension list
browserious extension upload PATH
browserious extension delete EXTENSION_ID
browserious route create SESSION_ID PATTERN ACTION_JSON
browserious route list SESSION_ID
browserious route delete SESSION_ID ROUTE_ID
browserious route requests SESSION_ID ROUTE_ID
browserious record on SESSION_ID [PAGE_ID] [--fullscreen] [--profile NAME] [--max-duration 30m] [--label TEXT] [--crop-x N --crop-y N --crop-width N --crop-height N | --crop-selector SEL [--crop-strategy css|xpath|text|role|js] [--crop-padding N]]
browserious record pause SESSION_ID
browserious record off SESSION_ID [--no-wait] [--output-file PATH]
browserious record mark SESSION_ID LABEL
browserious record status SESSION_ID
browserious recording list [--session SESSION_ID] [--state recording|paused|finalizing|ready|failed] [--limit N]
browserious recording get RECORDING_ID [--output-file PATH]
browserious recording delete RECORDING_ID
browserious recording storyboard RECORDING_ID [--changes | --interval | --markers] [--every SECONDS] [--from T] [--to T] [--width 320] [--columns 4] [--max-frames 24] [--label media|wall] [--type jpeg|png|webp] [--quality N] [--output-file PATH]
browserious recording frame RECORDING_ID --at T [--crop-x N --crop-y N --crop-width N --crop-height N] [--type png|jpeg|webp] [--quality N] [--output-file PATH]
browserious recording clip RECORDING_ID --from T --to T [--crop-x N --crop-y N --crop-width N --crop-height N] [--preset attach|full] [--max-bytes 9.5MB] [--output-file PATH]
browserious recording latency RECORDING_ID --marker T [--crop-x N --crop-y N --crop-width N --crop-height N] [--threshold 0.001] [--window SECONDS]
```

Selector strategies accepted by page operations are `css`, `xpath`, `text`, `role`, and `js`.
JSON arguments can be literal JSON; `input play` and `page eval --args` also accept `@path`.

Use `session get SESSION_ID` to inspect an existing session and `page list SESSION_ID` to recover
page IDs across invocations. For saving and reusing logins, see
[Profiles](#profiles--keep-a-login-across-sessions). Upload an extension
ZIP with `extension upload PATH`, attach the returned ID to `session create --extension ID`
(repeat the option for multiple extensions), and remove it with `extension delete EXTENSION_ID`
after its sessions finish. `route requests SESSION_ID ROUTE_ID` lists requests captured by an
inspection route, which helps diagnose matching before you delete the route.

## Browser environment

`session create` can pin parts of the environment the page observes, so a run is reproducible
across heterogeneous hosts instead of varying with whatever GPU and locale the container happened
to get. Use it for environment emulation and cross-configuration testing — checking a WebGL-gated
feature renders on an Intel integrated stack and an NVIDIA discrete one, or that a date widget
behaves in a non-local timezone.

```bash
browserious session create \
  --timezone America/New_York \
  --locale en-US \
  --browser-environment-webgl-vendor "Google Inc. (NVIDIA Corporation)" \
  --browser-environment-webgl-renderer "ANGLE (NVIDIA, NVIDIA GeForce RTX 3060, OpenGL 4.5)"
```

Both WebGL options are independent — set either alone. `--user-agent`, `--timezone`, `--locale`
and `--language` shape the same emulated environment and can be combined freely. The MCP tool
takes the same two values as `browser_environment_webgl_vendor` and
`browser_environment_webgl_renderer`.

## MCP-to-CLI parity

The same wheel currently enumerates 36 MCP tools. That number is descriptive: runtime MCP tool
enumeration and the wheel's parity check are normative. Every tool delegates to the same operation
as its CLI equivalent:

| MCP tool | CLI equivalent |
|---|---|
| `create_session` / `list_sessions` / `delete_session` | `session create` / `session list` / `session delete` |
| `create_page` / `close_page` | `page create` / `page close` |
| `page_goto` / `page_click` / `page_type` / `page_fill` | `page goto` / `page click` / `page type` / `page fill` |
| `page_eval` / `page_wait_for_selector` / `page_content` | `page eval` / `page wait` / `page content` |
| `add_init_script` | `page init-script` |
| `page_screenshot` / `display_screenshot` | `screenshot page` / `screenshot display` |
| `play_input` / `get_cursor_position` / `element_at_point` | `input play` / `input cursor` / `input element-at-point` |
| `click_element` / `convert_coordinate` | `input click-element` / `input coordinate` |
| `captcha_detect` | `captcha detect` |
| `open_tunnel` / `close_tunnel` | `tunnel open` / `tunnel close` |
| `list_files` / `get_file` / `delete_file` | `file list` / `file get` / `file delete` |
| `recording_set` (`state` on/paused/off) | `record on` / `record pause` / `record off` |
| `recording_mark` | `record mark` |
| `recording_status` | `record status` |
| `recording_get` / `recording_list` / `recording_delete` | `recording get` / `recording list` / `recording delete` |
| `recording_storyboard` / `recording_frame` / `recording_clip` | `recording storyboard` / `recording frame` / `recording clip` |
| `recording_latency` | `recording latency` |

The CLI additionally exposes session inspection, page listing, files/uploads, profiles, extensions,
routes, daemon management, and authentication/status commands.

`get_file` and `file get` return owner-scoped file metadata plus a presigned download URL; neither
streams the stored file content. `file get` redacts the URL unless you pass `--show-secrets`. The
`get_file` MCP tool returns it usable: a fresh, read-only URL for that one file, valid about 10
minutes (`download_url_expires_at`). Call `get_file` right before downloading, fetch it at once with
`curl -fLo <name> "<download_url>"`, call again if it expired, and never paste the URL anywhere
public. Every other secret-shaped value in the response stays redacted.

## Screenshots over MCP

`page_screenshot` and `display_screenshot` return a **reference plus metadata**, not image bytes:

```json
{"session_id": "SESSION", "page_id": "page-0", "format": "png", "size_bytes": 454931,
 "width": 1920, "height": 4200, "path": "/tmp/browserious-screenshots/SESSION-page-0.png",
 "path_scope": "mcp-client-host", "file_id": null, "retrievable": true, "inline": false,
 "hint": "Local stdio MCP: ...", "warnings": []}
```

Read the file yourself only if you actually need the pixels. Pass `inline=true` to get the image
back directly; above a size ceiling (`BROWSERIOUS_MCP_INLINE_MAX_BYTES`, default 1 MiB) that raises
a structured `screenshot_too_large_for_inline` error which still carries the reference, so the
capture is never lost. Prefer `full_page=false`, a crop, or `image_type="jpeg"` to keep captures
small. Every one of those options has a CLI flag too (`--full-page`, `--crop-*`, `--type`), which
the parity gate now enforces rather than assumes.

**Crop to an element** instead of measuring a rectangle: `crop_selector="#checkout", crop_padding=24`
(CLI `--crop-selector '#checkout' --crop-padding 24`). The server waits for the element, scrolls it
into view and crops its box plus padding — in the viewport, the whole page with `full_page`, or the
display with `fullscreen`. The reference's `crop` field (`{x, y, width, height}`; the CLI prints it
as `crop` too) is the rectangle actually applied, in capture pixels, so you can pass it back as
`crop_x/crop_y/crop_width/crop_height` for a stable region on the next capture. Pass one crop form,
never both.

**Where `path` resolves.** Over local stdio MCP the server runs on your machine, so `path` is a real
path in your own filesystem (`path_scope: "mcp-client-host"`; override the directory with
`BROWSERIOUS_SCREENSHOT_DIR`). Repeat captures of the same page reuse that path, and the directory
is pruned to the most recent captures. Over remote MCP the server shares no filesystem with you, so
`path` is `null` and `path_scope` is `"unavailable"` — use `get_file(file_id)` instead and download
its `download_url` immediately.

**When nothing is retrievable.** A `file_id` needs file storage enabled on the deployment, a
credential with an account identity, and an API new enough to accept `store`. When those are absent
the tool still returns the reference with `retrievable: false` and a `hint`; the capture is not
lost, it is just not addressable. Re-request with `inline=true` to get the pixels directly.

**`--store` on the CLI.** The same handle, reached the same way: `browserious screenshot page S P
--store` adds `file_id` to its output, which `browserious file get FILE_ID` consumes. Without the
flag the API still persists the capture in the background, but returns no id, so there is nothing to
address it with — the id is the whole difference. When the prerequisites above are missing the image
is still written and the CLI says on stderr that no id came back, rather than looking like success.

**Text needs fonts.** A browser container with no fonts installed lays a page out correctly and
renders every glyph invisibly — the screenshot looks structurally perfect and verifies nothing.
Installing `fonts-dejavu-core` and `fontconfig` grew a real text-heavy capture roughly 15x. The
tool does **not** guess at this from one capture: a correct but sparse page (login form, empty
state) sits within ~1.2x of a fontless render in bytes per pixel, so any absolute size threshold
would condemn correct screenshots. If you suspect it, capture the same page before and after
installing fonts and compare `size_bytes`.

## Record proof and attach it

**Experimental.** A session can be recorded as an MP4, which is the proof that a fix works: the
click, and what happened after it. Recording must be enabled for the deployment and the account;
otherwise `on` fails with `RECORDING_DISABLED` (HTTP 503, CLI exit 8).

Recording is a switch. `record on` starts (or resumes), `record pause` pauses, `record off` stops
and waits for the MP4. Over MCP it is one tool, `recording_set(state="on"|"paused"|"off")`. **Pause
while typing passwords or tokens**: the paused stretch is simply absent from the video.

**Record a region, not the whole screen.** `on` takes the screenshot capture options. Crop to the
element you will click *and* to where the result will appear, with generous padding. The region
is resolved once, at start, to fixed screen pixels. It does not follow scrolling, and nothing
outside it is recorded: a toast in another corner, a dialog, a redirect. When you cannot predict
where the result shows up, drop the crop.

```bash
browserious record on S --crop-selector '#checkout' --crop-padding 120   # prints recording_id
browserious record mark S submit                                         # right before the action
browserious input click-element S '#checkout button[type=submit]'
browserious record off S --output-file proof.mp4                         # waits, then downloads
```

Over MCP:

```json
{"tool": "recording_set", "arguments": {"session_id": "S", "state": "on", "crop_selector": "#checkout", "crop_padding": 120}}
```

Then `recording_mark`, drive the browser, `recording_set(state="off")`, and
`recording_get(recording_id)`. Once the recording is `ready`, `recording_get` returns a fresh
`download_url`, valid about 10 minutes, that needs no credential. Fetch it at once with
`curl -fLo proof.mp4 "<download_url>"`, then attach the file. `recording_set` redacts the URL; only
`recording_get` returns a usable one. Never paste the URL anywhere public.

Keep the `recording_id` from the first `on`. It is also the MP4's `file_id` once the recording is
ready. `recording_list` / `recording list` lists recordings in every state (recording, paused,
finalizing, ready, failed), and `recording_delete` / `recording delete` deletes one in any state,
so a failed recording can be cleaned up; `list_files` and `delete_file` only see ready ones.
`recording_status(session_id)` / `record status S` shows the session's recorder: whether it is
recording now, its settings, and the current or last `recording_id`.
If you used `wait=false` (`--no-wait`), or the session ended before you turned recording off (it is
finalized for you), poll `recording_get(recording_id)` / `browserious recording get ID
--output-file proof.mp4` until it is `ready`. `profile` is a name the server validates: `sharp`
for small text, `latency` before measuring reaction latency; an unknown name's error lists the
valid ones.

**Look at it, then cut the proof.** You cannot watch a video, so read a storyboard: one image of
labelled tiles, `#N timecode @marker`, where tile `#N` is `frames[N-1]`. Zoom into a tile with a
frame at full resolution, then cut a clip around the moment. Times are TimeRefs: seconds,
`1:02.5`, `@submit` (a marker), `@2` (the 2nd marker), `@submit-2`, `end`, `end-5`.

```bash
browserious recording storyboard R --output-file sb.jpg                       # changes mode: one tile per visible change
browserious recording frame R --at @submit+1 --output-file after.png          # add --crop-* (capture space) to zoom
browserious recording clip R --from @submit-2 --to @submit+5 --output-file proof.mp4   # attach preset: <= 9.5 MB
```

Over MCP: `recording_storyboard(recording_id, inline=true)` returns the image and `frames[]`;
`recording_frame(recording_id, at=frames[6].t)`; `recording_clip(recording_id, start="@submit-2",
end="@submit+5")` returns a `download_url` to curl. The same parameters return the cached file.
A range too long for the attach preset fails with `RECORDING_CLIP_TOO_LARGE`, naming the longest
range that fits.

**Every input action is a marker.** While recording, each click, drag, key, typing and scroll
that Browserious performs is logged as an action marker; `recording get` lists them in `actions[]`
with labels such as `action:click#2` (the 2nd click), and `@action:click#2` is a TimeRef.
`recording storyboard R --markers` shows one tile per marker and action. To measure how fast
the page reacted, record with `--profile latency` (60 fps), then:

```bash
browserious recording latency R --marker @action:click#1 --crop-x 280 --crop-y 40 --crop-width 160 --crop-height 160
```

`latency_ms` runs from the press to the first frame in which the cropped area changed; the
change happened at most `accuracy_ms` (one capture tick, 17 ms at 60 fps) earlier. Crop to where
the reaction appears, so a caret or clock elsewhere does not count.

**Attach it where the work is reviewed:**

- **GitHub:** `gh pr comment 42 --attach proof.mp4` (or `gh issue comment`). Needs gh 2.99 or later
  and an OAuth token or classic PAT. Free plans cap uploads at 10 MB.
- **Takt:** `taktcli file upload proof.mp4` prints a file id. Reference it as `media:<id>.mp4` in a
  comment (`taktcli task comment TASK --body "Proof: media:<id>.mp4"`), or attach it with
  `taktcli file attach <id> TASK`.
- **Linear:** upload with the `fileUpload` GraphQL mutation and PUT the bytes to the URL it returns,
  or put a markdown link to a URL in the comment; Linear ingests the file itself.

## Localhost tunnels

```bash
browserious tunnel open SESSION_ID --local-port 3000
```

The foreground command owns its WebSocket until interrupted and then closes its tunnels. The remote
browser reaches the forwarded service at `http://localhost:3000` (or the chosen `--remote-port`).
Use `--detach` for a persistent tunnel owned by the per-user local daemon:

```bash
browserious daemon start
browserious tunnel open SESSION_ID --local-port 3000 --remote-port 8080 --detach
browserious tunnel list
browserious tunnel close SESSION_ID --remote-port 8080
browserious daemon stop
```

Detached mode requires Unix-domain sockets; on an unsupported platform use foreground mode. The
daemon validates owner-only runtime directory, socket, and state paths and safely handles missing or
stale socket state. It proactively refreshes tunnel capabilities and atomically replaces the
transport during refresh; unrecoverable transport or refresh failures drop ownership. Its PID file
is a descriptor, not a reconnection mechanism. Stop, logout, and session deletion close owned
tunnels. `tunnel list` safely reports a stopped daemon as an empty list.

## Local and remote MCP compatibility

MCP is optional compatibility, not a richer interface or a second package. The canonical local
stdio command is:

```bash
browserious mcp
```

It uses the same credential precedence, store, refresh lifecycle, capability client, operations,
scopes (`browser:read browser:write tunnel`), and revocation path as the CLI. Configure a local MCP
host with a pinned wheel when reproducibility matters:

```json
{
  "mcpServers": {
    "browserious": {
      "command": "uvx",
      "args": ["--refresh", "--from", "browserious==0.2.0", "browserious", "mcp"]
    }
  }
}
```

The 0.2.0 compatibility release contains exactly two deprecated, transitional bridges:

- `python -m browserious_mcp`
- invoking `browserious` with zero arguments while both stdin and stdout are non-TTY

Both start the same stdio server and emit a deprecation diagnostic. Interactive zero-argument
`browserious` and `browserious --help` show CLI help. Do not configure the old no-argument form for
new hosts. Eventual MCP retirement removes the `mcp` verb, the temporary entry points, the
`browserious_mcp` module, MCP dependencies, parity/compatibility tests, and MCP documentation from
this same distribution; it does not migrate users to another artifact.

Optional remote MCP is available at `https://api.browserious.com/mcp`. It is stateless Streamable
HTTP. An OAuth-capable client follows this exact flow:

1. An unauthenticated MCP request returns `401` with `WWW-Authenticate: Bearer resource_metadata="https://api.browserious.com/.well-known/oauth-protected-resource/mcp"`.
2. Fetch that RFC 9728 protected-resource document. Its `resource` is
   `https://api.browserious.com/mcp` and its `authorization_servers` points to
   `https://api.browserious.com`.
3. Fetch RFC 8414 metadata from
   `https://api.browserious.com/.well-known/oauth-authorization-server`.
4. Register a public client at the advertised registration endpoint using the client's exact
   redirect URI.
5. Start authorization at the advertised endpoint with scopes
   `browser:read browser:write tunnel`, an authorization code challenge, and
   `code_challenge_method=S256`.
6. Exchange the code at the advertised token endpoint with the original PKCE verifier; rotate
   refresh tokens normally and revoke through the advertised revocation endpoint.

Claude Code's configuration command was sanitized and probed against the exact URL:

```bash
claude mcp add --transport http browserious https://api.browserious.com/mcp
```

Cursor and Windsurf onboarding remains manual-only; no completed client-specific flow is claimed.
Remote and local MCP enumerate the same tools, but remote `open_tunnel` and `close_tunnel` always
fail safely with guidance to use the CLI or local stdio MCP because a service-host process cannot
own a client-local port.

Public DNS is Cloudflare Anycast/proxied, and requests traverse Cloudflare → Caddy → FastAPI.
The local `192.168.1.3` address is an intentional host/VPN shortcut. Node callbacks send the explicit
`Browserious-Node/0.2.0` service User-Agent to avoid Cloudflare error 1010. This topology does not
imply an unverified streaming timeout guarantee.

## Troubleshooting

- `No Browserious credential is configured`: run `browserious login`; for headless use
  `browserious login --no-browser`.
- Authentication exit `3`: check `browserious whoami`, the selected API URL, and whether an explicit
  token is shadowing the stored login. Explicit/env credentials cannot refresh.
- `403`: the credential lacks the operation's scope. Device login requests `browser:read`,
  `browser:write`, and `tunnel`.
- `404` for a known session: sessions are owner-scoped; confirm the account/API origin and session
  ID. Browserious deliberately does not reveal another owner's session.
- `8` from a tunnel/operation: check `browserious status`, then `browserious daemon status` for a
  detached tunnel. Retry after connectivity returns; do not copy session tokens from output.
- Stale `uvx` behavior: pin the intended version and rerun with `uvx --refresh --from
  browserious==VERSION browserious ...`.
- MCP host starts CLI help: configure the explicit final argument `mcp`. The zero-argument bridge
  only applies when both standard streams are non-TTY and is temporary.
- Remote MCP tunnel error: use `browserious tunnel ...` or local `browserious mcp` stdio.
- Credential permission, ACL, symlink, or reparse-point error: fix ownership/security on the
  platform path; Browserious will not bypass validation.
