Skip to main content
Glama

SeleniumBase MCP Servers

This package provides three different SeleniumBase MCP servers for driving stealthy browser automation over the Model Context Protocol.

Here are the three server variants in this folder:

File

Backs onto

Best for

cdp_server.py

seleniumbase.sb_cdp.Chrome() (Pure CDP Mode, sync)

Scraping/automation against bot-detection (Cloudflare, etc.) No WebDriver at all. Includes CAPTCHA-solving.

driver_server.py

seleniumbase.Driver() (WebDriver)

General automation with Selenium ecosystem support.

sb_server.py

seleniumbase.SB() (used without with, via manual __enter__/__exit__)

The broadest API surface: Everything Driver offers, plus drag-and-drop, MFA-handling, file downloads, etc. Can switch to CDP Mode mid-flow via activate_cdp_mode

All three set headless=False by default, where the browser window is visible unless you pass headless=True when starting a session.

Point your MCP client config at whichever *_server.py fits the task (see step 3 below), or register all three under different names.

1. Install

(Requires Python 3.10+ and uv)

git clone https://github.com/seleniumbase/seleniumbase-mcp.git
cd seleniumbase-mcp
uv sync

uv sync reads pyproject.toml, creates a .venv/ in this folder, and installs the seleniumbase[mcp] dependency along with this project itself, which registers three console-script commands via [project.scripts]:

  • seleniumbase-cdp

  • seleniumbase-driver

  • seleniumbase-sb

Each just calls that server file's main() function (mcp.run(transport="stdio")). This is what lets uv run <name> work as the MCP client command in steps 3 and 4 below.

# SeleniumBase's Driver() and SB() formats need a browser driver downloaded:
uv run seleniumbase get chromedriver
# (Not needed for the "seleniumbase-cdp" Pure CDP Mode MCP Server,
#  which doesn't use WebDriver at all.)

(No uv? A regular python3 -m venv venv && pip install -e . works too if you substitute python <script>.py for uv run <name> everywhere below, and use absolute venv/bin/python + script paths in your MCP client config instead of the path-free options.)

Related MCP server: seleniumbase-mcp

2. Try it standalone (optional sanity check)

uv run mcp dev cdp_server.py

That opens the MCP Inspector for SeleniumBase's "Pure CDP Mode" MCP Server, where you can test commands ("Tools"). Ctrl+C to exit. Next step is wiring it into a client.

3. Connect it to Claude Desktop

Claude Desktop doesn't run from a "project" directory the way Claude Code does, so a bare uv run <name> isn't guaranteed to find this repo. Two ways to get a stable config:

Option A — global install (recommended, zero paths anywhere):

uv tool install .    # from inside the repo, installs the 3 commands globally

