Documents how to use Chrome DevTools MCP to navigate authenticated web pages, extract data (tokens, configuration values), take screenshots, and handle login flows. Use when you need to interact with Buildkite, AWS Console, or other authenticated web UIs via the Chrome browser. Triggers when users ask about "browser auth", "extract token from browser", "navigate to buildkite", "chrome mcp", or need to scrape data from authenticated pages.
72
87%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Critical
Do not install without reviewing
Use the Chrome DevTools MCP server to interact with authenticated web pages (Buildkite, AWS Console, GitHub, etc.) through the user's existing Chrome browser session.
chrome://version)The MCP server is configured in ~/.config/opencode/opencode.json:
{
"mcp": {
"chrome-devtools": {
"type": "local",
"command": ["npx", "-y", "chrome-devtools-mcp@latest", "--autoConnect"]
}
}
}| Mode | Config | When to Use |
|---|---|---|
--autoConnect | Connects to running Chrome via DevTools discovery | Recommended. Uses existing browser with cookies/sessions. Requires Chrome 144+ and enabling remote debugging in chrome://inspect/#remote-debugging. |
--browserUrl | --browserUrl http://127.0.0.1:9222 | When Chrome is launched with --remote-debugging-port=9222. Requires restarting Chrome with the flag. |
| (default) | No flags | Launches a fresh Chrome instance with no cookies, extensions, or password manager. Not suitable for authenticated pages. |
--autoConnectchrome://inspect/#remote-debugging--browserUrl (Alternative)If --autoConnect doesn't work, restart Chrome with the debugging port:
# Quit Chrome first, then relaunch:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
--remote-debugging-port=9222 \
--user-data-dir="$HOME/Library/Application Support/Google/Chrome"Update the MCP config:
"command": ["npx", "-y", "chrome-devtools-mcp@latest", "--browserUrl", "http://127.0.0.1:9222"]Note: On macOS, --remote-debugging-port requires --user-data-dir to be
explicitly set (even if it's the default path). Without it, Chrome prints
"DevTools remote debugging requires a non-default data directory" and the
debugging server does not start.
navigate_page → take_snapshot → check for login page indicatorsLook for: "Login", "Sign in", "Welcome back", password fields, SSO buttons.
If logged out, stop and ask the user to log in manually. Never attempt to fill in credentials — the user's password manager and MFA handle this.
navigate_page(type="url", url="https://example.com/settings")Wait for the page to load. If redirected to a login page, see Step 1.
take_snapshot()The snapshot returns a text-based accessibility tree with uid identifiers
for each element. Use these UIDs to interact with elements.
Option A — From visible text (snapshot): Read the snapshot output to find the data. Token values, configuration settings, and other text are visible in the accessibility tree.
Option B — From hidden/copyable elements (JavaScript):
evaluate_script(function="() => document.querySelector('[data-token]').textContent")Option C — From clipboard (click-to-copy buttons):
click(uid="<copy-button-uid>")
evaluate_script(function="() => navigator.clipboard.readText()")take_screenshot()Use screenshots to confirm you're on the right page before extracting sensitive data.
1. navigate_page(url="https://buildkite.com/organizations/<org>/agents")
2. take_snapshot()
3. Find the token element in the snapshot (look for "Agent Token" heading)
4. Click "Reveal Agent Token" button if token is hidden
5. take_snapshot() again to read the revealed token
— OR —
evaluate_script() to extract it from the DOMThe token page shows the agent registration token used in terraform.tfvars
and AWS SSM Parameter Store.
1. navigate_page(url="https://eu-west-2.console.aws.amazon.com/...")
2. take_snapshot()
3. If redirected to SSO login, ask user to complete login
4. Extract data from console pages via snapshotsTip: AWS Console pages are heavily JavaScript-rendered. Use
wait_for(text=["Expected text"]) after navigation to ensure the page
has fully loaded before taking a snapshot.
1. navigate_page(url="https://buildkite.com/organizations/<org>/pipelines/<pipeline>")
2. take_snapshot() — check build status
3. take_screenshot() — capture visual evidenceAlways. Never automate login flows because:
Look for these indicators in the snapshot:
| Problem | Cause | Fix |
|---|---|---|
| Login page shown despite user being logged in | MCP connected to fresh Chrome instance, not user's browser | Switch to --autoConnect or --browserUrl mode |
navigate_page shows "page closed" | Previous page was closed by navigation | Use list_pages then new_page |
| Snapshot shows empty page | JavaScript hasn't rendered yet | Use wait_for(text=["expected content"]) before snapshot |
| "Verify you are human" Cloudflare challenge | Bot protection triggered | Ask user to complete challenge manually in browser |
| Port 9222 not responding | Chrome not started with --remote-debugging-port or macOS blocking | Use --autoConnect mode instead |
terraform.tfvars) — never include them in commit messages, logs, or documentation.817ee95
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.