BrowserTap MCP
v0.4.12MCP server that drives the real Chrome you already use, through an extension and CDP.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
get_automation_profile
Return the active safe/lab automation profile. Lab is the default and skips elicitation unless BROWSERTAP_LAB_NO_ELICIT is explicitly disabled; safe requires approval for every physical action and permission allow.
set_automation_profile
Set the safe or lab automation profile for this MCP process. This does not persist or reload the extension; BROWSERTAP_MODE controls the next process.
| Parameter | Type | Description |
|---|---|---|
mode * | string |
get_setup_status
Return component versions, stale-build actions, extension path, bridge ports, and connection status for setup/diagnostics.
list_tabs
List connected tabs across all connected browsers; each tab has a browser field (chrome/edge/opera) and a session id to pass verbatim.
list_all_tabs
List every open tab, including chrome-extension:// pages that list_tabs hides. Those never become sessions (content scripts can't run there), so they have no session id — drive them with cdp_command(tab_id=...) instead. Works with no tabs open.
| Parameter | Type | Description |
|---|---|---|
session_id |
close_tabs
Close one or more tabs by native tab id or composite session_id. Accepts a single identifier or a list; identifiers in one call must belong to the same browser. By default it closes only tabs created by this MCP task and requires the owner_id returned by open_new_tab; lifecycle generations are checked before removal. Set only_if_agent_owned=false only for an explicit operator request to close a user tab.
| Parameter | Type | Description |
|---|---|---|
tab_id * | ||
only_if_agent_owned | boolean | |
owner_id | ||
session_id |
switch_tab
Set the target tab for later calls by session id, URL substring, or browser name ('chrome'/'edge'/'opera') without focusing the browser. A URL substring must match exactly one tab; pass its full session_id when several tabs match. Use activate=true or activate_tab when foreground work is required.
| Parameter | Type | Description |
|---|---|---|
activate | boolean | |
browser | ||
session_id | ||
url_pattern |
activate_tab
Bring a tab to the foreground and focus its window. Use this explicitly after switch_tab when foreground work is required, or to re-raise a tab the user has since clicked away from.
| Parameter | Type | Description |
|---|---|---|
session_id |
open_url
Navigate the current real-browser tab through CDP without raising its window. beforeunload defaults to dismiss, except lab mode auto-accepts configured shell/IDE hosts. Use accept to leave explicitly, manual to inspect, or intent_leave=false to force the conservative dismiss behavior even on a lab auto host.
| Parameter | Type | Description |
|---|---|---|
url * | string | |
beforeunload | string | |
intent_leave | ||
session_id | ||
timeout | number |
handle_dialog
Inspect or handle a JavaScript dialog on the requested real-browser tab. action is dismiss, accept, or manual; manual reports the dialog without choosing.
| Parameter | Type | Description |
|---|---|---|
action * | string | |
prompt_text | string | |
session_id | ||
timeout | number |
resolve_leave_dialog
Resolve an intended beforeunload leave in one bounded workflow: protocol accept twice, return immediately when no dialog exists, then use a lab-only foreground Enter fallback after the normal physical-input approval gate only when protocol handling actually fails.
| Parameter | Type | Description |
|---|---|---|
session_id |
open_new_tab
Open one real-browser tab in the background by default with an operation_id-backed exactly-once create. Pass active=true only when foreground work is genuinely required. If the create ACK is lost, the same operation_id is reconciled within one total deadline; a completed result is registered only with its exact client_id, tab_id, and generation. Before create is dispatched, an unresolved probe returns status=unknown, may_have_created=false, retry_safe=true; after dispatch, an unresolved operation returns status=unknown, may_have_created=true, retry_safe=false and the operation_id. Never use a…
| Parameter | Type | Description |
|---|---|---|
url * | string | |
active | boolean | |
owner_id | ||
session_id | ||
timeout | number |
extension_path
Get absolute path to the unpacked Chrome extension directory for manual installation.
list_extensions
List installed browser extensions (id, name, enabled, type, version). Works with no tabs open.
| Parameter | Type | Description |
|---|---|---|
session_id |
set_extension_enabled
Enable or disable an installed extension by id. Chrome exposes no API to INSTALL an extension, so this only toggles ones already present; use list_extensions for ids. The BTAP bridge refuses to disable itself -- nothing would be left to re-enable it -- so ask a human to press Reload on chrome://extensions to pick up a new build.
| Parameter | Type | Description |
|---|---|---|
enabled * | boolean | |
extension_id * | string | |
session_id |
download_file
Download an http(s) URL through the real browser's native download manager, so the current browser profile's cookies and authenticated session are used. Waits for completion by default and returns the final absolute local path. directory may be any absolute local directory; completed files are moved there without replacing an existing file unless overwrite=true. A directory timeout reports directory_applied=false because Chrome may finish in its default download directory. An explicit session_id must still be live and is never replaced with another profile. Use this for attachments instead of…
| Parameter | Type | Description |
|---|---|---|
url * | string | |
directory | ||
filename | ||
overwrite | boolean | |
session_id | ||
timeout | number | |
wait | boolean |
uninstall_extension
Uninstall another installed extension by id. show_confirm_dialog defaults to true; set it false only for an explicitly selected disposable/test extension. The BTAP bridge cannot uninstall itself through its active connection.
| Parameter | Type | Description |
|---|---|---|
extension_id * | string | |
session_id | ||
show_confirm_dialog | boolean |
get_bookmarks
Return the browser bookmark tree. Works with no tabs open.
| Parameter | Type | Description |
|---|---|---|
session_id |
create_bookmark
Create a bookmark or folder. Supply url for a bookmark; omit url to create a folder. parent_id is optional and uses Chrome's default bookmark location when omitted.
| Parameter | Type | Description |
|---|---|---|
title * | string | |
parent_id | ||
session_id | ||
url |
remove_bookmark
Remove a bookmark by id. Set recursive=true only for a folder whose full subtree should be removed.
| Parameter | Type | Description |
|---|---|---|
bookmark_id * | string | |
recursive | boolean | |
session_id |
call_extension
Send a JSON message from the BTAP extension service worker to another installed extension. The target must be enabled and list this BTAP extension in externally_connectable. Works with no tabs open.
| Parameter | Type | Description |
|---|---|---|
extension_id * | string | |
message_json * | string | |
session_id |
network_capture_start
Start bounded CDP Network capture on a real-browser tab. Captures requests, responses, and optionally response bodies without foregrounding the tab. Call network_capture_stop to return the buffer and release the debugger lease.
| Parameter | Type | Description |
|---|---|---|
body_timeout | number | |
include_bodies | boolean | |
max_body_bytes | integer | |
max_entries | integer | |
session_id | ||
timeout | number |
network_capture_stop
Stop Network capture on a real-browser tab, optionally filter returned records by URL, resource type, HTTP status range, or response-body inclusion, and release its debugger lease. url_pattern uses the browser's JavaScript RegExp syntax and invalid patterns return a structured error.
| Parameter | Type | Description |
|---|---|---|
include_response_bodies | boolean | |
resource_type | string | |
session_id | ||
status_max | ||
status_min | ||
timeout | number | |
url_pattern | string |
console_capture_start
Start a bounded Runtime console and exception capture on a real-browser tab without foregrounding it. Use get_console_messages while running and console_capture_stop when done.
| Parameter | Type | Description |
|---|---|---|
max_entries | integer | |
session_id | ||
timeout | number |
get_console_messages
Read a page of captured console messages and exceptions from a real-browser tab. Set clear=true to clear the full buffer after reading. Set filter='user' to exclude extension service-worker / content-script logs and keep only the page's own main-world console output.
| Parameter | Type | Description |
|---|---|---|
clear | boolean | |
filter | string | |
max_items | integer | |
offset | integer | |
session_id | ||
timeout | number |
console_capture_stop
Stop console capture on a real-browser tab, return the remaining bounded message buffer, and release its debugger lease.
| Parameter | Type | Description |
|---|---|---|
session_id | ||
timeout | number |
scan_page
Read the current page as simplified HTML/text, preserving login state from the real browser. Defaults: cutlist=true, maxchars=35000, timeout=15 seconds.
| Parameter | Type | Description |
|---|---|---|
cutlist | boolean | |
extra_js | string | |
instruction | string | |
maxchars | integer | |
session_id | ||
text_only | boolean | |
timeout | number |
wait_for
Wait until a condition holds on the page, then return. Use this instead of polling scan_page (each scan re-serializes the whole DOM). Exactly one of selector / text / url_pattern / js must be given: selector waits for a CSS match, text for a substring in body text, url_pattern for a regex on the URL, js for a JS expression to become truthy. Polls inside the page, so it costs one bridge roundtrip regardless of how long the wait takes.
| Parameter | Type | Description |
|---|---|---|
gone | boolean | |
js | ||
selector | ||
session_id | ||
text | ||
timeout | number | |
url_pattern |
wait_for_url
Wait for navigation to settle: blocks until the tab's URL matches url_pattern (regex, or plain substring) and — unless wait_ready=false — document.readyState is 'complete', then returns the final url, title and readyState. Use this after a click or open_url that navigates; wait_for(url_pattern=...) only checks the URL and can return while the new document is still blank. Polls in-page, so a long wait is still cheap.
| Parameter | Type | Description |
|---|---|---|
url_pattern * | string | |
session_id | ||
timeout | number | |
wait_ready | boolean |
scroll_page
Scroll the page and report the new position. scan_page omits anything past ±5000px from the current scroll offset, so on a long page: scan, then scroll, then scan again. Pass to='bottom'/'top', a pixel offset, or a CSS selector to bring into view. Defaults: to='bottom', timeout=15 seconds.
| Parameter | Type | Description |
|---|---|---|
session_id | ||
timeout | number | |
to | string |
execute_js
Execute arbitrary JS in the requested real-browser tab under one total deadline. BTAP pins every monitor/retry/result roundtrip to an explicit session, uses the service-worker/page route first, and falls back to directed Runtime.evaluate on SPA/CSP bridge failures without retargeting. Use wait_for/wait_for_url instead of setTimeout or sleep Promises; BTAP retries only proven-undelivered work, never an acknowledged script whose side effects may already have run.
| Parameter | Type | Description |
|---|---|---|
script * | string | |
dialog_policy | string | |
no_monitor | boolean | |
session_id | ||
timeout | number |
cdp_command
Call one Chrome DevTools Protocol command. session_id accepts client:tabId; tab_id accepts either a native number or the same composite session string.
| Parameter | Type | Description |
|---|---|---|
method * | string | |
extension_id | ||
params_json | string | |
session_id | ||
tab_id | ||
target_id | ||
timeout | number |
save_pdf
Print a real-browser tab to a validated PDF file through bounded CDP. The file is written atomically only after valid non-empty PDF bytes are returned; a CDP timeout invalidates and detaches the debugger lease.
| Parameter | Type | Description |
|---|---|---|
save_path * | string | |
landscape | boolean | |
page_ranges | string | |
prefer_css_page_size | boolean | |
print_background | boolean | |
scale | number | |
session_id | ||
timeout | number |
debugger_targets
List every CDP-attachable target, including service workers and extension background pages that list_tabs never shows. Works with no tabs open.
| Parameter | Type | Description |
|---|---|---|
session_id |
cdp_batch
Run a CDP bridge batch command; pass the full JSON command object as text.
| Parameter | Type | Description |
|---|---|---|
batch_json * | string | |
session_id |
page_click
Click a CSS/structured locator or viewport coordinates in a specific real browser tab using background CDP input. Coordinates are viewport-relative CSS pixels (the space getBoundingClientRect reports), NOT the physical screen pixels mouse_click takes and NOT the device pixels capture_page_screenshot returns -- on a scaled display divide a screenshot pixel by devicePixelRatio first. Ambiguous or unreachable targets dispatch nothing; the tab is not activated and the desktop cursor does not move. Selector offsets are measured from the element's top-left corner; an omitted axis uses the element ce…
| Parameter | Type | Description |
|---|---|---|
button | string | |
clicks | integer | |
offset_x | ||
offset_y | ||
selector | ||
session_id | ||
timeout | number | |
x | ||
y |
page_type
Insert text into the focused element or a CSS/structured-locator field in a specific tab using background CDP input; xterm containers automatically retarget their helper textarea. Optionally clear and submit a key. Missing, ambiguous, or unusable targets dispatch nothing.
| Parameter | Type | Description |
|---|---|---|
text * | string | |
clear | boolean | |
selector | ||
session_id | ||
submit_key | string | |
timeout | number |
page_press
Press a key or comma-delimited modifier chord in a specific tab using background CDP input, without activating the tab.
| Parameter | Type | Description |
|---|---|---|
keys_csv * | string | |
session_id | ||
timeout | number |
page_drag
Drag between viewport coordinates in a specific tab using one background CDP input sequence, without activating the tab or moving the desktop cursor. Both endpoints are viewport-relative CSS pixels, like page_click's coordinate mode and unlike mouse_drag's physical screen pixels, and neither is hit-tested.
| Parameter | Type | Description |
|---|---|---|
x1 * | number | |
x2 * | number | |
y1 * | number | |
y2 * | number | |
button | string | |
duration | number | |
session_id | ||
timeout | number |
upload_files
Set files on a file input, which JS cannot do (input.files is read-only). Give a CSS selector for the <input type=file> and absolute local paths. Runs as a single CDP batch so the DOM node ids stay valid across the sequence.
| Parameter | Type | Description |
|---|---|---|
paths * | ||
selector * | string | |
session_id | ||
timeout | number |
get_cookies
Get cookies for the current page or specified tab via the Chrome extension bridge.
| Parameter | Type | Description |
|---|---|---|
session_id | ||
tab_id |
set_site_permission
Temporarily set an origin-scoped browser site permission for 60-600 seconds. Only http/https origins and notifications, geolocation/location, camera, microphone, or clipboard are supported. safe asks on every allow; lab skips prompts by default and restores session approval only when BROWSERTAP_LAB_NO_ELICIT is explicitly disabled. All leases restore their prior setting.
| Parameter | Type | Description |
|---|---|---|
permission * | string | |
setting * | string | |
duration_seconds | integer | |
origin | string | |
session_id |
reset_site_permissions
Restore matching temporary site-permission leases now. Omit origin and permission to reset every lease for the selected browser; origin accepts only http/https.
| Parameter | Type | Description |
|---|---|---|
origin | string | |
permission | string | |
session_id |
set_cookies
Write cookies into the real browser profile. Takes one cookie object or a list (JSON text is accepted): name is required, plus optional value/url/domain/path/expires (Unix seconds)/httpOnly/secure/sameSite. Uses CDP Network.setCookie so HttpOnly and cross-path cookies work; falls back to document.cookie only if CDP is unavailable, and then says which cookies could not carry HttpOnly. Cookies with neither url nor domain are scoped to the current page.
| Parameter | Type | Description |
|---|---|---|
cookies * | ||
session_id | ||
tab_id | ||
timeout | number |
delete_cookies
Delete a cookie by name from the real browser profile. Scope defaults to the current page (url), or pass domain/path/url to target another scope. Uses CDP Network.deleteCookies, falling back to expiring it via document.cookie.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
domain | ||
path | ||
session_id | ||
tab_id | ||
timeout | number | |
url |
storage_get
Read localStorage or sessionStorage. Give a key for one value, or omit it to dump every key (values are truncated past ~20k chars and truncated is reported). area='local' (default) or 'session'.
| Parameter | Type | Description |
|---|---|---|
area | string | |
key | ||
max_bytes | integer | |
max_items | integer | |
offset | integer | |
session_id | ||
timeout | number |
storage_set
Write one key into localStorage or sessionStorage and read it back to confirm. area='local' (default) or 'session'. Values are strings; non-string values are JSON-encoded first.
| Parameter | Type | Description |
|---|---|---|
key * | string | |
value * | string | |
area | string | |
session_id | ||
timeout | number |
capture_page_screenshot
Capture a viewport, full-page, or clipped screenshot of a page/tab via CDP with optional JPEG/WebP quality. Returns text metadata plus an attached MCP image even when save_path is set; save_path only controls disk output. image_width/image_height are DEVICE pixels (CSS x devicePixelRatio), not the CSS pixels page_click takes, and `size` is the byte count. If the current model cannot consume images, it has not seen the pixels and must use scan_page, execute_js, a page-specific API, or OCR instead. Base64 is included only when return_base64=true.
| Parameter | Type | Description |
|---|---|---|
clip | ||
format | string | |
full_page | boolean | |
quality | ||
return_base64 | boolean | |
save_path | string | |
session_id | ||
tab_id | ||
timeout | number |
capture_desktop_screenshot
Capture the complete visible virtual desktop across all displays and return text metadata plus MCP image content; this is not a background-tab screenshot, save_path only adds a disk copy, and return_base64 is opt-in. width/height/left/top are PHYSICAL screen pixels and are exactly the range mouse_click accepts, unscaled.
| Parameter | Type | Description |
|---|---|---|
return_base64 | boolean | |
save_path | string |
mouse_move
Move the real mouse cursor to absolute virtual-desktop coordinates in PHYSICAL screen pixels (the space pointer_info and capture_desktop_screenshot report, not the CSS pixels page_click takes). A point on no display is refused with coordinates_off_screen rather than clamped to a screen edge. Safe mode requires one-action approval; lab skips prompting by default and uses session approval only when BROWSERTAP_LAB_NO_ELICIT is explicitly disabled. By default BTAP foregrounds and verifies the selected browser tab after the quiet-input check; prefer an explicit session_id for browser input. activat…
| Parameter | Type | Description |
|---|---|---|
x * | integer | |
y * | integer | |
activate_session | ||
duration | number | |
session_id |
mouse_click
Click on the real desktop at absolute virtual-desktop coordinates in PHYSICAL screen pixels — the space pointer_info and capture_desktop_screenshot report, NOT the viewport CSS pixels page_click takes; on a scaled display the two differ by devicePixelRatio. A point on no display is refused with coordinates_off_screen rather than clamped to a screen edge. Pass session_id — the same one you pass every other tool (preferred) — and that tab is raised after the quiet check so the click lands on it. Without one the current global target is raised, which another task may have changed. Approval…
| Parameter | Type | Description |
|---|---|---|
activate_session | ||
button | string | |
clicks | integer | |
interval | number | |
session_id | ||
x | ||
y |
mouse_drag
Drag the real mouse from one point to another, both in absolute virtual-desktop PHYSICAL screen pixels (see mouse_click for how that differs from page_drag's CSS pixels). Either endpoint on no display is refused with coordinates_off_screen. Safe mode requires one-action approval; lab skips prompting by default and uses session approval only when BROWSERTAP_LAB_NO_ELICIT is explicitly disabled. By default BTAP foregrounds and verifies the selected browser tab after the quiet-input check; prefer an explicit session_id for browser input. activate_session='none' is only for intentional input to th…
| Parameter | Type | Description |
|---|---|---|
x1 * | integer | |
x2 * | integer | |
y1 * | integer | |
y2 * | integer | |
activate_session | ||
button | string | |
duration | number | |
session_id |
type_text
Type text via the real keyboard, optionally after clicking a field at click_x/click_y in absolute virtual-desktop PHYSICAL screen pixels (see mouse_click for how that differs from the CSS pixels the page_* tools take); a click point on no display is refused with coordinates_off_screen. Pass session_id — the same one you pass every other tool (preferred) — and that tab is raised after the quiet check so the keystrokes go to it. Without one the current global target is raised, which another task may have changed. Approval may foreground the selected browser tab. activate_session='none' types…
| Parameter | Type | Description |
|---|---|---|
text * | string | |
activate_session | ||
click_x | ||
click_y | ||
interval | number | |
session_id |
hotkey
Send a hotkey chord like 'command,l' or 'ctrl,shift,p' via the real keyboard. Safe mode requires one-action approval; lab skips prompting by default and uses session approval only when BROWSERTAP_LAB_NO_ELICIT is explicitly disabled. By default BTAP foregrounds and verifies the selected browser tab after the quiet-input check; prefer an explicit session_id for browser input. activate_session='none' is only for intentional input to the already-visible desktop or native UI.
| Parameter | Type | Description |
|---|---|---|
keys_csv * | string | |
activate_session | ||
session_id |
pointer_info
Report the current desktop mouse position and screen geometry in PHYSICAL pixels. screen_width/screen_height are the PRIMARY display only; screen_bounds is the virtual desktop across every display and is the range mouse_click will accept. These are not the CSS pixels the page_* tools take.