Install and requirements
Requires Node 22.14.0 or newer and an installed stable Google Chrome on Linux or macOS. Linux needs a graphical display and a working Chrome sandbox. Windows browser hosting and secure file/secret output are not supported. Install the current 0.3.30 CLI release:target locators, DOM-backed refs, compact and interactive outlines, the new wait conditions, read-only scripts, WebMCP calls by name, element and file screenshots and isolated browser sessions, passkey prompt detection, back, forward and reload in live-view takeover, pageState observation timing, upload and secret-export capabilities in tool text, private download routing and bounded operation queuing; older peers do not provide every new capability. Native protocol remains 3 and the database schema is unchanged.
Installation does not download or launch Chrome. Agent-only help/file/secret/forward commands do not need a display or Chrome.
Start and pair
Local control path limits
The CLI stores its control sockets under the realHOME/.browser-mcp directory.
Before creating directories, launching any Chrome in a group, or requesting
pairing, it checks UTF-8 bytes, not character count, for both the private bind
path and the public local-control path. All local commands, including recover,
apply the same check. The conservative pathname budget reserves the terminating
NUL: 107 bytes on Linux, 103 on macOS. With the current socket names, this
leaves 64 / 60 bytes respectively for the absolute HOME path. Non-ASCII
characters may use multiple bytes. Some OS/Node combinations accept an additional
byte; the CLI deliberately does not rely on that behavior or on silent truncation.
stage=control-path reason=path-too-long reports only byte count and budget, not
the private path. Use a shorter real, privately owned HOME (0700) consistently
for start and local controls; a symlink is not a supported shortcut. For disposable
manual reviews, create and record a fresh private temporary HOME, not a shared or
predictable socket location. Do not delete locks or sockets to bypass this error.
Before relocating existing data, stop its CLI and Chrome, verify ownership and
resolve stale artifacts at their original location. Relocation is not automatic;
if the old path is unsupported or ownership is uncertain, retain it for qualified
operator review. Named profile data and credentials must not be discarded.
Other local-control failures report a fixed stage and allowlisted errno (or
operation-failed), never the raw exception/path. Post-launch host failures retain
stages such as pairing, runtime-setup, local-control or relay; Chrome’s
separate shutdown report does not mean host startup succeeded. The existing
ownership, permission, live-owner refusal and stale-artifact checks still apply.
WebMCP enabled by default
CLI 0.3.30 retains the WebMCP defaults introduced in 0.3.12 and enables WebMCP on every Chrome launch, equivalent to enablingchrome://flags/#enable-webmcp-testing. It passes --enable-features=WebMCP,WebMCPTesting,DevToolsWebMCPSupport for current and earlier Chrome feature names and the older DevTools protocol gate. Persistent, ephemeral and multi-profile launches all use these defaults; no manual flag or profile edit is needed.
Stop the old CLI before updating, then restart your named profile to apply the launch flags while retaining sign-ins. WebMCP still requires a supporting Chrome version and a site that registers tools. Enabling it does not invoke tools automatically or grant permissions.
Multiple local browsers
Each browser needs a different profile name. You can run separatebrowser start
commands in separate terminals today:
--profile flags to start two or more browsers in one foreground command:
status, pause, resume or stop with one --profile to control only that
browser. Closing or stopping one browser leaves the others running. Ctrl-C in the
group’s terminal closes every browser launched by that command. The command
stays running until all its browsers stop. A launch/runtime failure cancels the
group and waits for cleanup; an existing profile owner is never taken over.
--server, --chrome-path, --ephemeral, --live-view, --no-passkey-detection, --no-restore-tabs and --screenshot-max-edge apply to every profile
in a grouped launch. For different options or independent CLI lifetimes, use
separate terminals. With --ephemeral, each logical name still selects its own
pairing and local controls, but its Chrome data is throw-away. No --profile
means default. Repeated names are rejected; a busy profile requires a different
name, not deleting its lock. Local control and recovery commands accept only one
profile at a time.
Visible local controls
Use another local terminal with the same profile:pause blocks remote commands and closes the relay connection, without closing Chrome. resume removes that local pause and immediately reports state: "reconnecting", paused: false; it does not wait for the server or promise successful reconnection. Subsequent status may report disconnected during cleanup/retry, then authenticating or initializing, before connected. If the server is unavailable, the runtime remains unpaused and retries in the background. Calling resume when already unpaused leaves the current state unchanged. Check both state and paused; admission describes the operation queue/quarantine, not transport readiness. Re-observe remotely after connection before requesting fresh work; interrupted work is never replayed.
Remote agents cannot resume a local pause. Use the CLI status command to check whether the browser is paused or running. Revoking an MCP token removes that client: it ends that token’s sessions, in-flight commands and retained files, and keeps the runtime connected for other clients (see Authentication). Rotating the browser credential invalidates its saved credential and disconnects the runtime. For recovery, stop it, revoke/delete the old registration as appropriate, identify and remove only the exact private credential file for that server/profile, then start and approve a new pairing. The new registration needs new MCP tokens. Do not remove the Chrome profile, directory trees or unrelated credential files. Deleting the registration removes its access credentials, not your personal Chrome files.
The runtime stays in the foreground and controls its own Chrome over a fresh loopback CDP endpoint: Ctrl-C or stop closes its Chrome. Signal handlers are active from the beginning of startup. Ctrl-C during startup cancels remaining work, waits for an in-progress bounded Chrome launch, and then closes resources already acquired. Repeated Ctrl-C or other termination signals wait for the same cleanup instead of bypassing it. Pairing waits are cancelled. If one cleanup stage fails, the other independent safe stages are still attempted and the errors are reported afterwards.
Chrome is always headed and omits the flags that enable WebDriver mode: --enable-automation, --headless, --remote-debugging-pipe and --remote-debugging-port=0. The native navigator.webdriver getter remains false; no page script overrides it. To detect passkey prompts, which Chrome shows outside the page and which block input to the tab, the runtime adds a script to every page that wraps navigator.credentials.get and create; pages can notice it. Start with --no-passkey-detection to add no passkey script, leaving navigator.credentials native; agents and live view then cannot tell when a passkey prompt blocks a tab. Each launch selects a nonzero loopback port and connects only to the WebSocket endpoint announced by that newly spawned Chrome process. CDP is unauthenticated local browser control, not an MCP-authenticated endpoint: other local processes can bypass MCP permissions and local pause through it. Use a trusted host and never expose or forward this port.
There is no detach/reattach mode, and a restart creates a new runtime instance rather than attaching to an old Chrome process. Stop before replacing CLI binaries, then restart the same named profile to retain sign-ins and reopen its tabs. Live view requires explicit local --live-view on browser start and is off by default. It also lets the signed-in owner take control of the streamed tab from the dashboard or an MCP App; a local pause or stop still applies.
Relay reconnect, CLI restart and Chrome restart are different events. A reconnect never authorizes replaying uncertain clicks, form submissions, scripts or file attachments. Stale document refs/choosers must be reacquired. Forwarding and bulk streams do not transparently resume after disconnect. Read status and inspect results before retrying.
Tabs after a restart
A named profile, includingdefault, reopens the web pages that were open when its browser last stopped, whether it stopped with Ctrl-C, stop, by closing the last Chrome window or in a crash. Start the same profile again and its tabs come back as tabs in one window, in the order they were first opened:
http, https and file addresses are saved, from the first 100 tabs opened. Blank tabs, Chrome’s internal pages such as chrome://settings, data: and blob: pages, addresses with an inline user name or password, addresses longer than 8,192 characters, and Incognito and Guest windows are left out.
Reopening loads each address again in a new tab, as if you typed it into the address bar: the request carries all of the site’s cookies, including SameSite=Strict ones, and no Referer, even when a page first reached the address through a link, pop-up or redirect from another site. Back and forward history, form contents, scroll positions and window layout are not restored, and a page that showed the result of a form submission is requested again with a plain request. Loading an address again repeats whatever visiting it does, such as using up a one-time sign-in link. Tabs reopen once the runtime’s page protections are in place (private download routing, the service-worker block and passkey detection), as for tabs agents open, and before the browser connects to the server: many tabs delay the connection by several seconds.
Reopened tabs are user tabs, like tabs you open yourself, and every agent session sees them in browser_list_tabs, with new tab IDs. That includes an agent’s temporary tabs that were still open: they are not closed automatically anymore, so close them yourself. Tab IDs from before the restart are not valid anymore.
Start with --no-restore-tabs for a blank window, for example when a reopened page causes trouble. The saved tabs are then forgotten: the next start reopens the tabs that were open when this browser stopped. Ephemeral profiles (--ephemeral) never save or reopen tabs.
The list is stored in ~/.browser-mcp/profiles/<profile>/open-tabs.json, owner-only (0600) in the private profile directory, where Chrome’s own history and session files hold the same addresses. It contains the addresses only, no titles, cookies or page contents. A file that is not a private regular file owned by you, or not a valid list, is not read: the browser starts without reopening tabs, says so and replaces the file. To forget the saved tabs, start once with --no-restore-tabs, or delete the file while the browser is stopped.
Keep Chrome’s own On startup setting (chrome://settings/onStartup) at Open the New Tab page in the dedicated profile, and do not pin tabs there. With Continue where you left off, or with pinned tabs, Chrome opens pages itself during startup, before Browser MCP connects, so they load without its page protections; with Continue where you left off, Chrome also adds one more blank tab at every start. The CLI reports such tabs at startup and does not open a saved tab that is already open a second time. Chrome’s own Restore pages? offer after a crash is turned off (--hide-crash-restore-bubble), because the CLI reopens the tabs itself.
Isolated browser sessions
Agents can create browser sessions in a browser to be signed in to the same site as several accounts at once, for example to test sharing or permissions between two users:browser_create_session, browser_list_sessions, browser_end_session, and browser_open_tab with session (tools). Each browser session is a Chrome of its own with its own profile, so its cookies, site storage, cache and history are separate from the profile’s own Chrome (the default session, where tools without a session work as before) and from each other. A new browser session starts empty: it never sees the default session’s sign-ins.
- Shared by the browser’s agents. A browser session belongs to the CLI profile, not to an agent session or MCP token: every agent of that browser can list it and open tabs in it, still signed in, until an agent ends it. Separate CLI profiles have separate browser sessions.
- Started on demand, in the background. A browser session’s Chrome starts when a tab is first opened in it, with the same checks, flags and page protections as the default Chrome (private download routing, the service-worker block and passkey detection). It starts without a window and opens its first tab in a minimized window, so it does not come to the front. Its windows have their own color, and Chrome’s profile menu shows the session’s name.
- Stopped when idle, and with the CLI. A browser session’s Chrome that has had no tabs for 10 minutes is closed, and every browser session’s Chrome closes with the CLI (Ctrl-C or
stop), like the default Chrome. The next tab opened in the browser session starts it again, still signed in: its profile stays on disk. Its tabs are not reopened. Its Chrome restarts with--restore-last-sessionbut without a startup window, so it keeps cookies that last only until the browser closes (“session cookies”) if it had tabs open when it stopped, and reopens no pages. As in any Chrome, closing a browser session’s last tab can end such sign-ins. - Ended by an agent. Ending a browser session closes its Chrome and then deletes its profile directory, with its sign-ins, cookies, site data and history. It is deleted only once no process uses that profile, and only a directory the CLI created for a browser session, never a
--profiledirectory. The default session cannot be ended. - Limits. A browser holds at most 20 browser sessions besides the default. Each running one is a full Chrome: on Linux, a browser session’s Chrome with one tab used about 310 MB (proportional set size, 10 processes), and one without tabs about 230 MB, as much as the default Chrome.
- Status.
browser-mcp browser status --profile worklists the browser sessions with whether their Chrome runs and their tab counts. The terminal reports when a browser session is created or ended and when its Chrome starts, stops or quits.
~/.browser-mcp/sessions/<profile>/: sessions.json (each session’s ID, name, color and creation and last-use times; owner-only, 0600) and one private (0700) Chrome profile directory per browser session, named by its ID, which also holds its runtime.lock and run directory while its Chrome runs. An --ephemeral browser’s sessions live in ~/.browser-mcp/sessions/ephemeral-<id>/ and are deleted when it stops. If sessions.json is not a private regular file owned by you, or not a valid list, the CLI starts without browser sessions and says so; the default session works as usual. Keep the file and the directories beside it intact, and do not edit them by hand.
If a browser session’s Chrome quits by itself (you quit it, or it crashes), the terminal says so and the browser session stays; the next tab opened in it starts it again. A crash of the CLI can leave a browser session’s runtime.lock behind, and that browser session then does not start: stop the old CLI and its Chrome processes and run browser-mcp browser recover for the profile (see below).
Chrome exit diagnostics
Unexpected Chrome termination prints the timestamp, profile/instance, PID, exit code or signal, shutdown intent and diagnostic file path, and returns a nonzero CLI result. Ctrl-C, local stop and normal browser exit are not reported as crashes. A transport/context disconnect alone is not proof of a Chrome crash; a bounded grace period allows the child exit event to arrive, and cleanup-generated signals are marked separately. Safe incident JSON lives in~/.browser-mcp/diagnostics/, outside disposable run and ephemeral profile directories. It survives cleanup and restart. Files are owner-only (0600), in private directories (0700). Records include CLI/Chrome versions when available, fixed lifecycle reasons, diagnostic classifications and counters. Chrome stderr is not copied into logs: only fixed diagnostic labels and the last 32 classified events are retained, with no raw lines, page content, credentials, CDP endpoints or full Playwright errors. There is no raw logging mode or automatic upload.
Each record is limited to 32 KiB. Writes rotate recognized safe records to at most 20 and remove those older than 30 days; unknown or unsafe files are left alone. If private storage is unavailable, the terminal retains the original failure and says the record could not be saved. An abruptly killed CLI cannot guarantee a record.
For deeper investigation, macOS may retain .ips reports in ~/Library/Logs/DiagnosticReports or /Library/Logs/DiagnosticReports. Linux installations may provide coredumpctl list or /var/crash. Chrome’s chrome://crashes page and its profile’s Crashpad or Crash Reports directory may have additional reports, depending on version and reporting settings. Raw reports may contain sensitive data; inspect locally and do not attach them unreviewed. The CLI never reads or uploads these files. Their retention is independent of the safe JSON; files inside ephemeral profiles are removed with those profiles.
Explicit crash-artifact recovery
A crash can leave a named profile’s runtime lock and local control socket behind, and the runtime locks of its browser sessions. They are deliberately not removed automatically, and startup will not delete or take over an existing path. First stop the prior CLI and its dedicated Chrome processes (the profile’s and its browser sessions’) and prevent concurrent startup or manual artifact changes. Then run the operator command with the logical profile name, never a filesystem path:~/.browser-mcp/sessions/<profile>/. The Chrome profiles and their sign-ins, downloads, run data, and Chromium singleton artifacts are preserved. If no recovery artifacts exist, it leaves the profile unchanged.
Recovery is intentionally conservative. It refuses rather than guesses when the recorded PID is live or may have been reused, the owner or process scan is uncertain, a possible profile process survives, a control listener is live or cannot be proven stale, ownership or private permissions are unsafe, an ancestor or artifact is a symlink or other unexpected type, an artifact changes during checking, Chromium ownership is foreign or unrecognized, or a socket is orphaned without matching lock provenance. Do not work around refusal by deleting paths blindly or creating a replacement lock.
There is no automatic crash cleanup and no reattachment to the old Chrome process. If recovery refuses, retain the exact paths printed in the error and investigate the prior owner. Only a qualified operator who can independently prove exact path provenance, private ownership, unchanged artifact identity, and absence of every possible owner or listener should consider manually removing that exact stale socket; never remove profile directories or Chromium singleton files.
MCP client setup
Create an expiring token for the connected browser in the dashboard. Store the token in your client’s secret settings and use its Streamable HTTP transport:browser_list_tabs, then a temporary tab on https://example.com. File staging and secret export are separate explicit capabilities; see data and secrets.
Screenshot size
Screenshots arrive within 2000×2000 pixels: Chrome scales larger captures down, and the runtime maps the points an agent reads from an image back to the page through itsscreenshotId (screenshots). Some MCP clients and models shrink large images again before the model sees them; the points the model reads then no longer match the delivered image, and coordinate actions miss. If yours does, start the CLI with --screenshot-max-edge set to that limit, a whole number of pixels from 512 to 2000 (default 2000), for example browser start --profile work --screenshot-max-edge 1568 for a model that resizes images whose longer side exceeds 1568 pixels. A model that also limits the total pixel count (to about 1.15 megapixels) needs a smaller edge, such as 1280 for common 16:9 and 16:10 viewports. Smaller images make small text harder to read; agents can crop to read detail. Chrome renders a scaled-down screenshot afresh, so the first one in a tab can take up to about a second longer, as a full-page screenshot can. The limit applies to images only: a screenshot delivered as a file (deliver: "file" or "both") keeps its full resolution, the tab’s device pixels, up to 8,192 pixels on the longer side.
Update safely
The dashboard shows native version, protocol, advertised capabilities and an update-required indicator. Protocol 3 is the native contract; unsupported commands fail closed. Stop the runtime, install a compatible CLI version, then restart the same named profile. Do not delete credentials or profiles as an update mechanism. There is no silent unrestricted auto-updater. Chrome itself should be maintained through its normal trusted update channel.Troubleshooting
- Offline: check local status, approval, exact server URL, TLS and proxy WebSocket support.
- Update required: use a verified compatible CLI/server pair; do not bypass capability checks.
- Profile busy: use a different
--profileto launch another browser, or stop the owning runtime; do not delete locks or another process’s files blindly. - Internal/viewer operation unavailable: document targets are not denied by URL/origin policy, but Chrome may refuse individual operations. Inspect capabilities and the actual failure; unprobed support is not a guarantee. For source document bytes use the site’s/viewer’s download and the existing transfer tools. See document access.
- Unknown action outcome: inspect before deciding any next action; never blindly replay.
- Clipboard/live view unavailable: these are capability/platform dependent and require local permission/opt-in, not automatic fallback.