@ricsam/browser-mcp 0.3.5 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,7 +4,7 @@ Native Chrome companion. Requires Node >=22.14.0 and an installed
4
4
  Google Chrome. No browser download or startup occurs during npm installation.
5
5
 
6
6
  ```sh
7
- npm install -g @ricsam/browser-mcp
7
+ npm install -g @ricsam/browser-mcp@0.3.7
8
8
  browser-mcp browser start --server https://browser-mcp.click --profile work
9
9
  browser-mcp browser status --profile work
10
10
  browser-mcp browser pause --profile work
@@ -23,10 +23,90 @@ locally (off by default); remote viewers cannot enable it.
23
23
  Foreground pipe lifecycle: keep the CLI running. Ctrl-C, stop, or normal CLI exit
24
24
  closes its Chrome. There is no detach or automatic CDP reattachment. Each launch
25
25
  has a fresh instance identity. Relay reconnect does not replay admitted actions.
26
+ Signals received during launch cancel further startup and wait for the bounded
27
+ Chrome launch (up to 30 seconds) before closing acquired resources. Repeated
28
+ signals wait for that same cleanup. Pairing waits are cancelled too. A cleanup
29
+ error is reported after the other safe cleanup stages have been attempted.
30
+
26
31
  Crash locks are deliberately not removed automatically: verify the exact prior
27
32
  owner and Chrome processes are stopped before operator recovery. Retained crash
28
33
  files are not automatically scavenged. Never remove directories by name prefix.
29
34
 
35
+ ### Multiple browsers
36
+
37
+ Use a different profile for each browser. Repeat `--profile` to launch two or
38
+ more isolated Chrome instances in one foreground command (CLI 0.3.7 or newer):
39
+
40
+ ```sh
41
+ browser-mcp browser start --server https://browser-mcp.click --profile work --profile personal --profile testing
42
+ # From another terminal, control only the chosen browser:
43
+ browser-mcp browser pause --profile work
44
+ browser-mcp browser status --profile personal
45
+ browser-mcp browser stop --profile work
46
+ ```
47
+
48
+ Each profile has separate sign-ins, pairing credentials, local controls and a
49
+ browser registration in the dashboard. Approve each new profile's labeled link,
50
+ then configure its own MCP URL/token. Closing or stopping one browser leaves the
51
+ others running. Ctrl-C closes all browsers started by that command, and the CLI
52
+ exits after the last browser stops. A launch/runtime failure stops the group and
53
+ waits for cleanup; it never takes over an existing profile.
54
+
55
+ `--server`, `--chrome-path`, `--ephemeral` and `--live-view` apply to all profiles
56
+ in that invocation. With `--ephemeral`, each profile name still identifies its
57
+ pairing and local controls, but its Chrome data is throw-away. Omitting
58
+ `--profile` selects `default`; duplicate profile names are rejected.
59
+
60
+ Alternatively, run separate `browser start` commands with different profiles in
61
+ separate terminals (also supported in 0.3.6). This lets you choose different
62
+ options and independent CLI lifetimes. Never launch two owners of the same
63
+ profile; use `--profile personal` rather than deleting a busy profile's lock.
64
+ Local control and recovery commands accept one profile at a time.
65
+
66
+ ### Explicit crash recovery
67
+
68
+ After stopping the prior host and its dedicated Chrome, run:
69
+
70
+ ```sh
71
+ browser-mcp browser recover --profile work
72
+ ```
73
+
74
+ Recovery supports Linux/macOS and the 0.3.5 lock format. It removes only the
75
+ verified stale control socket and then `runtime.lock`; profile, downloads and run
76
+ data are retained. It never removes Chromium `SingletonLock` artifacts. Recovery
77
+ requires a definitely absent owner PID (PID reuse and permission errors refuse),
78
+ a successful process scan with no possible profile process, and an absent socket
79
+ or a socket that explicitly refuses connections. A live listener, uncertain scan,
80
+ foreign host singleton, unsafe permissions/symlinks or changed artifact refuses
81
+ recovery with exact paths. A socket without lock provenance is never deleted.
82
+
83
+ Root, profiles and profile directories must belong to you and have mode 0700;
84
+ lock/socket artifacts must be private and owned by you. Run only one recovery,
85
+ with no concurrent startup, shutdown or manual artifact changes. The existing
86
+ runtime lock remains until socket cleanup finishes; no extra crash guard is created.
87
+ A crash can retain a small `c-*` private socket-binding directory containing its
88
+ `ownership.json`. These do not block restart and are not scavenged by recovery;
89
+ never delete them by prefix.
90
+
91
+ For a socket without lock provenance, recovery deliberately refuses. Do not create
92
+ a replacement lock. First stop all hosts that could use this profile, prevent new
93
+ starts, and inspect the exact socket/profile paths from the error:
94
+
95
+ ```sh
96
+ ps -axww -o pid=,command= # inspect for the exact profile and surviving Chrome
97
+ ls -ld /exact/root /exact/root/profiles /exact/profile
98
+ ls -l /exact/control-HASH.sock
99
+ lsof -n -U # inspect for the exact socket and any open owner
100
+ ```
101
+
102
+ No output from `lsof` alone proves nothing if permissions or process visibility are
103
+ limited. A qualified operator must establish provenance separately, verify each
104
+ ancestor is not a symlink, current-user ownership/private permissions, no profile
105
+ process or listener, and an unchanged socket inode. Only then may that operator
106
+ manually unlink that exact socket (never profile directories or Chromium singleton
107
+ files). Otherwise retain it and investigate. Socket names hash the logical profile
108
+ name (`work`), not its absolute directory, preserving 0.3.5 compatibility.
109
+
30
110
  Browser hosting supports Linux and macOS. Linux requires a graphical display
31
111
  and working Chrome sandbox (unprivileged user namespaces or a vendor-supported
32
112
  sandbox). Windows browser hosting and secure file/secret output are not supported.