This puts seleniumbase-driver/seleniumbase-cdp/seleniumbase-sb on your PATH permanently (run uv tool ensurepath once if it warns that its bin directory isn't on PATH yet). Then claude_desktop_config.json can be just:

{
  "mcpServers": {
    "seleniumbase-cdp": { "command": "seleniumbase-cdp" },
    "seleniumbase-driver": { "command": "seleniumbase-driver" },
    "seleniumbase-sb": { "command": "seleniumbase-sb" }
  }
}

Option B — point uv at the repo directly (one absolute path, but no venv/interpreter path to track down, and no separate install step):

{
  "mcpServers": {
    "seleniumbase-cdp": {
      "command": "uv",
      "args": ["--directory", "/absolute/path/to/seleniumbase-mcp", "run", "seleniumbase-cdp"]
    },
    "seleniumbase-driver": {
      "command": "uv",
      "args": ["--directory", "/absolute/path/to/seleniumbase-mcp", "run", "seleniumbase-driver"]
    },
    "seleniumbase-sb": {
      "command": "uv",
      "args": ["--directory", "/absolute/path/to/seleniumbase-mcp", "run", "seleniumbase-sb"]
    }
  }
}

The location of claude_desktop_config.json depends on your system:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Restart Claude Desktop. You should see a 🔨 tools icon indicating the server(s) connected, with tools like start_browser, open_url, click_element, etc. available. Only keep the entries you actually want. Three separate browser-automation servers is a lot if you only need one.

4. Connect it to Claude Code

This repo's .mcp.json is checked in and ready to use as-is. No path editing is required because uv run <name> resolves this project from pyproject.toml in the current directory:

{
  "mcpServers": {
    "seleniumbase-cdp": {
      "type": "stdio",
      "command": "seleniumbase-cdp",
      "args": []
    },
    "seleniumbase-driver": {
      "type": "stdio",
      "command": "seleniumbase-driver",
      "args": []
    },
    "seleniumbase-sb": {
      "type": "stdio",
      "command": "seleniumbase-sb",
      "args": []
    }
  }
}

Claude Code auto-loads .mcp.json from the directory you launch claude in, so as long as you run claude from inside this repo (or a clone of it), it just works.

If you'd rather register the servers manually instead of relying on .mcp.json:

claude mcp add seleniumbase-cdp -- uv run seleniumbase-cdp
claude mcp add seleniumbase-driver -- uv run seleniumbase-driver
claude mcp add seleniumbase-sb -- uv run seleniumbase-sb

(run from inside the repo directory, for the same reason as above.)

Tools exposed (driver_server.py)

Tool

Purpose

start_browser(browser, headless, uc, incognito)

Launch a browser session (headless defaults to False)

close_browser()

End the session

open_url(url)

Go to a URL

go_back() / go_forward() / refresh_page()

History navigation

get_current_url() / get_title()

Page metadata

get_page_source()

Full HTML

get_text(selector)

Visible text of an element

find_elements_count(selector)

Count matches

is_element_visible(selector)

Visibility check

click_element(selector, timeout)

Click (CSS or XPath)

type_text(selector, text, clear_first, timeout)

Fill a field

select_option_by_text(dropdown_selector, option)

Choose a dropdown option

wait_for_element_present(selector, timeout)

Explicit wait

switch_to_frame(selector) / switch_to_default_content()

iframe handling

assert_text(text, selector)

Verify text is present

save_screenshot(filename)

Save a screenshot

execute_script(script)

Run a JS script

Design notes / things to adapt for your use case

  • Single global session. Each server holds one browser session at a time. This matches how MCP servers are typically launched (one process per client connection) and keeps the tool surface simple. If you need multiple concurrent browser tabs/sessions, you'd extend this to a dict of named sessions and add a session_id parameter to each tool.

  • Blocking calls. SeleniumBase's calls are synchronous and will block the server while a page loads or an element is waited on. For a single-user local tool this is fine; for a multi-client server you'd want to run them in a thread pool via asyncio.to_thread.

  • Headless vs Headed. Default is headed (headless=False) so you can watch the browser work and so sites that block headless Chrome still function. Pass headless=True for background/server use once you've confirmed a flow works. sb_server.py's uc=True (undetected- chromedriver) also helps against bot-detection walls.

Extending

Adding a tool is just adding a @mcp.tool()-decorated function that calls the matching SeleniumBase method — SeleniumBase has methods for file uploads, hovering, alerts, network conditions, and more that aren't wrapped above yet.


cdp_server.py — Pure CDP Mode

Wraps seleniumbase.sb_cdp.Chrome, SeleniumBase's stealthiest mode: the browser is driven entirely over the Chrome DevTools Protocol, no WebDriver in the loop at all. Reference: cdp_mode_methods.md.

Tool groups

Group

Tool(s)

Session

start_browser(url, headless, use_chromium, browser_executable_path, incognito, guest, ad_block, proxy), close_browser

Navigation

open_url, manage_history(action: back/forward/reload/list), get_page_info (running status, url, title, origin, user agent, history in one call)

Finding & reading

find_elements(selector, timeout, include_html), get_content(selector, output_format: text/html/urls), get_attributes, check_for_condition(check: present/visible/count/text_visible)

Interacting

click_element(selector, nth, all_matches, only_if_visible, parent_selector, timeout, scroll), hover_action(selector1, selector2, action: hover/hover_and_click/drag_and_drop), type_text(mode: fill_input/append/fast_type/set_value/clear_only), select_option(by: text/value/index), focus_element(action: scroll_to_element/focus/highlight)

Waiting

wait_for_condition(state: present/visible/not_visible/absent/seconds_passed, text)

Assertions

assert_condition(check: element_present/element_visible/text_visible/title/url/url_contains)

Cookies & storage

manage_cookies(action: get_all/clear/save/load), manage_storage(storage: local/session, action: get/set)

Scrolling

scroll_page(direction: up/down/top/bottom, amount)

Windows & tabs

manage_window(action: get_rect/set_rect/maximize/minimize), manage_tabs(action: list/open/switch/switch_newest/close_active)

Captcha

solve_captcha

Output & misc

save_page(format: screenshot/html/pdf), run_javascript

CDP-specific design notes

  • Elements don't cross the wire as handles. In native CDP Mode, find_element() returns a live object with its own methods (el.click(), el.get_html(), ...). MCP tools can only return JSON-serializable data, so find_element_info/find_all_info resolve the element immediately to a plain dict (tag_name, text, html) instead of returning a handle you could call further methods on. If you need to act on one of several matches, use click_nth_element (acts by position) rather than "find, then click" as two separate steps.

  • Captcha solving isn't universal. solve_captcha handles supported challenge types (e.g. Cloudflare Turnstile in the SeleniumBase demo app); it isn't a guaranteed bypass for arbitrary CAPTCHAs.

  • Session teardown. sb.quit() (used by close_browser) is the documented way to end a session; the browser also auto-closes if the process exits without it.


sb_server.py — SB() without the with statement

Wraps seleniumbase.SB(), normally used as a context manager:

with SB(uc=True) as sb:
    sb.goto(...)

An MCP server's tool calls happen one at a time across separate function invocations — there's no single indented block to put with around — so this server calls the context manager protocol manually instead:

sb_context = SB(**kwargs)
sb = sb_context.__enter__()   # in start_browser
...
sb_context.__exit__(None, None, None)   # in close_browser

sb is a BaseCase instance, SeleniumBase's broadest API — a superset of what Driver (in driver_server.py) exposes, plus UC Mode stealth helpers and a few extras driver_server.py/cdp_server.py don't have. This server focuses on those extras rather than re-wrapping everything already covered:

Group

Tools

UC/CDP stealth

activate_cdp_mode (flips the same session into Pure CDP Mode mid-flow)

Extra interactions

hover_and_click, drag_and_drop, double_click, context_click, choose_file (upload)

MFA

get_mfa_code, enter_mfa_code (TOTP/Google-Authenticator-style codes from a secret key)

Files

download_file

Site health

assert_no_404_errors, assert_no_js_errors

Visual feedback

highlight, flash

Plus the same core navigation/interaction/waiting/assertions/cookies/ scrolling/tabs/output tools as the other two servers, called through the BaseCase method names (e.g. sb.goto, sb.click, sb.assert_element) rather than Driver's or CDP's.

SB()-specific design notes

  • UC Mode (stealth mode) requires uc=True at startup. Pass it in start_browser up front if you'll need them.

  • activate_cdp_mode doesn't start a new session. It switches the existing sb session's underlying mode to Pure CDP for subsequent actions — it's a mid-flow escalation, not a fresh browser.

Available Tools

24 tools
assert_conditionAssert ConditionA
Read-onlyIdempotent

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 successful result.

Unlike check_if_condition, this tool does not merely return whether a condition is true: a failed expectation is an error. Unlike wait_for_condition, 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.

selector: CSS or SeleniumBase selector for element and text checks.
    Required for element checks; optional for text_visible.

expected: Expected text, title, or URL value. Required for
    text_visible, title, url, and url_contains.

exact: For text_visible only, require an exact text match instead
    of a substring match.

timeout: Maximum seconds to wait for element/text assertions.
    Must be >= 0. Ignored for title and URL assertions.

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_if_condition. - Wait for a condition to become true -> wait_for_condition. - Verify that an expected condition is true -> assert_condition.

Inputs: check, exact, timeout, expected, +1 more. Returns: result

check_if_conditionCheck ConditionA
Read-onlyIdempotent

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 exists. - "visible": Return True when the matching element is visible. check is ignored when text is provided.

selector:
    CSS selector or SeleniumBase selector identifying the element.

text:
    Optional text to check for visibility within `selector`. When
    provided, this takes precedence over `check`; the tool checks text
    visibility instead of element presence or visibility. Use this when
    the question is "Is this text currently visible?" rather than
    whether the element itself is present or 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_if_condition. - Wait for a state/content transition -> use wait_for_condition. - 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_condition instead.

Inputs: text, check, selector. Returns: result

click_elementClick ElementA

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 of the above are set, then a regular click is performed.

Args: selector: CSS selector, XPath selector, or supported SeleniumBase text-matching selector. Text-matching selectors such as a:contains("Sign in") are supported only for single-element clicks; do not use them with all_matches=True.

nth: 1-based occurrence to click when multiple elements match.
    Must be >= 1 if provided. Takes precedence over `all_matches`,
    `only_if_visible`, and `parent_selector`.

all_matches: If True, click every currently visible matching element
    in order of appearance. Ignored when `nth` is provided. Use only
    when multiple clicks are intentionally desired, such as for
    clicking all the checkboxes in a section of a webpage.
    If any of the click actions induces page navigation, then
    subsequent clicks are cancelled without any exceptions raised.

only_if_visible: If True, click only when the target is already
    visible; do not wait for it to become visible.

parent_selector: CSS/XPath selector for the parent/container in which
    to find `selector`. Used only for the nested-click mode.
    Can be used to click an element inside a parent iframe.

timeout: Maximum seconds to wait for a normal click operation.
    Default: 5. Not used by conditional or bulk click modes.

scroll: If True, scroll the target into view before a normal or
    indexed click. Default: True.

Examples: - Click the first button: click_element("button") - Click the 2nd button: click_element("button", nth=2) - Click all checkboxes: click_element('input[type="checkbox"]', all_matches=True) - Click the first visible link: click_element("a", only_if_visible=True) - Click the first button that's inside the first iframe: click_element("button", parent_selector="iframe")

Error behavior: With the exception of using 'only_if_visible=True', if there's no matching element found within the timeout, then @handle_sb_errors returns details from the exception raised.

When not to use: - Do not use this tool if you need to hover an element first before clicking; use hover_action with action="hover_and_click" instead.

Inputs: selector (required), nth, scroll, timeout, +3 more. Returns: result

close_browserClose BrowserA
Idempotent

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.

Inputs: no named parameters. Returns: result

find_elementsFind ElementsA
Read-onlyIdempotent

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 contains(...), cannot be converted to CSS and therefore aren't supported by this tool.

timeout: Maximum number of seconds to wait for at least one matching
    element to appear. If the selector is an XPath selector that
    cannot be converted into a valid CSS selector, then the wait
    might be less than the timeout.

include_html: If True, include each matching element's outer HTML.
    If False, return only tag name and text.

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_element with nth. - Need to know whether an element is present/visible -> use check_if_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.

For uncaught errors, @handle_sb_errors returns strings.

Inputs: selector (required), timeout, include_html. Returns: result

focus_elementFocus ElementA

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 timing
      and/or reduce stealth.

timeout: Maximum seconds to wait for the target element. Default: 5.

If there's no matching element found within the timeout, then @handle_sb_errors returns details from the exception raised.

Inputs: selector (required), action, timeout. Returns: result

get_attributesGet AttributesA
Read-onlyIdempotent

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: - 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_if_condition'.

If there's no matching element found within the timeout, then @handle_sb_errors returns details from the exception raised.

Inputs: selector (required), timeout, attribute. Returns: result

get_contentGet ContentA
Read-onlyIdempotent

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: 5.

Tool selection: - Need URL, title, origin, or User-Agent -> use get_page_info. - Need visible text, html, or URLs on a page -> use get_content. - Need structured information about matching elements -> use find_elements. - Need to check element presence/visibility -> use check_if_condition. - Need to wait for content to appear -> use wait_for_condition.

If there's no matching element found within the timeout, then @handle_sb_errors returns details from the exception raised.

Inputs: timeout, selector, output_format. Returns: result

get_page_infoGet Page InfoA
Read-onlyIdempotent

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_if_condition. - Need to wait for a condition -> use wait_for_condition. - 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.

Inputs: no named parameters. Returns: object

hover_actionHover / Click / DragA

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.
    Required for action="hover_and_click", where it identifies
    the element to click after hovering 'selector'.
    Required for action="drag_and_drop", where it identifies the
    destination/drop target.
    Not used for action="hover".

action:
    - "hover": Hover over 'selector' only.
    - "hover_and_click": Hover over 'selector', then click
      'secondary_selector' after a short moment has passed.
    - "drag_and_drop": Drag 'selector' and drop it onto
      'secondary_selector'.

timeout: Maximum seconds to wait for 'selector'.
    For drag_and_drop, the same timeout applies to secondary_selector.
    For hover_and_click, SeleniumBase uses its own short wait for
    secondary_selector; this parameter does not extend that secondary
    wait.

Returns: A confirmation message describing the performed operation's result.

Error behavior: If a required element cannot be found or interacted with within the applicable wait period, or if an error occurs during the action, the resulting exception message is returned through @handle_sb_errors. Failing actions such as failed hover_and_click will raise exceptions.

When not to use: - Do not use this tool to click if you don't need to hover an element before clicking another; use 'click' instead.

Inputs: selector (required), action, timeout, secondary_selector. Returns: result

manage_cookiesManage CookiesA
Idempotent

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.

filename: The sanitized filesystem path used by save/load.
    Ignored for get_all and clear.

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.

The save action can overwrite existing files.

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.

Inputs: action, filename.

manage_historyManage HistoryA

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 page loads or redirects. Use 'get_page_info' afterward to verify the resulting URL or title.

Inputs: action. Returns: result

manage_storageManage 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.

value: Value to store when action="set". Required for set.

storage: "local" for localStorage or "session" for sessionStorage.

action: "get" to read the key or "set" to write the key.

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.

Inputs: key (required), value, action, storage.

manage_tabsManage TabsA

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_active_tab": Close the active tab. This action must be followed by a 'manage_tabs' action that switches to a new tab, such as "switch_to_tab" or "switch_to_newest_tab".

url: URL for "open_new_tab". If not provided, "about:blank" is used.

tab_index: Tab index from "list_tabs" that is only used for the
    "switch_to_tab" action.)

