Browser Chrome
Use this skill for Chrome browser automation, UI inspection, screenshots, console/network debugging, and Chrome DevTools MCP workflows.
Contract
- Inputs: the browser automation or debugging need and whether authenticated, saved, or persistent session state is required.
- Outputs: a selected safe form (
headless-disposableorheaded-persistent) and the matching operational DevTools MCP server. - Non-goals: reading or exporting passwords, cookies, tokens, or private profile files; silently using a personal profile; or claiming that DevTools access is sandbox isolation.
Mode selection
Default to headless unless the task needs an authenticated/persistent browser state. When MCP is available, first use browser-chrome-control to make the policy explicit, then use the returned DevTools MCP server for actual browser actions.
Use headless when:
- the page is public or anonymous;
- the task is a simple fetch, screenshot, responsive/mobile check, or local UI smoke test;
- multiple agents may run in parallel;
- current user cookies, saved passwords, or existing sessions are not required.
Use headed when:
- the task requires login/logout;
- the task requires current auth in external or internal services;
- the task needs saved cookies, passwords, autofill, extensions, or persistent profile data;
- the user explicitly asks to use the existing browser session/profile.
Scripts
Resolve script paths relative to this skill directory.
scripts/control-mcp.sh— MCP control/session policy server exposingbrowser_chrome_*tools.scripts/check-opened.sh— check whether headed or headless Chrome is reachable.scripts/open-headed.sh— open or reuse a headed persistent Chrome profile.scripts/open-headless.sh— open a fresh isolated headless Chrome with a unique profile and port.scripts/close-headed-tab.sh— close a headed browser tab/page by DevTools page id or URL substring.scripts/close-headless.sh— close a headless browser instance and remove its temporary profile.scripts/mcp.sh— wrapper used by MCP entries; exposed asbrowser-chrome-mcpby the installer.
Headless protocol
For simple fetches and checks that do not need persistent session data:
- Call
browser_chrome_acquire_sessionon MCP serverbrowser-chrome-controlwithform: "headless-disposable". - Use the returned guidance: MCP server
browser-chrome-headlessforchrome_devtools_*actions. - A fresh headless Chrome instance must be created for the task by the headless MCP wrapper. It must use a unique port and temporary user-data-dir.
- The instance may be local or remote via LAN, Tailscale, or SSH tunnel. If remote,
BROWSER_CHROME_HEADLESS_START_COMMANDandBROWSER_CHROME_HEADLESS_CLOSE_COMMANDmust define start and cleanup. - Do the browser work.
- Close pages/tabs you opened when possible.
- The wrapper must close the headless instance after the MCP server exits. If you manually opened headless with
scripts/open-headless.sh, close it withscripts/close-headless.sh <id>.
Do not reuse a headless instance across unrelated or parallel agents.
Headed persistent protocol
For tasks requiring auth/session/profile data:
- Call
browser_chrome_acquire_sessionon MCP serverbrowser-chrome-controlwithform: "headed-persistent"and a short purpose, or callbrowser_chrome_assert_persistentwhen only validation is needed. - The control MCP acquires a cross-process advisory lease, delegates open/reuse to
scripts/open-headed.sh, and verifies the endpoint. - Use the returned guidance: MCP server
browser-chrome-headedforchrome_devtools_*actions. - Do not spawn duplicate headed Chrome for the same profile, and do not fall back to headless or disposable headed when saved auth/session/profile state is required.
- Close only tabs/pages opened by the agent. Do not close the whole headed browser unless the user explicitly asks.
- When done, call
browser_chrome_releasewith the returnedleaseId. Release only drops the control lease; it must not close the headed browser.
If the headed profile appears to be running but the DevTools endpoint is not reachable, stop and report the blocker instead of opening another browser with the same profile.
MCP usage
Prefer the control-first flow:
mcp({ server: "browser-chrome-control" })
# call browser_chrome_status, browser_chrome_acquire_session, or browser_chrome_assert_persistent
mcp({ server: "browser-chrome-headless" }) # for returned headless-disposable guidance
mcp({ server: "browser-chrome-headed" }) # for returned headed-persistent guidance
Then call the needed chrome_devtools_* tools exposed by the selected DevTools server. The control MCP is not a full chrome-devtools-mcp proxy.
Safety
The headed browser may contain the user's active accounts, cookies, passwords, and private data. The default local headed profile is a dedicated profile under BROWSER_CHROME_HOME; it is not the normal personal Chrome profile. A custom endpoint or start command may still point to an authenticated profile, so that choice must be explicit.
- Do not inspect, export, print, or copy cookies, tokens, passwords, local storage, or private profile files unless the user explicitly asks.
- Do not silently attach to a personal profile or use headed mode for public/anonymous tasks.
- Do not perform account-changing or destructive actions without explicit user direction.
- Restrict DevTools endpoints to the intended host/network. Reachability is not sandbox isolation or authorization.
- Treat DevTools access as equivalent to controlling the user's browser session.
For more detail, read references/mode-selection.md, references/mcp-config.md, and references/security.md.