browser-for-ai
browser-for-ai is a CDP-native MCP server that lets an AI agent drive a real Chrome — inspecting network/console like DevTools, operating pages robustly, and reverse-engineering a site's API flow into runnable code.
Sessions & lifecycle — launch a throwaway (
fresh) orattachto a debug-port Chrome for real logins; incognito, named persistent profiles, mobile/desktop device presets, multi-session + tab management (switch/close tabs, auto-follow page-opened tabs, self-heal closed/detached tabs), cache clearing, hard reload, and unfreezing a page whose JS is pinned.Navigate & read — go to URLs, report url/title/readyState/viewport, snapshot ref-annotated DOM (
e1, e2, …), find elements by text/ARIA role/CSS, read/search page text, screenshot viewport/full page/element, evaluate JS with a time budget.Interact — click, type, fill, select, key combos, hover, scroll, upload files (by ref or selector); raw coordinate clicks, touch taps and drags for canvas/WebGL; and
page_batchto run a whole multi-step sequence in one round-trip with one combined delta.See-then-click vision —
page_lookreturns a 1:1 screenshot with numbered badges (Set-of-Mark) on every clickable element plus a legend, so you pick a number and click by ref — no coordinate math.Deep network inspection — list requests with filters, fetch one request in full (wire-accurate headers incl. cookies/signing headers, text + binary bodies), WebSocket frames, failures, still-pending hangs, slow calls, and wait-until-a-request-appears instead of sleeping.
Traffic shaping — block / mock / modify requests via CDP Fetch, and throttle network (offline / 3G / 4G / custom) plus CPU slowdown.
Console — list console messages (filterable) and errors/uncaught exceptions with stack traces.
Reverse-engineer API flows — mark a flow, export as JSON or HAR, synthesize runnable replay code (curl / TypeScript / Go / Python) with cross-call dependencies auto-chained into variables, optional secret redaction, and
flow_replayto actually execute it and verify ✓/✗ per call.Persistence & safety — save/restore cookies + local/sessionStorage by name; every call is time-bounded (no hangs, runaway scripts terminated) and buffers are ring-bounded for long sessions.
Note: it is a local, developer-facing inspection tool — cloud browsers, stealth/anti-bot evasion and proxies are out of scope by design.
Provides CDP-native control of Google Chrome, enabling page navigation, rich interaction (including canvas/WebGL coordinate & touch), full network/console inspection, traffic shaping, session persistence, and reverse-engineering site API flows into runnable code.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@browser-for-ai Reverse engineer the login flow on example.com into runnable code"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
browser-for-ai (bfa)
English · ภาษาไทย
A CDP-native MCP server that lets an AI agent (Claude Code and any other MCP client) drive a real Chrome at full depth — reading the network and console the way a human does with DevTools open, operating the page robustly, and reverse-engineering a site's API flow into runnable code.
Why bfa
The things a screenshot-only browser tool can't do:
⭐ Turn a real session into runnable code. Mark a flow, perform it in the browser, and bfa synthesizes replay code (curl / TypeScript / Go / Python) with cross-call dependencies chained automatically — an auth token from one response becomes a variable the next request re-uses, not a baked-in literal.
flow_replaythen runs it for real to prove the reversal reproduces.🔬 See the whole network. Full request/response bodies (text and binary base64), the complete on-the-wire headers (
Cookieand custom signing headers included, merged from CDP ExtraInfo), timing, redirect hops, and WebSocket frames — surfaced by the exact question you're asking:failures,pending(hangs),slow.🎮 Drive anything — by ref, by sight, or by pixel. Ref / CSS interaction, raw coordinate + touch for
<canvas>/ WebGL, and see-then-click:page_lookreturns a screenshot with a numbered badge on every clickable element (Set-of-Mark), 1:1 with CSS px, so the model reads the picture and clicks by number — no coordinate math, no misclicks. Every action reports the network / console / URL delta it caused.🧪 Shape traffic. Block / mock / modify requests, and throttle to Slow 3G / offline / custom bandwidth with CPU slowdown.
🗂️ Real sessions. Many concurrent sessions, incognito, attach to your logged-in Chrome, save/restore cookies + storage, and complete cache clearing.
🎯 Drives the right tab, on a viewport that stays put — game after game. The session you launch is the active one and every launch loads the URL you gave (it never silently reuses an earlier game's tab); bfa auto-follows a tab the page opens and self-heals a detached / closed / chrome-error tab (actions re-attach and retry;
browser_recoverre-attaches a stale frame or hands you a fresh tab) instead of forcing a relaunch. Launch withdevice:"mobile"for a stable 390×844 phone viewport (touch on, sopage_tap_atandpage_batch {action:"tap_at"}drive Cocos/canvas games) that will not self-shrink, so coordinates stay accurate across a whole 12-game batch.⚡ Fast, and it never hangs.
page_batchruns a whole sequence in one round-trip and can end with a look; actions settle on quiet instead of fixed sleeps;page_wait_for/net_waitreturn the moment a condition holds. Every call is time-bounded: a runaway script is terminated (page_evalbudget,browser_recover),browser_closeforce-kills an owned Chrome that won't exit, and the recorder is ring-bounded for day-long sessions.
How it compares
Capability | bfa | typical browser MCPs |
Reverse a captured flow → runnable code, dependency-chained + replay-verified | ✅ | ✗ (at most Playwright-script codegen from UI actions) |
Full response bodies (text + binary) & WebSocket frames, on by default | ✅ | mostly metadata only |
Secret redaction in the emitted code | ✅ | ✗ |
Coordinate + touch interaction for canvas / WebGL | ✅ | some (vision mode) |
Attach to your logged-in Chrome | ✅ | ✅ (common) |
Network / CPU throttling presets | ✅ | some |
Multi-step batch + see-the-result in ONE call; bounded calls, runaway-script recovery | ✅ | rare |
Cloud-scaled browsers · stealth · proxies · CAPTCHA | ✗ (local by design) | some cloud tools |
bfa is a local, developer-facing inspection & reverse-engineering tool, not a cloud scraping farm — that focus is why the first three rows are rare elsewhere.
Related MCP server: Browser-MCP Navigator
Requirements
Node.js ≥ 20
Google Chrome installed (or set
BFA_CHROME_PATHto your Chrome binary)
Install
Published on npm as browser-for-ai — no clone or build required.
# zero-install (recommended) — pulls the latest and runs on demand
npx -y browser-for-ai
# …or install globally, exposing a `browser-for-ai` command
npm install -g browser-for-aigit clone https://github.com/icueth/browser-for-ai.git
cd browser-for-ai
npm install
npm run build # → dist/server.jsRegister with an MCP client
Claude Code — via the published package (no path needed):
claude mcp add browser-for-ai --scope user -- npx -y browser-for-aiVerify with claude mcp get browser-for-ai (should say ✔ Connected). Tools load into a new session, so start a fresh Claude Code session afterward.
AgentSpace ships browser-for-ai as a default MCP server (npx -y browser-for-ai) — it appears under Settings → MCP / Integrations out of the box.
Any MCP client (raw stdio config):
{ "command": "npx", "args": ["-y", "browser-for-ai"] }claude mcp add browser-for-ai --scope user -- node /absolute/path/to/browser-for-ai/dist/server.jsIf
nodecomes from a version manager (nvm, asdf, …), pass the absolute path to the node binary — the MCP server is spawned by a non-interactive shell that won't resolve aliases.
Quick start
browser_launch { "mode": "fresh", "url": "https://example.com" } // real window
page_screenshot
net_list // recent requests
net_failures // anything that errored
net_pending // anything still hanging
page_snapshot // ref-annotated DOM
page_click { "selector": "#login" }
net_get { "url": "/api/login" } // one call in full: headers + bodies
browser_close { "all": true }Sessions
browser_launch { mode, url?, port?, profile?, incognito?, headless?, viewport? }
fresh— launch our own Chrome (headful by default;headless: truefor none).attach— connect to a Chrome started with--remote-debugging-port(onlyportis used; default9222).incognito: true— isolated context, no prior state.Profiles. No
profile→ ephemeral temp profile wiped on close. A named{ "profile": "work" }persists under~/.bfa/profiles/workso logins survive. Two concurrent sessions on the same named profile collide; unnamed ones are always safe.device: "mobile"— a stable 390×844 phone viewport (dpr 3, mobile layout + UA) that does not track the OS window, so it never self-shrinks and click coordinates stay put. Use it for phone / PG-style games.device: "desktop"is 1280×800. An explicitviewportoverrides a preset; with neither, the page tracks the real window (which can resize).Viewport at launch, or
page_set_viewport { device }/{ width, height }on a live session.
One Chrome per job. browser_launch reuses a matching open session (same incognito /
profile / headless) and just navigates it to url — it does not start another Chrome; pass
new: true to force a second browser. Owned sessions that sit idle auto-close after
BFA_IDLE_MINUTES (default 20; 0 = never), at most BFA_MAX_SESSIONS (default 3; 0 = unlimited)
stay open (the least-recently-used is evicted), browser_sessions shows each one's idle time, and a
new server start kills Chromes orphaned by a bfa that died. Attach sessions (your own Chrome) are
never reaped. Still: browser_close { all: true } when a job is done.
The session you launch becomes the active one; a second launch makes that one active.
In fresh mode bfa auto-follows a tab the page opens and self-heals to another live tab
if the driven one closes. Manage with browser_sessions, browser_use { sessionId },
browser_tabs, browser_use_tab { index }, browser_close. Most tools accept an optional
sessionId; without it they target the active session.
Tool reference (52)
Sessions & lifecycle
tool | purpose |
| launch fresh / attach a session |
| list open sessions |
| set the default session |
| list a session's tabs/targets |
| switch the driven tab (carries recorder + intercept rules; bfa auto-follows page-opened tabs in fresh and attach mode) |
| close one tab by index without closing the session (heals to a live tab if it was the driven one) |
| close one session, or |
| clear cache + cookies + storage |
| bypass-cache reload |
| unfreeze a page whose JS is pinned (terminate script → scripts off → still readable/closable) |
Navigation, state & read
tool | purpose |
| navigate to a URL |
| url, title, readyState, viewport |
| resize a live session's viewport |
| compact, ref-annotated DOM (source of element refs) |
| find element(s) by text / ARIA role / CSS → refs (targeted vs snapshot) |
| read/search the page's text content (optionally by selector + query) |
| see-then-click: 1:1 screenshot with numbered badges on every clickable element + legend → |
| wait until a selector / text / URL / network-idle condition holds (instead of sleeping) |
| delta since last observe — new console/network/URL/DOM |
| PNG of viewport, full page, or one element |
| evaluate JS in the page → value; opt-in |
Interaction
tool | purpose |
| click a ref / selector (reports the delta) |
| type into a field ( |
| fill several fields in one call |
| choose an |
| press a key or combo (e.g. |
| hover an element |
| scroll the window, or an element into view |
| attach file(s) to a file |
| click at raw |
| touch-tap at |
| drag between two points/elements |
| many steps in one call (fill → click → wait_for …, target by selector/text/ref), one combined delta, optional final look |
Network (deep read)
tool | purpose |
| recent requests (filter by url/method/type/status; |
| one request in full: headers, request & response bodies |
| 4xx/5xx + transport failures with error detail |
| requests still in flight (hang candidates) |
| finished requests slower than a threshold |
| WebSocket connections + recent frames |
| wait until a matching request appears / settles (only requests since your last action) |
Traffic shaping & emulation
tool | purpose |
| block / mock / modify matching requests (CDP Fetch) |
| list active intercept rules |
| remove intercept rules |
| emulate network (offline / 3G / 4G / custom) + CPU slowdown |
Console
tool | purpose |
| console messages (filterable by regex) |
| errors + uncaught exceptions with stacks |
API-flow extraction
tool | purpose |
| mark the start of a flow in the recording |
| export captured calls as JSON summary or HAR |
| generate replay code (curl/ts/go/python) with deps chained |
| execute the reversed flow for real (Node fetch) to verify |
Session persistence
tool | purpose |
| save cookies + local/session storage to |
| re-apply a saved session (origin-scoped) |
Reverse-engineering an API flow → runnable code
The flagship workflow. A page logs in with POST /api/login (returns a token),
then calls GET /api/me with Authorization: Bearer <token>:
browser_launch { "mode": "fresh", "url": "https://app.example.com/login" }
flow_mark { "label": "login flow" }
page_fill { "fields": [
{ "selector": "#user", "value": "alice" },
{ "selector": "#pass", "value": "s3cret" }
]}
page_click { "selector": "#submit" }
flow_synthesize { "target": "curl" }produces:
resp0=$(curl -s -X POST 'https://app.example.com/api/login' \
-H 'content-type: application/json' \
-d '{"user":"alice","pass":"s3cret"}')
token=$(echo "$resp0" | jq -r '.token') # ← lifted from the response
curl -s -X GET 'https://app.example.com/api/me' \
-H "authorization: Bearer $token" # ← re-used, not a literalflow_synthesize also emits TypeScript / Go / Python, flow_replay runs the
sequence for real (deps resolved from each live response) and reports ✓ / ✗
per call, and { "redact": true } swaps secret-bearing header values and
whole-token bodies for env placeholders.
Dependency detection is heuristic (exact / url-encoded / base64 / JWT-claim / substring). Unmatched values stay literal for you to review; always read the generated code before shipping it.
Cookbook
A. Debug a slow or hung page
browser_launch { "mode": "fresh", "url": "https://myapp.com" }
net_pending // the request that never finishes → the hang
net_slow { "thresholdMs": 1000 } // finished-but-slow calls, slowest first
net_failures // 4xx/5xx + transport errors
console_errors // the thrown stack trace
net_get { "url": "/api/user" } // the failing call in fullB. Reverse-engineer an API into runnable code
browser_launch { "mode": "fresh", "url": "https://app.com/login" }
flow_mark { "label": "login+fetch" }
page_fill { "fields": [
{ "selector": "#user", "value": "me" },
{ "selector": "#pass", "value": "pw" }
]}
page_click { "selector": "#submit" }
flow_synthesize { "target": "python" } // code with the token chained in
flow_replay // ✓/✗ per call — verifiedC. Stay logged in across runs
session_save { "name": "myapp" } // first run, after logging in
// later:
browser_launch { "mode": "fresh" }
session_restore { "name": "myapp" } // back in, no re-loginD. Drive a canvas / WebGL app
browser_launch { "mode": "fresh", "incognito": true, "url": "https://game.example",
"viewport": { "width": 390, "height": 844 } } // portrait
page_click_at { "x": 195, "y": 700 } // press a button drawn on the canvas
net_ws // read the app's WebSocket frames
net_pending // catch asset-load hangsE. Test under a bad network / mocked endpoint
net_throttle { "preset": "slow-3g", "cpuRate": 4 } // degrade the connection + CPU
net_intercept_add { "urlIncludes": "/api/config", "action": "mock",
"status": 200, "body": "{\"feature_x\":true}" }
browser_hard_reload
net_slow // see what drags under 3G
net_throttle { "preset": "none" } // reset to full speedF. Upload a file through a form
page_snapshot
page_upload { "selector": "input[type=file]", "files": ["/abs/path/resume.pdf"] }
page_click { "selector": "#submit" }
net_get { "url": "/upload" } // confirm the multipart requestG. See it, then click it (vision mode)
page_look // screenshot with badges 1,2,3… on every clickable element + legend
// legend: [e7] button "ชำระเงิน" — read the picture, pick the badge, click the ref:
page_click { "ref": "e7" }
page_look { "text": "สมัคร" } // badge only the elements whose text matches
page_screenshot // plain 1:1 image; any point (x,y) you read IS the click coord
page_click_at { "x": 640, "y": 412 }H. A whole flow in one round-trip (page_batch)
page_batch { "steps": [
{ "action": "fill", "selector": "#user", "value": "alice" },
{ "action": "fill", "selector": "#pass", "value": "s3cret" },
{ "action": "click", "text": "Login" }, // target by visible text
{ "action": "wait_for", "url": "/dashboard", "timeoutMs": 8000 }
], "look": true }
// → one combined network/console/url delta + a badged screenshot of the dashboard,
// so the next page_click {ref} is chosen from the same reply. Stops at the first failing step.I. Phone / PG-style game (stable viewport, auto-followed tab)
browser_launch { "mode": "fresh", "device": "mobile", "url": "https://game.example/lobby" }
// 390x844 phone viewport that WON'T self-shrink; this session is now active.
page_look // badged screenshot, 1:1 with page_click_at coordinates
page_click { "selector": ".play" } // opens the game in a new tab → bfa auto-follows it
page_state // confirms you are now on the game tab
// if the game tab ever closes, the next tool self-heals to a live tab instead of erroring.
net_list { "since": "nav" } // only this page's requests — earlier lobby polling is hiddenCanvas / WebGL games
Puppeteer defaults to an 800×600 landscape viewport. A portrait game then renders letterboxed, and its full-screen input overlay can swallow coordinate clicks. Launch (or resize) with a portrait viewport so the canvas fills the screen:
browser_launch { "mode": "fresh", "incognito": true, "url": "…",
"viewport": { "width": 390, "height": 844 } }
page_set_viewport { "width": 390, "height": 844 } // on a live sessiondevice:"mobile" turns touch ON, so page_tap_at and page_batch {action:"tap_at"}
drive Cocos/canvas games out of the box (mouse clicks still work). With an explicit
viewport instead, hasTouch defaults to false — set hasTouch:true there if you need page_tap_at.
Which mode do I want?
fresh(default) — a throwaway Chrome, zero setup. Use for reverse-engineering a public flow or any site that does not need your existing login.attach— connect to a Chrome you started with a debug port. Use when you need real logins/cookies or a human-looking browser:navigator.webdriverisfalse, real profile & fingerprint, so it passes basic bot checks that a puppeteer-launched Chrome fails. Setup below.
Attach to a real, logged-in Chrome
A normally-opened Chrome has no debug port, and Chrome 136+ refuses one on the default profile (an anti-cookie-theft hardening) — so attach always uses a separate profile:
# dedicated profile (recommended) — a window opens; log in there once, it persists
./bfa-chrome 9222
# …or reuse your existing logins via a COPY of your profile (a non-default dir)
cp -R "$HOME/Library/Application Support/Google/Chrome" "$HOME/.bfa/real-copy"
./bfa-chrome 9222 "$HOME/.bfa/real-copy"Then: browser_launch { "mode": "attach", "port": 9222 }. (If the port isn't up, the
tool's error tells you this exact recipe.)
⚠️ A copied real profile hands the agent every logged-in session it contains — email, cloud consoles, banking, source control. It can read those pages and act as you. Prefer the dedicated profile; use a real-profile copy only when you need those logins and accept that blast radius.
Do not point
bfa-chromeat your live default profile: on Chrome 136+ the debug port silently won't open, and it would also collide with your running Chrome (one process per profile dir).
Roadmap
Gaps we know about, in rough priority order:
iframe-aware refs —
page_snapshot/ interaction currently resolve the top document only; cross-frame ref support is the next correctness item.Device emulation presets — bundle UA + viewport + touch + geolocation + permission grants into one call.
PDF export —
Page.printToPDFfor report/invoice-style pages.Playwright/Puppeteer test emission — a new
flow_synthesizetarget that outputs a runnable test script, not just replay code.Natural-language element targeting — an optional LLM-assisted layer over the existing deterministic ref model.
Performance tracing — a thin
Tracing.start/stopwrapper.
Out of scope by design: cloud-scaled browsers, stealth/anti-bot, and residential proxies — bfa stays a local inspection tool.
Notes & limitations
The agent sees whatever the attached/launched browser sees. Treat an attached real-profile Chrome as full access to your logged-in accounts.
Persistent logins: a named profile keeps the real OS keystore, so its cookies/logins survive across launches. (Puppeteer's default
--use-mock-keychain/--password-store=basiccan't decrypt real-keystore cookies and makes Chrome wipe the whole jar — a silent logout; bfa drops those for named profiles. The first launch may prompt for keychain access.) Ephemeral profiles don't persist and keep the mock store.Automation fingerprint: a
fresh(puppeteer-launched) Chrome hasnavigator.webdriver === trueand automation switches, so bot-detection can spot it. Anattached Chrome is an ordinary browser (navigator.webdriver === false, real profile & fingerprint). bfa ships no fingerprint spoofing or anti-bot evasion by design — if a site blocks automation and you're authorized to operate there, useattach(a genuine browser), not a spoofing trick.Never hangs, never needs a force-quit. Native
alert/confirmare dismissed, butbeforeunloadis accepted (= leave) so your own Cmd+W / Cmd+Q / reload is never vetoed. CDP calls time out at 30 s;page_evalhas a budget and terminates a busy loop;browser_recoverunfreezes a page whose own script spins;browser_close/ shutdown are bounded and force-kill an owned Chrome that won't exit (attach sessions are only disconnected).net_throttleCPU is capped at 20x and any active throttle shows inpage_state; Fetch interception is switched off when no rules remain.Bounded memory. The recorder keeps the newest 3000 requests / 200 sockets × 500 frames / 2000 console lines, and asks Chrome to retain at most 64 MB of response bodies — a day-long attach session no longer grows until the browser crawls.
browser_clear_cachedefaults to the current origin in attach mode (your real profile); passscope:"all"to wipe the whole profile's cache + cookies.flow_replayonly replayshttp/https, times out per request, is capped overall (60 s / 200 steps), and never touches the live browser session.Headers are captured from the actual wire (CDP ExtraInfo), so
Cookieand network-added headers are recorded — not just whatrequestWillBeSentfirst saw — andnet_getshows every one, including custom signing headers (x-api-key,x-signature,agent, …), not just a well-known subset.Dependency detection and secret redaction are best-effort heuristics — review generated code and exported HAR before sharing or running against production. A computed value bfa can't reverse (e.g. a signature like
MD5(secret + timestamp)) stays a literal; a failingflow_replayusually means exactly such a header still needs to be reproduced in your own code.
Development
npm run typecheck
npm test # unit + real-Chrome integration + in-memory MCP e2e
npm run buildLicense
Available Tools
52 toolsbrowser_clear_cacheA
Clear browsing state before a run that must start clean. scope "origin" clears the current origin's storage (cookies, local/sessionStorage, IndexedDB, CacheStorage, service workers). scope "all" ALSO wipes the profile-wide HTTP cache and ALL cookies — the default for a fresh (throwaway) session, but in attach mode that is the user's real profile, so there the default is "origin" and "all" must be asked for explicitly. Every step is time-bounded.
Inputs: scope, sessionId.
browser_closeC
Close one session, or all sessions with all=true.
Inputs: all, sessionId.
browser_close_tabA
Close ONE tab by index (from browser_tabs) without closing the session. If you close the tab currently being driven, the session heals onto another live tab. Refuses to close the last remaining tab — browser_close the whole session for that. Handy to drop a finished game's tab, or to close the opener so the game tab is the only one left.
Inputs: index (required), sessionId.
browser_hard_reloadA
Reload the page bypassing cache (like a hard refresh / Cmd+Shift+R). A beforeunload prompt is accepted so the reload really happens. Reports the reloaded page's url and title.
Inputs: sessionId.
browser_launchA
Open a browser session. Choose the mode by what the task needs:
• mode:"fresh" (default choice) — launch our own throwaway Chrome; add incognito:true for a clean slate. Best for reverse-engineering a public flow or any site that does NOT need your existing login. No setup.
• mode:"attach" — connect to a Chrome the user already started with a debug port (default 9222). Use when you need REAL logins/cookies, or a human-looking browser (navigator.webdriver=false, real profile & fingerprint, passes basic bot checks). Requires starting Chrome first: ./bfa-chrome 9222 (Chrome 136+ needs a non-default profile — bfa-chrome handles that). You canNOT attach to an already-open normal Chrome; it has no debug port.
Multiple concurrent sessions are supported. In attach mode only port is used — profile, headless, incognito applies to fresh mode only. The session you launch becomes the ACTIVE one (tools without sessionId target it). In fresh mode bfa auto-follows a tab the page opens (so a game that launches in a new window keeps being driven); use browser_use_tab to switch manually. For phone/PG games pass device:"mobile" for a stable viewport.
Inputs: mode (required), url, port, device, +4 more.
browser_recoverA
Unfreeze a page whose JavaScript is pinned (tools timing out, tab unresponsive). Step 1 terminates the running script (Runtime.terminateExecution); if the page immediately re-spins, step 2 turns the page's own scripts OFF so it can be read, screenshotted and closed (call again with scripts:true to turn them back on). Reports which step worked. If nothing helps, browser_close is bounded and force-kills an owned Chrome.
Inputs: scripts, sessionId.
browser_sessionsA
List all open browser sessions.
Inputs: no named parameters.
browser_tabsC
List tabs/targets of a session.
Inputs: sessionId.
browser_useB
Set the active session that other tools target by default.
Inputs: sessionId (required).
browser_use_tabA
Switch the session's DRIVEN tab to another one (index from browser_tabs), carrying the network/console recorder and any intercept rules across, so page_*/net_*/page_tap_at then act on THAT tab. bfa already auto-follows a tab the page itself opens (window.open / target=_blank) in both fresh and attach mode; use this to go back to the opener, or to drive a tab that wasn't opened by the page.
Inputs: index (required), sessionId.
console_errorsA
List console errors and warnings for a session, most-recent-last, including the first line of the stack trace when present.
Inputs: sessionId.
console_listA
List captured console entries for a session, most-recent-last. Filterable by level/pattern; capped by limit (default 100) — never silently truncated.
Inputs: level, limit, pattern, sessionId.
flow_exportA
Export the captured network calls since the last flow_mark (or the whole buffer) as a compact JSON summary (calls + detected cross-call dependencies) or a HAR document. Dependency detection (exact / url-encoded / base64 / JWT-claim / substring): a value that came verbatim from an earlier response is lifted to a variable; unmatched values (base64/encoded/JWT-internal, user-supplied literals) stay literal for you to review, and a request input echoed back in a response may be over-chained.
Inputs: format, sinceSeq, sessionId, includeAll.
flow_markA
Mark the current point in the network recording as a flow's start. flow_export/flow_synthesize default their capture window to calls recorded after this mark.
Inputs: label, sessionId.
flow_replayA
Execute the captured network calls since the last flow_mark (or the whole buffer) for real, server-side (Node fetch, NOT the browser session) -- this verifies a synthesized flow actually reproduces. Chained dependencies (e.g. an auth token) are resolved at RUNTIME from each step's live replay response, not from the original capture, so a genuinely broken reversed flow is caught here. Returns a compact per-call report: '#i METHOD url → status (recorded status) ✓/✗ [deps: ...]'. Safety: only http/https URLs are replayed, each request has a timeout (default 10s), the whole call is capped at 60s / 200 steps, and it never touches the live browser session.
Inputs: sinceSeq, sessionId, timeoutMs, includeAll.
flow_synthesizeA
Synthesize replay code (curl/TypeScript/Go/Python) for the captured network calls since the last flow_mark (or the whole buffer), chaining detected dependencies (e.g. an auth token from one response into a later request) as variables instead of baked-in literals. Dependency detection (exact / url-encoded / base64 / JWT-claim / substring): a value that came verbatim from an earlier response is lifted to a variable; unmatched values (base64/encoded/JWT-internal, user-supplied literals) stay literal for you to review, and a request input echoed back in a response may be over-chained.
Inputs: target (required), redact, sinceSeq, sessionId, +1 more.
net_failuresA
List failed network requests (4xx/5xx status or CDP-level failure) with error detail.
Inputs: since, sessionId.
net_getA
Fetch one network request in full: headers, request body, response status/headers/body. Identify it by id (from net_list) or a url substring.
Inputs: id, url, sessionId.
net_intercept_addA
Add a network intercept rule via CDP Fetch: block a request, mock its response, or modify its headers. Matches when urlPattern is a substring of the request url; the first matching rule wins. Enables interception lazily on first use.
Inputs: action (required), urlPattern (required), body, status, +3 more.
net_intercept_clearA
Clear all network intercept rules for a session (Fetch interception is switched OFF once no rules remain, so the page runs at native speed; adding a rule re-enables it).
Inputs: sessionId.
net_intercept_listB
List active network intercept rules for a session.
Inputs: sessionId.
net_listB
List captured network requests for a session, most-recent-last. Filterable; capped by limit (default 50) — never silently truncated.
Inputs: type, limit, since, method, +4 more.
net_pendingA
List network requests still in flight (candidates for a hang) as of now.
Inputs: since, sessionId.
net_slowA
List finished network requests slower than a threshold (default 1000ms), slowest first. Capped by limit (default 50) — never silently truncated.
Inputs: limit, sessionId, thresholdMs.
net_throttleA
Emulate network + CPU conditions for the session (CDP). Use a preset (offline / slow-3g / fast-3g / fast-4g / none), or custom throughput+latency, plus an optional CPU slowdown factor (max 20x). 'none' (the default) resets everything back to full speed. The state persists across page_goto/reload until reset or the session closes (page_state shows it).
Inputs: preset, cpuRate, offline, latencyMs, +3 more.
net_waitA
Poll captured network requests for the first one matching the given criteria, up to timeoutMs (default 10000ms). Use instead of a fixed sleep to make driving deterministic — wait for the request rather than guessing at timing.
Inputs: method, status, sessionId, timeoutMs, +3 more.
net_wsC
List WebSocket connections with frame counts and a few recent frames.
Inputs: sessionId.
page_batchA
Run a SEQUENCE of actions in one call. Each step is an object with an action field, e.g. { "action": "tap_at", "x": 195, "y": 615 } or { "action": "wait_for", "networkIdleMs": 800 } — NOT { "tap_at": ... }. Actions: click / type / fill / select / key / hover / scroll / click_at / tap_at (touch, for Cocos/canvas games) / goto / wait / wait_for. Steps settle briefly between each, and it reports ONE combined network/console/url delta at the end — far faster than one tool call per step. Target steps by selector, by text ("the button that says Login"), or by ref (refs stay valid inside a batch — text targeting does not renumber them — but any step that changes the DOM invalidates them, so prefer selector/text after such a step). Stops at the first failing step unless stopOnError:false. Set look:true to get a page_look (badged 1:1 screenshot + legend) of the final state in the same reply, so you can pick the next target immediately.
Inputs: steps (required), look, waitMs, lookLimit, +3 more.
page_clickA
Click an element (by ref from page_snapshot, or CSS selector) and report the network/console/url delta it caused.
Inputs: ref, waitMs, selector, sessionId.
page_click_atA
Click at a raw viewport coordinate in CSS px — the SAME space as page_screenshot / page_look images (1 image px = 1 css px), so a point read off those images can be clicked directly. No DOM target needed (canvas/WebGL). Fails if the point is outside the viewport. Reports the network/console/url delta it caused.
Inputs: x (required), y (required), button, clicks, +2 more.
page_dragA
Drag the mouse from one raw viewport coordinate to another, in CSS px (same space as page_screenshot/page_look images; mousedown → move → mouseup, no DOM target needed) and report the network/console/url delta it caused.
Inputs: toX (required), toY (required), fromX (required), fromY (required), +2 more.
page_evalA
Evaluate a JS expression in the page and return its value directly (no network/console delta). Use this for a quick, standalone read (e.g. "document.title"). If you also want the network/console/url side-effects the expression may cause, use page_observe with {action:{kind:"eval"}} instead. Bounded: an expression that runs or waits longer than timeoutMs (default 15000ms) is stopped — a busy loop is terminated so the page stays usable; a never-settling promise is abandoned.
Inputs: expression (required), sessionId, timeoutMs.
page_fillA
Clear and fill multiple form fields (each by ref from page_snapshot, or CSS selector) in one call, and report the network/console/url delta it caused.
Inputs: fields (required), waitMs, sessionId.
page_findA
Find elements on the page by visible TEXT, ARIA ROLE, and/or a CSS SELECTOR, returning each match with a stable ref (e1, e2, ...) for page_click/page_type/etc — the targeted alternative to page_snapshot's full listing. Give at least one of text/role/selector; they AND together. Searches interactive elements by default; set includeNonInteractive:true to search all elements (e.g. to find a heading or price by text). Refs from a prior snapshot/find are invalidated by this call.
Inputs: role, text, limit, selector, +2 more.
page_gotoC
Navigate the active (or given) session to a URL.
Inputs: url (required), sessionId.
page_hoverA
Hover an element (by ref from page_snapshot, or CSS selector) and report the network/console/url delta it caused.
Inputs: ref, waitMs, selector, sessionId.
page_keyA
Press a key or key combo (e.g. "Enter", "Control+A") and report the network/console/url delta it caused.
Inputs: keys (required), waitMs, sessionId.
page_lookA
SEE the page the way you'd click it: a screenshot with a numbered badge drawn on each interactive element (Set-of-Mark) plus a legend mapping badge N → ref eN. Read the picture, pick a number, then page_click {"ref":"eN"} — precise, no coordinate math. Only elements that are really visible at their spot get a badge (covered/clipped ones are skipped and counted). The image is 1:1 with CSS px, so a raw point can also be clicked with page_click_at. Optional text/role/selector mark only matching elements (like page_find); includeNonInteractive marks any element. The overlay is removed after capture. Refs from a prior snapshot/find are invalidated by this call.
Inputs: role, text, limit, fullRes, +3 more.
page_observeA
Run one page action (goto/reload/eval/wait) and report the compact delta it caused: any url change, new network requests, and new console entries. Use this instead of a raw navigate/eval call so you see an action's side-effects without extra tool calls.
Inputs: action (required), waitMs, sessionId.
page_readA
Read the page's visible TEXT content (defaults to /, else the whole body), optionally scoped to a CSS selector and/or filtered with query to only the lines that contain it (case-insensitive). Use this to search/read page DATA — content, prices, table text, 'does the page mention X'. To locate a clickable element instead, use page_find.
Inputs: query, maxChars, selector, sessionId.
page_screenshotA
Capture a PNG screenshot that is 1:1 with CSS pixels. The default (current viewport) shares the exact coordinate space of page_click_at / page_tap_at / page_drag, so a point you read off the image can be clicked directly — a text line states the mapping. fullPage:true captures the whole scrollable page (document-relative: the note explains the scrollY conversion; prefer page_look/page_find to click). A single element by ref/selector gets a crop plus its page origin. fullRes:true returns native device pixels (2x on Retina) for fine detail. To see numbered click targets on the image, use page_look. Use sparingly — image content is expensive.
Inputs: ref, fullRes, fullPage, selector, +1 more.
page_scrollA
Scroll the page: with a ref/selector, scrolls that element into view; otherwise scrolls the window vertically by dy pixels (default 600). Reports the network/console/url delta it caused.
Inputs: dy, ref, waitMs, selector, +1 more.
page_selectA
Select an option (by value) in a element (by ref from page_snapshot, or CSS selector) and report the network/console/url delta it caused.
Inputs: value (required), ref, waitMs, selector, +1 more.
page_set_viewportA
Resize an existing session's viewport without relaunching. Use a portrait size (e.g. {width:390,height:844}) for canvas/WebGL games so the game fills the screen and page_click_at coordinates land on it. Keep hasTouch:false (default) so mouse clicks drive the game; set hasTouch:true only for games that require touch input.
Inputs: width, device, height, mobile, +3 more.
page_snapshotA
Snapshot the page's interactive elements (links, buttons, inputs, selects, textareas, ...) and assign each a stable ref (e1, e2, ...) via a data-bfa-ref attribute, usable by page_click/page_type/etc instead of a CSS selector. Re-run after any action that changes the DOM — refs from a prior snapshot are invalidated. To find a specific element instead of listing all, use page_find.
Inputs: limit, sessionId.
page_stateA
Report current page state: url, title, readyState, viewport, and any active net_throttle emulation.
Inputs: sessionId.
page_tap_atA
Touch-TAP at a raw viewport coordinate in CSS px (same space as page_screenshot/page_look images; dispatches touchstart→touchend, for canvas/WebGL games that listen for touch rather than mouse) and report the network/console/url delta it caused. Requires touch emulation: launch with device:'mobile' (touch on by default) or set hasTouch:true via browser_launch {viewport:{...,hasTouch:true}} / page_set_viewport. If a game ignores page_click_at, try this.
Inputs: x (required), y (required), waitMs, sessionId.
page_typeA
Type text into an element (by ref from page_snapshot, or CSS selector) and report the network/console/url delta it caused. Set clear:true to select-all+backspace the field first.
Inputs: text (required), ref, clear, waitMs, +2 more.
page_uploadA
Attach file(s) to a file (by ref from page_snapshot, or CSS selector) — the equivalent of choosing files in the OS picker, but set directly on the element. Give ABSOLUTE paths readable by this process. Reports the network/console/url delta any resulting upload caused.
Inputs: files (required), ref, waitMs, selector, +1 more.
page_wait_forA
Wait until the page reaches a condition instead of sleeping: a CSS selector appears, some text appears, the URL contains a string, or the network has been idle for N ms. Any one condition satisfies it (they OR together). Returns as soon as it holds — use this (or net_wait) rather than fixed waits.
Inputs: url, text, selector, sessionId, +2 more.
session_restoreA
Restore cookies + localStorage/sessionStorage previously saved with session_save into the active (or given) session.
Inputs: name (required), sessionId.
session_saveA
Save the active (or given) session's cookies + localStorage/sessionStorage to ~/.bfa/state/.json, for later restore with session_restore.
Inputs: name (required), sessionId.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 52 tools
Tools are grouped by domain prefixes (page_/net_/browser_/console_/flow_) and each has a distinct action, but the high number of similar-sounding interaction tools (page_click vs page_click_at, page_find vs page_look vs page_snapshot) creates some selection risk despite clear descriptions.
Naming follows a predictable domain_prefix + action pattern (page_click, net_list, browser_launch), with minor deviations like page_state, page_snapshot, console_errors, and browser_sessions using noun forms rather than verbs.
At 52 tools this is far beyond the typical well-scoped MCP server size. The broad browser-automation domain justifies many of them, but the sheer count makes the surface heavy and harder to navigate.
The surface is remarkably comprehensive—navigation, interaction, network interception, console, sessions, and flow replay are all covered. Minor gaps remain, such as no dedicated back/forward navigation or explicit open-new-tab tool, but agents can work around them.
Maintenance
Related MCP Connectors
Real Chrome for coding agents over MCP: browse, replay playbooks, human takeover, HIPAA & BAA.
Official Browserless MCP server: browser automation, scraping, screenshots and PDFs for AI agents.
Web scraping, browser automation, screenshots and AI data extraction for AI agents via MCP.
Live browser debugging for AI assistants — DOM, console, network via MCP.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Chrome DevTools Protocol-based MCP server that enables AI coding assistants to control browsers for JavaScript debugging, reverse engineering, web scraping, and API debugging.1Apache 2.0
- FlicenseBqualityDmaintenanceUltra-fast browser automation server over Chrome DevTools Protocol (CDP), exposed as MCP, enabling AI agents to control a real Chrome browser with low latency and minimal token usage.212-
- FlicenseNot gradedqualityDmaintenanceMCP server that connects AI agents to browser DevTools via CDP, enabling real-time access to console logs, network requests, and page state.-
- AlicenseAqualityBmaintenanceMCP server that lets AI agents drive your real Chromium browser with your existing signed-in sessions, providing visible, local, and inspectable automation for tasks like navigation, clicking, typing, and form filling.252Apache 2.0