switch_to: If using "open_new_tab", switch to the new tab when True.

Notes: Tab indexes are session-relative and may change after tabs are opened or closed. Use "list_tabs" to get current indexes before switching by index.

Error behavior: If there's an error during any of the tab actions, then @handle_sb_errors will propagate the exception as an error message.

Inputs: url, action, switch_to, tab_index. Returns: result

manage_windowManage WindowA
Idempotent

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 state. Use manage_tabs for switching between browser tabs.

Inputs: x, y, width, action, +1 more. Returns: result

open_urlOpen URLA

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, that gets propagated through @handle_sb_errors.

Args: url: The 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 if successful.

Tool selection: - Navigate to a new URL -> use open_url. - 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").

Inputs: url (required). Returns: result

run_javascriptRun 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_element, type_text, select_option, hover_action, focus_element, scroll_page, 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.

    Examples:
        - "document.title"
        - "document.querySelector('button')?.textContent"
        - "localStorage.getItem('theme')"
        - "document.body.classList.contains('dark')"
        - "document.querySelector('#slider').value = '50'"

    The expression should produce a value when a result is needed.
    JavaScript that returns a Promise is supported and its resolved
    value is returned.

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.

Inputs: expression (required).

save_pageSave PageA

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.

filename:
    Optional output filename. If omitted, defaults to:
    - "screenshot.png" for format="screenshot"
    - "page_source.html" for format="html"
    - "page.pdf" for format="pdf"

