seleniumbase-mcp
OfficialServer Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| start_browserA | Launch a persistent SeleniumBase Pure CDP Mode browser session. Call this before using browser interaction tools such as navigate, get_content, click, 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 operation to complete before returning. If omitted, the browser starts without navigating to a specified URL. Returns: A confirmation message when the browser starts successfully, or a descriptive error if the browser startup fails. Startup behavior: If the initial launch fails, the tool automatically retries once. Lifecycle: Call start_browser once at the beginning of a browser automation workflow. Reusing the existing session preserves cookies, tabs, navigation history, localStorage/sessionStorage, and other browser state between tool calls. Call close_browser when finished. If a browser session is already running, this tool does not launch another browser and instead returns a message indicating that the existing session is active. Environment requirements: The MCP runtime must have a compatible Chrome or Chromium browser available. If the browser executable cannot be discovered, use use_chromium=True or provide browser_executable_path explicitly. |
| close_browserA | 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_infoA | 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. - url: The complete current page URL, including path and query string. - title: The current document title. - origin: The current page origin (scheme, host, and port). - user_agent: The browser's current User-Agent string. Tool selection: - Need URL, title, origin, or User-Agent -> use get_page_info. - Need visible page text or HTML -> use get_content. - Need information about matching elements -> use find_elements. - Need an immediate state check -> use check_condition. - Need to wait for a condition -> use wait_for. - Need to verify an expected condition -> use assert_condition. Unlike a dedicated browser-status tool, get_page_info is the single source of browser/page metadata. If no browser session is active, it returns {"running": False} instead of attempting to access a page. This operation does not navigate, reload, click, type, or otherwise modify the current page. |
| navigateA | Navigate the current browser tab to a URL. 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 when synchronization is required. Args: url: Destination URL. May be a complete URL such as "https://example.com" or a hostname such as "example.com". Returns: A confirmation message containing the requested URL. Tool selection: - Go to a new URL -> use navigate. - Return to the previous page -> use manage_history(action="back"). - Go forward in history -> use manage_history(action="forward"). - Refresh the current page -> use manage_history(action="reload"). |
| manage_historyA | Manage or inspect the current browser tab's navigation history. Use 'back' or 'forward' for history navigation, 'reload' to refresh while bypassing the cache, or 'list' to inspect history. Use 'navigate' for 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 page loads or redirects. Use get_page_info afterward to verify the resulting URL or title. |
| find_elementsA | 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, such
as those using Returns: A dictionary containing: - count: Number of matching elements found. - matches: A list of element dictionaries containing tag_name and text, plus html when include_html=True. If there's an error during search, then "error" is added into the returned dictionary with error details. Tool selection: - Need structured information about matching elements -> use find_elements. - Need the visible text/HTML of a page or a single element -> use get_content. - Need to click one of several matches -> use click with nth. - Need to know whether an element is present/visible -> use check_condition. Notes: Element handles cannot be persisted across MCP calls. If you find elements and then need to act on one, resolve it again with the appropriate interaction tool. |
| get_contentA | Read visible text, HTML, or discovered URLs from the selected element. Use this tool when you need to get actual page content or URL information rather than page metadata. Args: selector: CSS selector or SeleniumBase-supported XPath selector. Tool selection: - Need URL, title, origin, or User-Agent -> use get_page_info. - Need visible text -> use output_format="text". - Need page or element HTML -> use output_format="html". - Need URLs from the page or an element -> use output_format="urls". - Need structured information about matching elements -> use find_elements. - Need to check element presence/visibility -> use check_condition. - Need to wait for content to appear -> use wait_for. |
| get_attributesA | Read HTML attributes from the first matching element. Use this tool when you need the value of a specific HTML attribute, or all HTML attributes of an element. Attributes could be something such as href, src, value, class, id, name, type, aria-label, etc. Args: selector: CSS selector or SeleniumBase-supported XPath selector. Returns: The requested attribute(s). Tool selection: - Need one or more HTML attribute values from a specific element -> use this tool. - Need to discover multiple matching elements or inspect their text -> use 'find_elements'. - Need visible text or HTML content -> use 'get_content'. - Need to check element presence/visibility -> use 'check_condition'. This is a read-only operation. If there's no matching element found within the timeout, then @handle_sb_errors will return details from the exception raised. |
| check_conditionA | 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 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 exists.
- "visible": Return True when the matching element is visible.
Returns: True or False indicating whether the requested condition is currently satisfied. Missing elements return False rather than raising an exception. If there's an error, returns a string with error details. Tool selection: - Immediate boolean observation -> use check_condition. - Wait for a state/content transition -> use wait_for. - Verify an expected condition -> use assert_condition. - Need element details of matching elements -> use find_elements. - Need to read page or element content -> use get_content. Notes: This tool does not intentionally wait for elements or text to appear. It is intended for checking the current state only. If page timing or asynchronous loading matters, use wait_for instead. |
| clickA | 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:
Args:
selector: CSS selector, XPath selector, or supported SeleniumBase
text-matching selector. Text-matching selectors such as
Examples:
- Click one element: |
| hover_actionA | 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: selector1: The primary element selector. For action="none", this is the element to hover over. For action="click", this is the element to hover over before clicking selector2. For action="drag_and_drop", this is the draggable source element. Returns: A confirmation message describing the performed operation. Tool selection: - Simple hover -> action="none". - Hover over one element and then click another -> action="click". - Drag one element onto another -> action="drag_and_drop". Notes: For action="click", selector1 is the hover target and selector2 is the click target. |
| type_textA | 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:
The tool waits up to Args: selector: CSS or SeleniumBase selector identifying the target element. Returns: A confirmation message after the operation succeeds; otherwise the error handler returns the resulting failure. |
| select_optionA | Select an option from an HTML dropdown. Args: dropdown_selector: CSS selector identifying the element. Raises: An error when the dropdown or requested option cannot be found. This tool is for native elements. For custom JavaScript dropdowns made from div/button/list elements, use click or other element-interaction tools instead. |
| focusA | Scroll to, focus, or highlight an element. This tool does not click, type, select, hover, or otherwise activate the
element. Use Args: selector: CSS selector or SeleniumBase selector identifying the target. If there's no matching element found within the timeout, then @handle_sb_errors will return details from the exception raised. |
| wait_forA | 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_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 If If Args:
state:
- "present": Wait until the matching element exists.
- "visible": Wait until the matching element is visible.
- "not_visible": Wait until the matching element is not visible.
- "absent": Wait until the matching element no longer exists.
- "seconds_passed": Wait for the full Returns: A success message when the requested condition is reached. If the condition times out or the underlying wait fails, the tool returns the error produced by its error handler. Tool selection: - Inspect current state immediately -> check_condition. - Wait for a state change -> wait_for. - Verify an expectation -> assert_condition. |
| assert_conditionA | 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 Unlike check_condition, this tool does not merely return whether a condition is true: a failed expectation is an error. Unlike wait_for, its purpose is to verify an expectation, not merely synchronize with a changing page. Args: check: - "element_present": Verify that the selector identifies a present element. - "element_visible": Verify that the selector identifies a visible element. - "text_visible": Verify that expected text is visible within selector, or within the whole HTML document if selector is omitted. - "title": Verify the exact current page title immediately. - "url": Verify the exact current URL immediately. - "url_contains": Verify that the current URL contains expected immediately. Returns: A confirmation message when the assertion passes. If the assertion fails or times out, the error handler returns the resulting error instead of a success message. Tool selection: - Inspect a condition without failing -> check_condition. - Wait for a condition to become true -> wait_for. - Verify that an expected condition is true -> assert_condition. |
| manage_cookiesA | 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 browser session. - "save": Save current cookies to filename. The file may be created or overwritten. - "load": Load cookies from filename into the current browser session. Returns: "get_all": Current browser cookies. "clear": Confirmation that cookies were cleared. "save": Confirmation containing the destination filename. "load": Confirmation containing the source filename. Security: Cookie data can contain authentication credentials, session identifiers, and other private information. Only inspect, save, load, or share cookies when explicitly authorized. Notes: Loading saved cookies does not guarantee restoration of a login. Cookies may be expired, invalidated, domain/path restricted, or dependent on other browser state. Navigate to the relevant site when necessary so the browser has the appropriate origin for the cookies. |
| manage_storageA | 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 use: - Do not use this tool for HTTP cookies; use manage_cookies instead. - Do not use this tool for arbitrary page JavaScript; use run_javascript when a higher-level tool is insufficient. - Do not use this tool to inspect values from another origin; storage is scoped to the current page origin. Args: key: Storage key to read or modify. Returns: The stored value for get, or a confirmation message for set. Security: Web storage can contain authentication tokens, session identifiers, and other sensitive application state. Only use this tool with trusted sites and authorized MCP clients. Notes: Storage belongs to the current page origin. Values from one website are not generally available to another origin. |
| scrollA | 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. Values greater than 100 for Use focus(action="scroll_to_element") when the goal is to reveal a specific element rather than scroll the page by a relative amount. |
| manage_windowA | 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. Use this tool for browser-window geometry and state.
Use |
| manage_tabsA | Manage browser tabs, including opening new ones. Use this for listing, opening, switching, or closing tabs.
Use Args:
action:
- "list": Return each tab's index, URL, and title.
Use this to find the tab_index for "switch".
- "open": Open a new tab, optionally navigating it to Tab indexes are session-relative and may change after tabs are opened or closed. Use "list" to get current indexes before switching by index. |
| solve_captchaA | Attempt a SeleniumBase CDP-based CAPTCHA interaction, such as clicking a CAPTCHA checkbox, or performing a drag/drop action on a slider CAPTCHA. This tool attempts to interact with CAPTCHA controls such as Cloudflare
Turnstile, reCAPTCHA, hCaptcha, DataDome Slider, or FriendlyCaptcha via
the Chrome DevTools Protocol (CDP), which is stealthier than JavaScript
actions because CDP actions can avoid triggering This tool automatically detects the coordinates of CAPTCHA checkboxes for determining the correct location to perform the click. If no CAPTCHA is detected on the current page, then no click action is performed. The tool does not guarantee that the CAPTCHA was solved. Some CAPTCHA controls are embedded inside shadow DOM or otherwise do not expose an easy success signal. A successful attempt may result in changes to page state or browser cookies. Tool workflow: 1. Inspect the webpage with get_content when you need to determine whether CAPTCHA-related controls are present. 2. Call solve_captcha to attempt the CAPTCHA interaction. 3. Use get_page_info, get_content, check_condition, or manage_cookies to inspect resulting page/session state. Returns: A message confirming that the CAPTCHA interaction was attempted. (There's no guarantee that the CAPTCHA challenge was solved.) |
| save_outputA | 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 HTML file. - "pdf": Save the current page as a PDF. Side effects and filesystem behavior: This tool writes a file to the filesystem and may overwrite an existing file with the same output name. Only use trusted and authorized filesystem paths. The MCP process must have permission to write to the requested destination. Error behavior: If the browser session is not running, the tool returns a lifecycle error. Filesystem, browser, or SeleniumBase failures are converted into descriptive MCP error results by the server's error handler. When not to use: - Do not use this tool merely to read page text or HTML; use get_content instead. - Do not use this tool when you only need page metadata such as the URL or title; use get_page_info instead. - Do not use this tool to manipulate the page; use the appropriate interaction tool such as click, type_text, or select_option. Returns: A confirmation message containing the requested output format and filename after the save operation succeeds. |
| run_javascriptA | 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, type_text, select_option, hover_action, focus, scroll, and other higher-level tools for normal browser interactions. - Prefer get_content, get_attributes, and find_elements for reading page content or element information. - Prefer manage_storage for ordinary localStorage/sessionStorage reads and writes. - Prefer manage_cookies for browser cookie operations. - Use this tool when a required operation needs arbitrary JavaScript that the higher-level tools do not expose. Args: expression: A JavaScript expression or executable JavaScript code evaluated in the current page. It may reference standard browser globals such as document and window and may use DOM APIs. Returns: The JavaScript evaluation result when it can be serialized and returned across the MCP boundary. Primitive values, arrays, plain objects, and null are generally suitable return values. DOM objects, functions, symbols, and other non-serializable JavaScript values may not be returned directly; extract the needed property or convert the value to a serializable form first. Security: This provides unrestricted JavaScript execution in the current browser page. It can read or modify page data and interact with the page in ways that bypass the higher-level tool abstractions. Only expose this MCP server to trusted clients. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 24 tools
Each tool targets a clearly distinct browser operation, and descriptions include explicit 'Tool selection' guidance that resolves potential overlaps (e.g., check_condition vs wait_for vs assert_condition, get_content vs find_elements vs get_page_info). The few ambiguous pairs like scroll vs focus(action='scroll_to_element') are explicitly differentiated in the descriptions.
The tool set uses consistent snake_case throughout, but several tools are single verbs (navigate, click, focus, scroll) while most others follow a verb_noun pattern (start_browser, get_content, manage_cookies). This minor deviation is still readable and predictable overall.
24 tools is at the upper end and feels heavy for a single browser-automation server, even though most tools serve distinct purposes. The surface is comprehensive and well-organized, but it borders on over-provisioned for the stated scope.
The server covers browser lifecycle, navigation, content inspection, interaction, cookies/storage, windows/tabs, waits/assertions, CAPTCHA, and JavaScript fallback, which is a broad and coherent surface. Minor gaps include explicit alert/dialog handling, file upload, and full iframe switching, though some of these can be worked around via run_javascript or scoped click.