browser-ref-mcp
v0.2.1Reliable browser-control MCP server for AI agents: click by ref, self-healing sessions.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
browser_snapshot
Semantic snapshot of the current page: interactive elements carry [eN] refs, and iframe content is flattened in. Narrow it with rootRef (the subtree of a single element), selector, or filter:interactive (interactive elements only).
| Parameter | Type | Description |
|---|---|---|
filter | string | balanced (default) keeps structure and text, interactive keeps only interactive elements, text keeps only text |
maxElements | number | Maximum output rows (default 400) |
rootRef | string | Snapshot only this element's subtree |
selector | string | Snapshot only the subtree matching this CSS selector (main document) |
browser_click
Click an element (prefer the ref from a snapshot). Waits until it is actionable, re-resolves refs that went stale, and returns a fresh snapshot afterwards. Dialogs are handled and reported automatically.
| Parameter | Type | Description |
|---|---|---|
button | string | |
doubleClick | boolean | |
ref | string | The [eN] id shown in a snapshot |
selector | string | CSS selector (fallback when no ref is available) |
snapshot | boolean | Include a snapshot after clicking (default true) |
text | string | Match by visible text |
timeoutMs | number |
browser_type
Type text into a field (clears it first). submit:true presses Enter. Works with input/textarea/contenteditable.
| Parameter | Type | Description |
|---|---|---|
text * | string | Text to type |
clear | boolean | Clear the field first (default true; false appends) |
ref | string | |
selector | string | |
submit | boolean | Press Enter after typing (default false) |
timeoutMs | number |
browser_press_key
Press a key, e.g. Enter / Tab / ArrowDown / Control+a. With a ref, focuses that element first.
| Parameter | Type | Description |
|---|---|---|
key * | string | Key name, e.g. Enter, Escape, ArrowDown, Control+a |
ref | string | Focus this element before pressing |
browser_select_option
Select options in a dropdown. values may be option values or visible labels; both are tried.
| Parameter | Type | Description |
|---|---|---|
values * | array | Option value(s) or visible label(s) to select |
ref | string | |
selector | string | |
timeoutMs | number |
browser_hover
Hover an element to reveal hover-only menus or tooltips.
| Parameter | Type | Description |
|---|---|---|
ref | string | |
selector | string | |
timeoutMs | number |
browser_scroll
Scroll the page, or one scroll container when a ref is given. Direction plus pixel amount.
| Parameter | Type | Description |
|---|---|---|
direction * | string | |
amount | number | Pixels to scroll (default 600) |
ref | string | Scroll this container instead (the one marked scrollable in a snapshot) |
browser_screenshot
Screenshot the viewport, the full page, or a single element (ref). Returns the image and writes it to disk.
| Parameter | Type | Description |
|---|---|---|
filename | string | File name without extension (default: timestamp) |
fullPage | boolean | Capture the full page instead of the viewport |
ref | string | Capture only this element |
browser_evaluate
Escape hatch: run JS in the page and return a JSON-serializable result. Pass a function string such as `() => document.title` or `() => {...}`; with a ref the function runs on that element as `(el) => el.value`.
| Parameter | Type | Description |
|---|---|---|
js * | string | Function string, e.g. `() => document.querySelector('#app')?.innerText.slice(0,2000)` |
ref | string | Run on this element; it becomes the first callback argument |
browser_wait
Wait for a condition: timeMs (fixed delay) / text (appears) / selector (appears) / url (changes) / idle (network quiet). Combine them freely.
| Parameter | Type | Description |
|---|---|---|
idle | boolean | Wait for network idle (max 15s) |
selector | string | |
text | string | Wait until this text appears on the page |
timeMs | number | |
timeoutMs | number | Wait timeout (default 15000) |
url | string | Wait until the URL matches this pattern |
browser_tabs
Manage tabs: list / new / select (by the index or id that list shows) / close.
| Parameter | Type | Description |
|---|---|---|
action * | string | |
id | string | Target tab pageId for select/close |
index | number | Target tab index for select/close (as shown by list, 0-based) |
url | string | URL to open with new (optional) |
browser_get_info
Browser health: mode, tab list, restart count, recent errors / dialogs / downloads. Never launches the browser.
browser_close
Close the browser (launch mode quits it but keeps profile logins; connect mode only disconnects). The next tool call restarts it automatically.