folder:
    Optional destination folder passed to SeleniumBase.
    If omitted, SeleniumBase uses its default output location.

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.

The tool does not upload, publish, or transmit the saved file by
itself. The resulting file remains in the filesystem available to
the MCP server process.

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_element, type_text, or select_option.

Returns: A confirmation message containing the requested output format and filename after the save operation succeeds.

Inputs: folder, format, filename. Returns: result

scroll_pageScroll PageA

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 100 for amount are allowed. For example, 200 means approximately two viewport heights.

Tool selection: - Need to reveal a specific element -> use 'focus_element' with action="scroll_to_element". - Need to scroll the page by a relative amount -> use 'scroll_page'.

Inputs: amount, direction. Returns: result

select_optionSelect OptionA

Select an option from an HTML dropdown.

Changing a dropdown selection can trigger additional events on a page.

Args: dropdown_selector: CSS selector identifying the 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: 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_element or other element-interaction tools instead.

Inputs: value (required), dropdown_selector (required), by. Returns: result

solve_captchaSolve CAPTCHAA

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 result in changes to page state and cookies.

Tool Selection:

  • Use solve_captcha specifically for automated CAPTCHA widget interactions.

  • Use click_element for standard visible elements.

  • Use hover_action (action="hover_and_click") to reveal and click targets.

