seleniumbase-mcp
v1.8.2MCP servers exposing SeleniumBase as tools for MCP clients.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
start_browser Start Browser
Launch a persistent SeleniumBase Pure CDP Mode browser session. Call this before using browser interaction tools such as open_url, get_content, click_element, type_text, or find_elements. The same browser session remains active across subsequent MCP tool calls until close_browser is called or the server process exits. Pure CDP Mode controls the browser through the Chrome DevTools Protocol (CDP), not WebDriver. Args: url: Optional URL to navigate to during browser startup. When provided, the tool waits for the browser launch/navigation…
| Parameter | Type | Description |
|---|---|---|
ad_block | boolean | |
browser_executable_path | ||
guest | boolean | |
headless | ||
incognito | boolean | |
proxy | ||
url | ||
use_chromium | boolean |
close_browser Close Browser
Close the active browser session and release browser resources. Call this when the browser automation workflow is finished. Closing the session ends the persistent browser state, including its open tabs, cookies, navigation history, and page state. If browser automation is needed afterward, start a new session with start_browser. This operation is safe to call when no browser session is active.
get_page_info Get Page Info
Get current browser session and page metadata. Use this as the primary tool for determining where the browser currently is after navigation, clicks, form submissions, redirects, reloads, or tab switches. This is a read-only metadata operation: It does not inspect arbitrary page content, find elements, check visibility, wait for conditions, or assert expected values. Returns: A dictionary containing: - running: True when browser metadata was successfully retrieved. False when no session is available or metadata retrieval failed. -…
open_url Open URL
Navigate the current browser tab to the URL provided. Use this when the browser needs to visit a new URL rather than move through its existing back/forward history. If the URL does not include a protocol such as "https://", SeleniumBase automatically prefixes "https://" before navigation. For example, "seleniumbase.io" becomes "https://seleniumbase.io". Navigation waits for the browser's navigation operation to complete before returning. Dynamic content may still be loading; use wait_for_condition when synchronization is required. If there's an error, tha…
| Parameter | Type | Description |
|---|---|---|
url * | string |
manage_history Manage History
Manage or inspect the current browser tab's navigation history. Use "back", "forward", or "reload" actions for history navigation. Use "list" to inspect history. (This one is read-only.) Use 'open_url' for navigation to an arbitrary URL. Args: action: - "back": Go to the previous history entry, if available. - "forward": Go to the next history entry, if available. - "reload": Reload the current page while ignoring the cache. - "list": Return the current history position and entries. Navigation actions can trigger pa…
| Parameter | Type | Description |
|---|---|---|
action | string |
find_elements Find Elements
Find matching elements and return structured element information. Use this tool when you need to discover how many elements match a selector, inspect their text/tag names, or inspect the HTML of multiple matches. This tool converts matching elements into ordinary serializable dictionaries. It does not return live SeleniumBase element objects. Args: selector: A CSS selector, or an XPath selector that SeleniumBase can convert to CSS. In sb.find_elements, SeleniumBase automatically attempts to convert XPath to CSS. Some XPath expressions,…
| Parameter | Type | Description |
|---|---|---|
selector * | string | |
include_html | boolean | |
timeout | number |
get_content Get Content
Get visible text, HTML, or discovered URLs from the selected element. Args: selector: CSS selector or SeleniumBase-supported XPath selector. Default: "body". output_format: - "text": Return visible text from the selected element. - "html": Return HTML from the selected element. - "urls": Return URLs discovered by SeleniumBase within the selected element. Returned URLs are normalized to full URLs with their protocol prefixes. timeout: Maximum seconds to wait for the target element. Default…
| Parameter | Type | Description |
|---|---|---|
output_format | string | |
selector | string | |
timeout | number |
get_attributes Get Attributes
Get a specific HTML attribute (or all attributes) from the selected element. Examples of possible attributes include href, src, value, class, id, name, type, aria-label, etc. Args: selector: CSS selector or SeleniumBase-supported XPath selector. If multiple elements match, then only the first one is used. attribute: Specific HTML attribute to retrieve. When omitted, returns all HTML attributes of the matching element as a dictionary. timeout: Maximum seconds to wait for the target element. Default: 5. Tool selection: -…
| Parameter | Type | Description |
|---|---|---|
selector * | string | |
attribute | ||
timeout | number |
check_if_condition Check Condition
Check the current state of an element or text without waiting for the condition to become true. Use this tool when you need an immediate boolean observation of the current page state. Use wait_for_condition when the condition may become true later and the workflow should wait for it. Use assert_condition when the condition is an expected requirement and failure should be treated as an assertion error. Args: check: The element state to inspect when text is not provided: - "present": Return True when at least one matching element exis…
| Parameter | Type | Description |
|---|---|---|
check | string | |
selector | string | |
text |
click_element Click Element
Click element(s) matching a CSS, XPath, or supported text selector. Use this tool for normal clicks, clicking a specific matching occurrence, clicking all visible matches, conditional clicks, or clicks scoped to a parent element. Selection behavior and priority: `nth` is 1-based and takes precedence over every other click mode. Otherwise, `all_matches=True` clicks every currently visible match. Otherwise, `only_if_visible=True` clicks only if a match is visible. Otherwise, `parent_selector` scopes the click to a nested element. If none…
| Parameter | Type | Description |
|---|---|---|
selector * | string | |
all_matches | boolean | |
nth | ||
only_if_visible | boolean | |
parent_selector | ||
scroll | boolean | |
timeout | number |
hover_action Hover / Click / Drag
Hover over an element, optionally click another, or drag-and-drop. Use this tool for hover interactions, hover-triggered menus, and drag-and-drop operations. Args: selector: The primary element selector. For action="hover", this is the element to hover over. For action="hover_and_click", this is the element to hover over before clicking 'secondary_selector'. For action="drag_and_drop", this is the draggable source element. secondary_selector: The secondary element selector. Requir…
| Parameter | Type | Description |
|---|---|---|
selector * | string | |
action | string | |
secondary_selector | ||
timeout | number |
type_text Type Text
Enter, append, directly set, or clear a value on a page element. Use this tool to modify text/value fields such as inputs, textareas, contenteditable elements, and supported input sliders. It changes the target element's value or content; it does not submit a form or click other elements. Choose the mode based on the desired interaction: - "fill_input": Normal user-like entry; clears the existing value first. - "append": Preserves the existing value and adds text via keystrokes. - "fast_type": Clears the existing value and types without typing pauses. - "s…
| Parameter | Type | Description |
|---|---|---|
selector * | string | |
mode | string | |
text | string | |
timeout | number |
select_option Select Option
Select an option from an HTML <select> dropdown. Changing a dropdown selection can trigger additional events on a page. Args: dropdown_selector: CSS selector identifying the <select> element. value: The option's visible text, its HTML value attribute, or its 0-based index, depending on by. by: - "text": Match the option's visible text. - "value": Match the option's HTML value attribute. - "index": Match the option's 0-based position. Both integer and numeric-string values are accepted. Raises…
| Parameter | Type | Description |
|---|---|---|
dropdown_selector * | string | |
value * | ||
by | string |
focus_element Focus Element
Scroll to, focus, or highlight an element. This tool does not click, type, select, hover, or otherwise activate the element. Use `click_element`, `type_text`, or `hover_action` for those operations. Args: selector: CSS selector or SeleniumBase selector identifying the target. action: - "scroll_to_element": Scroll the element into the viewport. - "focus": Move keyboard focus to the element. - "highlight": Temporarily highlight the element for debugging or demonstration by changing the border color. May affect t…
| Parameter | Type | Description |
|---|---|---|
selector * | string | |
action | string | |
timeout | number |
wait_for_condition Wait For Condition
Wait for a page condition or for a specified duration. Use this for synchronization when a dynamic page may need time to reach a condition before the next automation step. The tool blocks until the condition is met or the timeout expires. It does not intentionally scroll, click, or otherwise modify the page while waiting. Use check_if_condition to inspect the current state without waiting. Use assert_condition to verify an expected condition rather than synchronize with a changing page. When the condition is not reached before `timeout`, the underlying Se…
| Parameter | Type | Description |
|---|---|---|
selector | ||
state | string | |
text | ||
timeout | number |
assert_condition Assert Condition
Verify a browser condition and report failure as an error. Use this tool when an expected page state must be explicitly verified. It is a read-only verification operation: it does not click, type, navigate, scroll, or otherwise intentionally modify the page. Element and text assertions may block while SeleniumBase waits for the condition, up to `timeout` seconds. Title and URL assertions are checked immediately and ignore `timeout`. A failed assertion or timeout is handled by `handle_sb_errors` and returned as a descriptive tool error; it is not reported as a…
| Parameter | Type | Description |
|---|---|---|
check | string | |
exact | boolean | |
expected | ||
selector | ||
timeout | number |
manage_cookies Manage Cookies
Manage cookies for the current browser session. Use this tool to inspect, clear, save, or restore browser cookies. Cookie management is useful for inspecting session state, preserving login sessions between browser runs, restoring previously saved sessions, or resetting website state during testing. Args: action: - "get_all": Return all cookies currently available to the browser, including attributes such as name, value, domain, path, expiry, and security flags. - "clear": Delete all cookies from the current brow…
| Parameter | Type | Description |
|---|---|---|
action | string | |
filename | string |
manage_storage Manage Storage
Get or set a key in localStorage or sessionStorage. Use this tool when the browser workflow needs to inspect or modify JavaScript Web Storage belonging to the current page origin. Tool selection: - Need localStorage/sessionStorage -> use this tool. - Need cookies or authentication cookies -> use manage_cookies. - Need arbitrary JavaScript or storage operations not covered here -> use run_javascript. - Need visible page content or HTML -> use get_content. - Need an element's HTML attributes -> use get_attributes. When not to u…
| Parameter | Type | Description |
|---|---|---|
key * | string | |
action | string | |
storage | string | |
value |
scroll_page Scroll Page
Scroll the current page vertically. Args: direction: - "up": Scroll upward by amount percent of the window height. - "down": Scroll downward by amount percent of the window height. - "top": Scroll directly to the top; amount is ignored. - "bottom": Scroll directly to the bottom; amount is ignored. amount: Percentage of the current viewport height used for relative up/down scrolling. For example, amount=25 scrolls approximately one quarter of the viewport height. Notes: Values greater than…
| Parameter | Type | Description |
|---|---|---|
amount | integer | |
direction | string |
manage_window Manage Window
Get or change browser window geometry or state. Args: action: - "get_rect": Return the current window position and size. - "set_rect": Set x, y, width, and height. All four are required. - "maximize": Maximize the browser window. - "minimize": Minimize the browser window. x: Horizontal screen position for "set_rect". y: Vertical screen position for "set_rect". width: Window width for "set_rect". height: Window height for "set_rect". Notes: Use this tool for browser-window geometry and…
| Parameter | Type | Description |
|---|---|---|
action | string | |
height | ||
width | ||
x | ||
y |
manage_tabs Manage Tabs
Manage browser tabs, including opening new ones. Use this for listing, opening, switching, or closing tabs. Use `open_url` and `manage_history` for navigation within the active tab. Args: action: - "list_tabs": Return each tab's index, URL, and title. Use this to find the tab_index for "switch_to_tab". - "open_new_tab": Open a new tab, optionally navigating to `url`. - "switch_to_tab": Switch to the tab at tab_index from "list_tabs". - "switch_to_newest_tab": Switch to the newest tab. - "close_activ…
| Parameter | Type | Description |
|---|---|---|
action | string | |
switch_to | boolean | |
tab_index | ||
url |
solve_captcha Solve CAPTCHA
Attempts a SeleniumBase CDP interaction (click or drag/drop) to solve detectable CAPTCHAs on the current page. Supported CAPTCHAs: - CF Turnstile, reCAPTCHA, hCaptcha, DataDome Slider, FriendlyCaptcha Tool workflow: 1. Inspect page structure (e.g., via `get_content`) to verify that a CAPTCHA is present. 2. Call `solve_captcha` if there's a CAPTCHA. (No-op if no CAPTCHA.) 3. Verify success via `get_page_info`, `get_content`, or `manage_cookies`. Notes: This tool does not guarantee that the CAPTCHA gets solved. A successful attempt may re…
save_page Save Page
Save the current browser page to a local filesystem file. Use this tool when the browser workflow needs a persistent file artifact from the current page: a PNG screenshot, the current page source as HTML, or a PDF representation of the current page. A browser session must already be running. This tool operates on the currently active browser tab and does not navigate, click, type, or otherwise modify the webpage. Args: format: - "screenshot": Save a PNG screenshot of the current page. - "html": Save the current page source as an HT…
| Parameter | Type | Description |
|---|---|---|
filename | ||
folder | ||
format | string |
run_javascript Run JavaScript
Evaluate a JavaScript expression in the current page context. Use this only when the required browser operation cannot be accomplished through the higher-level SeleniumBase tools. The expression is evaluated through Chrome DevTools Protocol Runtime.evaluate in the currently active page. It executes with access to the page's JavaScript context, including DOM APIs, browser storage, and other same-origin page resources available to JavaScript. Tool selection: - Prefer click_element, type_text, select_option, hover_action, focus_element, scroll_page…
| Parameter | Type | Description |
|---|---|---|
expression * | string |