browserctl-mcp

v1.0.3
browserctl-mcp Checked 3 days ago Published 11 days ago

Browser control for AI agents in the user's real Chrome, through an MV3 extension and a local daemon.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

status

Show connected browsers, setup problems, your tabs, and where Chrome's debugging bar comes from. Call it first when a tool reports NO_BROWSER, USER_SCRIPTS_OFF or DEBUGGER_CANCELED.

ParameterTypeDescription
allowDebuggerbooleanClear DEBUGGER_CANCELED after asking the user.

tabs

Manage tabs. action: list | new | select | close | adopt | release. New tabs open in the background and become your current tab. adopt takes an existing tab (e.g. one the user opened) so you can act on it. select with focus: true shows the tab to the user.

ParameterTypeDescription
action *string
allbooleanFor list: every tab, not only yours.
browserstringBrowser alias from status, when several are connected.
focusbooleanFor select: bring the tab and its window to the front.
forcebooleanFor adopt: take a tab another session holds.
tabintegerTab id from tabs list. Default: your current tab.
urlstringFor new: the page to open.

navigate

Open a URL in your current tab (opens a background tab if you have none), or action: back | forward | reload. Waits for the page to load. Does not change what the user is looking at.

ParameterTypeDescription
actionstring
tabintegerTab id from tabs list. Default: your current tab.
urlstringAbsolute URL, or a host (https:// is added).
waitobjectThen wait for one wait_for condition.

snapshot

Read the page as an accessibility tree (YAML); each element you can act on has a ref ([ref=e5]) to pass as target to click, type, fill_form, evaluate. A ref stays valid until its element is removed or the page navigates. Extra brackets tell state: [empty], [type=email], [value=42], [near="label"] for unnamed fields, [ctx="..."] to tell identical buttons apart, [modal], [hidden] (no ref: open its menu first). Long lists and long text are folded; each fold line says how to see the rest (read target=eX). target: a ref to read only that part. If the first line says the page is not ready, snapshot…

ParameterTypeDescription
depthintegerCut the tree below this depth. Default: no limit.
fullbooleanSkip compaction and text folding.
maxCharsintegerSize budget; long text is folded harder before anything is cut.
maxTextintegerCharacters of running text kept before it is folded.
tabintegerTab id from tabs list. Default: your current tab.
targetstringSnapshot only this element's subtree.

read

Read the page (or target) as text: headings, paragraphs, lists, full tables, links, and form fields with their values and refs. main: true skips navigation and footers. Long pages come in slices: pass nextOffset as offset to continue.

ParameterTypeDescription
linksbooleanWrite links as [text](url).
mainbooleanOnly the main content (main, [role=main], or the largest article).
maxCharsinteger
offsetinteger
tabintegerTab id from tabs list. Default: your current tab.
targetstringRead only this element.

get

Read one thing about an element: what: text (default) | value | attribute | property | html | state | box; name: the attribute or property (href, dataset.id). target: a ref or a locator. all: true returns every match of a selector. Use it instead of evaluate to read a value.

ParameterTypeDescription
target *stringA ref (e5) or a locator (#id, label=Email, role=button[name="Save"], ...).
allbooleanEvery element the selector matches (at most 100) instead of AMBIGUOUS_TARGET.
maxCharsintegerCut text and html values.
namestringAttribute name, or property path (dataset.id), for what: attribute | property.
tabintegerTab id from tabs list. Default: your current tab.
timeoutnumberSeconds to wait for the target to exist (it need not be visible).
whatstring

click

Click an element (target: ref or locator). Works in background tabs. trusted: true sends real mouse input for sites that ignore synthetic clicks (shows Chrome's debugging bar). Returns the element hit and what changed (url, new tabs, dialogs, DOM).

ParameterTypeDescription
target *stringA ref (e5) or a locator (#id, label=Email, role=button[name="Save"], ...).
buttonstring
doubleClickboolean
modifiersarray
scrollstring
tabintegerTab id from tabs list. Default: your current tab.
timeoutnumberSeconds to wait for the target.
trustedbooleanReal input through Chrome's debugger (shows its debugging bar).
waitobjectThen wait for one wait_for condition.

hover

Hover over an element to open its menu or tooltip. Menus that open only through CSS :hover need trusted: true (real pointer; shows Chrome's debugging bar).

ParameterTypeDescription
target *stringA ref (e5) or a locator (#id, label=Email, role=button[name="Save"], ...).
scrollstring
tabintegerTab id from tabs list. Default: your current tab.
timeoutnumberSeconds to wait for the target.
trustedbooleanReal input through Chrome's debugger (shows its debugging bar).
waitobjectThen wait for one wait_for condition.

type

Replace the text of an input, textarea or rich-text field. target: a ref or selector. submit: true presses Enter after. slowly: true types key by key for autocomplete fields. Returns the field's value afterwards.

ParameterTypeDescription
target *stringA ref (e5) or a locator (#id, label=Email, role=button[name="Save"], ...).
text *string
scrollstring
slowlyboolean
submitboolean
tabintegerTab id from tabs list. Default: your current tab.
timeoutnumberSeconds to wait for the target.
trustedbooleanReal input through Chrome's debugger (shows its debugging bar).
waitobjectThen wait for one wait_for condition.

fill_form

Set several form controls at once: fields: [{target, value}]. value is a string for text fields and selects (option value or label), true/false for checkboxes, radios and switches, a list for multi-selects. Stops at the first field that fails and says which.

ParameterTypeDescription
fields *array
scrollstring
tabintegerTab id from tabs list. Default: your current tab.
timeoutnumberSeconds to wait for the target.
trustedbooleanReal input through Chrome's debugger (shows its debugging bar).
waitobjectThen wait for one wait_for condition.

press_key

Press a key or chord (Enter, Escape, Tab, ArrowDown, Control+A) on target or on the focused element. Enter submits forms, Tab moves focus. trusted: true for keys a site handles only from real keyboards.

ParameterTypeDescription
key *string
tabintegerTab id from tabs list. Default: your current tab.
targetstringOptional: element to press on; default the focused one.
timeoutnumberSeconds to wait for the target.
trustedbooleanReal input through Chrome's debugger (shows its debugging bar).
waitobjectThen wait for one wait_for condition.

scroll

Scroll the page or a container (target), by direction and amount, or to: top | bottom; or bring target into view. Reports whether the end was reached and whether more content loaded. trusted: true uses real wheel input, needed for lazy loading in background tabs.

ParameterTypeDescription
amountnumber
directionstring
tabintegerTab id from tabs list. Default: your current tab.
targetstringA scrollable container, or an element to bring into view.
timeoutnumberSeconds to wait for the target.
tostring
trustedbooleanReal input through Chrome's debugger (shows its debugging bar).
waitobjectThen wait for one wait_for condition.

wait_for

Wait for text to appear (text) or disappear (textGone), for target to become visible / hidden / attached / detached, for the URL to match (url), or for time seconds. timeout defaults to 10 s.

ParameterTypeDescription
statestring
tabintegerTab id from tabs list. Default: your current tab.
targetstringA ref (e5) or a locator (#id, label=Email, role=button[name="Save"], ...).
textstring
textGonestring
timenumber
timeoutnumber
urlstringSubstring of the URL, or /regex/.

take_screenshot

Screenshot the viewport, the full page (fullPage: true) or one element (target). Saved to a file; the path is returned. Background tabs and full pages use Chrome's debugging bar briefly.

ParameterTypeDescription
formatstringDefault: from path's extension, else jpeg.
fullPageboolean
pathstringAbsolute path to save to.
tabintegerTab id from tabs list. Default: your current tab.
targetstringA ref (e5) or a locator (#id, label=Email, role=button[name="Save"], ...).

file_upload

Attach local files (absolute paths) to a file input or to the upload button that opens a file chooser. paths: [] clears it. Returns the files as the page sees them.

ParameterTypeDescription
paths *array
target *stringA ref (e5) or a locator (#id, label=Email, role=button[name="Save"], ...).
tabintegerTab id from tabs list. Default: your current tab.
timeoutnumberSeconds to wait for the target.
waitobjectThen wait for one wait_for condition.

handle_dialog

Set how dialogs in your tab are answered: accept: true/false, promptText, scope: next | always. By default alert is accepted and confirm/prompt are dismissed; actions report each dialog and the answer given. To accept a dismissed confirm, call this and repeat the action.

ParameterTypeDescription
accept *boolean
promptTextstring
scopestring
tabintegerTab id from tabs list. Default: your current tab.

evaluate

Run JavaScript in the page (page globals available). function: "() => document.title", or "(el) => el.value" with target: a ref. Promises are awaited (timeout). action: true when the code changes the page: outcome after it reacts, like click. Use it whenever no other tool fits.

ParameterTypeDescription
function *string
actionboolean
tabintegerTab id from tabs list. Default: your current tab.
targetstringA ref (e5) or a locator (#id, label=Email, role=button[name="Save"], ...).
timeoutnumber
trustedbooleanReal input through Chrome's debugger (shows its debugging bar).

run

Run Playwright code for anything the other tools do not cover (drag, coordinates, routes, cookies, emulation, loops). page, context and a persistent state object are in scope; return a value. Shows Chrome's debugging bar while running.

ParameterTypeDescription
code *string
tabintegerTab id from tabs list. Default: your current tab.
timeoutnumber

network_requests

List the tab's network requests (filter, types, since, limit) or one request's details (id). Response bodies need captureBodies: true first (shows Chrome's debugging bar until turned off). To call an API with the page's cookies, use evaluate with fetch.

ParameterTypeDescription
bodyboolean
captureBodiesboolean
filterstringSubstring of the URL, or /regex/.
idinteger
limitinteger
sinceinteger
tabintegerTab id from tabs list. Default: your current tab.
typesarrayxhr covers fetch too.