Returns: A confirmation message indicating that the attempt was initiated.

Inputs: no named parameters. Returns: result

start_browserStart BrowserA
Idempotent

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 operation to complete before returning. If omitted, the browser starts without navigating to a specified URL.

headless: Controls whether the browser runs without a visible window.
    True forces headless mode; False forces headed mode. If None, this
    tool defaults to headless on Linux and headed on Windows/macOS.

use_chromium: Use Chromium instead of Google Chrome. This is useful
    when Google Chrome is not installed. SeleniumBase can manage the
    Chromium browser when this option is enabled.

browser_executable_path: Optional path to the browser executable.
    Use this when the desired browser is installed at a non-standard
    location. Mutually exclusive with use_chromium.

incognito: Launch Chrome/Chromium in incognito mode.

guest: Launch Chrome/Chromium in guest mode.
    Do not combine this with incognito=True.

ad_block: Enable SeleniumBase's basic ad-blocking functionality.

proxy: Optional proxy server.
    Examples include "SERVER:PORT" or "USER:PASS@SERVER:PORT".

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.

Inputs: url, guest, proxy, ad_block, +4 more. Returns: result

type_textType 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:

  • "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.

  • "set_value": Sets the value directly without simulating key events; prefer this for fast programmatic value changes when keyboard events are not required.

  • "clear_only": Clears the existing value; text is ignored.

The tool waits up to timeout seconds for the target element. If the target cannot be used successfully, the underlying SeleniumBase error is handled by handle_sb_errors rather than returning a success message.

Args: selector: CSS or SeleniumBase selector identifying the target element.

text: Text/value to enter or set. Ignored for "clear_only".

mode: Interaction mode. See the mode descriptions above.

timeout: Maximum seconds to wait for the target element.
    Must be appropriate for the page's expected load/interaction time.

Returns: A confirmation message after the operation succeeds; otherwise the error handler returns the resulting failure.

Notes: Including "\n" in your text (except in "set_value" mode) will simulate pressing the "Enter" key, which is useful for submitting forms or triggering search inputs without needing a separate click.

Tool selection: - Need to update text that appears in a text field -> use this tool. - Need to update the value of a element -> use select_option.

Inputs: selector (required), mode, text, timeout. Returns: result

wait_for_conditionWait For ConditionA
Read-onlyIdempotent

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 SeleniumBase wait failure is handled by the tool's error handler rather than returning a success confirmation.

If state="seconds_passed", selector and text are ignored and the tool blocks for the full timeout seconds.

If text is supplied, present/visible wait for the text to appear, while absent/not_visible wait for the text to disappear. If no selector is supplied, text is searched within the page body.

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 timeout duration.

selector: CSS or SeleniumBase selector for the element.
    Required unless `text` is supplied or `state="seconds_passed"`.

text: Optional text to wait for or wait to disappear.
    With text, `present` and `visible` are equivalent,
    as are `absent` and `not_visible`.

timeout: Maximum seconds to wait for the condition;
    for `seconds_passed`, the exact duration to wait. Must be >= 0.

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_if_condition. - Wait for a state change -> wait_for_condition. - Verify an expectation -> assert_condition.

Inputs: text, state, timeout, selector. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.7/5.0

    Scored across 24 tools

    Disambiguation4/5

    Most tools have clearly distinct purposes (click_element vs type_text vs select_option vs hover_action), and the descriptions include explicit 'Tool selection' guidance to disambiguate overlapping read/check/wait/assert tools. However, check_if_condition, wait_for_condition, and assert_condition form a closely related trio that could still cause misselection despite the guidance.

    Naming Consistency4/5

    Tool names mostly follow a consistent verb_noun pattern (start_browser, close_browser, click_element, type_text, find_elements, get_content, manage_cookies, manage_tabs, manage_window, manage_history, manage_storage, scroll_page, save_page, open_url, hover_action, select_option, focus_element, run_javascript, solve_captcha). Minor deviations: check_if_condition, wait_for_condition, and assert_condition use a different 'condition' suffix pattern, and get_page_info breaks the get_* noun pattern slightly.

    Tool Count4/5

    24 tools is on the higher end but appropriate for a full browser automation server covering lifecycle, navigation, element interaction, state inspection, storage, tabs, windows, and page saving. The count is justified by the breadth of the domain, though it is close to the threshold where it starts feeling heavy.

    Completeness5/5

    The tool surface covers the full browser automation lifecycle: browser start/close, navigation, history, tabs, windows, element finding/clicking/typing/selecting/hovering/focusing, content reading, attribute reading, condition checking/waiting/asserting, cookies, storage, JavaScript execution, captcha solving, and page saving. No obvious dead ends or missing core operations for the stated purpose.

    Maintenance

    ActivityActive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables Claude to perform stealth browser automation with anti-detection, including navigation, clicking, typing, screenshots, and network monitoring via an MCP server.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables assistants such as Claude Code, Codex, and Gemini CLI to drive a real browser over MCP — navigating, clicking, typing, and reading live pages from plain-English instructions. Supports optional proxy routing, persistent profiles for surviving logins, and reproducible browser identities via seeds.
      16
      16
      32,439
      MIT