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. This must be called before 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 communicates directly with the browser through the Chrome DevTools Protocol rather than WebDriver. This provides SeleniumBase's CDP-based browser automation capabilities without using WebDriver as the browser-control layer. Args: url: Optional URL to open immediately after the browser launches. If omitted, the browser starts without navigating to a requested page. Returns: A confirmation message when the browser starts successfully, including the effective headless setting, or a descriptive error when browser startup fails. 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. 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 a browser session is active. - 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 initial HTML document to be loaded before returning. The visited page becomes part of the browser's navigation history. Args: url: Destination URL. May be a complete URL such as "https://example.com" or a hostname such as "example.com". Returns: A confirmation 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 | Navigate through the current browser history, reload the current page, or list the current browser history. Use this tool for navigation relative to the current browser history or for displaying the current browser history. Use the 'navigate' tool when going to an arbitrary URL. Args: action: - "back": Navigate to the previous history entry. Has no useful effect when there is no previous history entry. - "forward": Navigate to the next history entry. Has no useful effect when there is no forward history entry. - "reload": Reload the current page while ignoring the browser cache so page resources are fetched again. - "list": Return a tuple containing the current location in history (0-indexed) and the full navigation-history list. Returns: A confirmation message describing the operation performed for navigation actions, or, for "list", a tuple containing the current history location (0-indexed) and the full navigation-history list. Notes: These operations can trigger page loads, redirects, and other navigation events. Use the 'get_page_info' tool afterward when you need to verify the resulting URL or title. Tool selection: - Arbitrary destination URL -> use navigate. - Previous/next browser history entry -> use this tool. - Refresh current page -> use this tool with action="reload". - List current history -> use this tool with action="list". |
| 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 resolves element handles immediately into ordinary JSON-like dictionaries. It does not return live SeleniumBase element objects. Args: selector: CSS selector, or a SeleniumBase selector that can match visible text. Examples include "button", ".login-link", or 'a:contains("Sign in")'. timeout: Maximum number of seconds to wait for matching elements to be found. (Defaults to 0.5 seconds.) include_html: If True, include each matching element's outer HTML. If False, return only tag name and text. (Defaults to False.) 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 are no matching elements, returns an empty dictionary. 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. Note: 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 current page. Use this tool when you need actual page content or URL information rather than page metadata. Args: selector: Optional CSS selector or SeleniumBase text-matching selector identifying the element whose content should be read. For output_format="text" or "html", the selector scopes the returned content to that element. For output_format="urls", the selector scopes URL discovery to URLs within that element. When omitted, the operation applies to the whole page. Returns: For output_format="text", a string containing visible text. For output_format="html", a string containing HTML. For output_format="urls", a list of URL strings. This is useful for crawling, link discovery, resource inspection, and finding candidate URLs before navigating to them. 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 a matching element. Use this tool when you need the value of one or more HTML attributes such as href, src, value, class, id, name, type, aria-label, or data-*. Args: selector: CSS selector or SeleniumBase text-matching selector for the target element. attribute: Specific HTML attribute to retrieve. When omitted, return all HTML attributes of the element as a dictionary. Returns: The requested attribute value, or a dictionary containing all HTML attributes of the element when attribute is omitted. 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 and does not modify the element. |
| 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.
Defaults to "visible".
Returns: True or False indicating whether the requested condition is currently satisfied. Missing elements return False rather than raising an exception. Tool selection: - Immediate boolean observation -> use check_condition. - Wait for an element or text condition to become true/false -> use wait_for. - Verify an expected condition and fail when it is not met -> use assert_condition. - Need the number or details of matching elements -> use find_elements. - Need to read the actual 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 one or more elements matching a selector. This is the primary element-clicking tool. The selector may be a CSS selector or SeleniumBase text-matching selector such as 'a:contains("Sign in")'. Args: selector: Target CSS selector or text-matching selector. nth: Click only the Nth matching element, using 1-based indexing. Takes priority over all_matches. all_matches: Click every currently visible matching element, in order. Ignored when nth is provided. only_if_visible: Attempt the click only when the target is already visible. Does not wait for the element to become visible. parent_selector: Restrict the nested lookup to a parent element. Useful for elements inside iframes or nested containers when supported by SeleniumBase. timeout: Seconds to wait for a basic click when no specialized mode is selected. Defaults to 7 seconds. scroll: Scroll the target into view before clicking. Tool selection: - Click one matching element -> basic click. - Click a specific matching occurrence -> set nth. - Click every visible match -> set all_matches=True. - Click only when already visible -> set only_if_visible=True. - Click an element nested inside another element -> set parent_selector. |
| hover_with_actionA | Hover over an element, optionally click another element, or drag-&-drop. Use this tool for hover interactions, hover-triggered menus, and drag-and-drop operations. Args: selector1: The primary element selector. Returns: A confirmation 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 | Fill, append, fast-type, directly set, or clear a form control. Use this tool for input elements, textareas, and contenteditable elements. Args: selector: CSS selector or SeleniumBase selector identifying the input, textarea, or contenteditable element. text: Text to enter or set. Not used when mode="clear_only". mode: - "fill_input": Clear the field and then type text normally. - "append": Keep the existing value and add text as keystrokes. - "fast_type": Clear the field and type text without pauses. - "set_value": Set the value directly and immediately. This can be useful for fast form filling but does not simulate normal key events. It can also be used to handle input sliders, e.g. 'input[type="range"]'. - "clear_only": Empty the text field; text is ignored. timeout: Maximum seconds to wait for the target element. Tool selection: - Normal text entry to replace existing text -> mode="fill_input". - Add text without clearing the field first -> mode="append". - Fast typing to replace existing text -> mode="fast_type". - Directly set a value (e.g. input slider) -> mode="set_value". - Empty a field of all text -> mode="clear_only". |
| select_optionA | Select an option from an HTML dropdown. 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 or other element-interaction tools instead. |
| focus_onA | Scroll to, focus, or highlight an element. Use this tool when an element needs to be brought into view, focused for keyboard interaction, or highlighted for debugging/demonstration. This tool does NOT click, type into, select from, hover over, or otherwise activate the element. Args: selector: CSS selector or SeleniumBase selector identifying the target. Tool selection: - Bring an element into view -> use focus_on with the default action. - Focus an element -> use focus_on(action="focus"). - Highlight element for debugging -> use focus_on(action="highlight"). - Click -> use click. - Type text into a text field -> use type_text. - Hover -> use hover_with_action. |
| wait_forA | Wait until an element or text reaches a requested state. When Use this tool when the page is dynamic and an automation step must wait for a condition before continuing. Unlike check_condition, this tool intentionally waits. Unlike assert_condition, its purpose is synchronization rather than validating a test expectation. 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.
(This is handled differently when text is provided.)
selector: CSS selector or SeleniumBase selector for the element.
Required unless text is supplied.
text: If supplied and is not None, a Returns: A confirmation when the requested condition is reached. Tool selection: - Check current state immediately -> use check_condition. - Wait for a state/content transition -> use wait_for. - Verify an expected value/condition -> use assert_condition. |
| assert_conditionA | Verify an expected browser condition and fail when it is not met. Use this tool for explicit verification. Unlike check_condition, which simply reports True or False on the current state, assert_condition treats a failed expectation as an error. (Note that URL/title checks do not wait for the 'timeout'.) Args: check: - "element_present": Verify selector identifies a present element. - "element_visible": Verify selector identifies a visible element. - "text_visible": Verify expected text is visible within selector, or within the whole HTML document when selector is omitted. - "title": Verify the exact page title. - "url": Verify the exact current URL. - "url_contains": Verify that the current URL contains expected. selector: Element selector for element_present, element_visible, and text_visible checks. expected: Expected text/title/URL value for text_visible, title, url, and url_contains. exact: For check="text_visible", require exact text rather than a substring. timeout: Maximum seconds to wait for element/text checks. (Ignored for title and URL checks.) Returns: A confirmation when the expectation passes. Raises: An assertion-related SeleniumBase exception when the expectation fails; the MCP error wrapper converts it to a descriptive result. Tool selection: - Just inspect current state -> use check_condition. - Wait for a condition to become true -> use wait_for. - Verify that an expected condition is true -> use 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. filename: Filesystem path used by save/load. Defaults to "cookies.txt". 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. 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. 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. |
| 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. 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. Use focus_on(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 and state. Args: action: - "get_rect": Return the current window coordinates 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. Use this tool for browser-window geometry/state. For switching between browser tabs, use manage_tabs instead. |
| manage_tabsA | List, open, switch between, or close browser tabs. Use this tool for tab management. Browser navigation within the current tab belongs to navigate and manage_history. Args: action: - "list": Return each open tab's index, URL, and title. Call this before switch when you need to determine a tab_index. - "open": Open a new tab, optionally navigating it to url. - "switch": Switch to the tab identified by tab_index from list. - "switch_newest": Switch to the newest tab. - "close_active": Close the currently active tab. url: URL for action="open". tab_index: Index returned by action="list" for action="switch". switch_to: For action="open", switch to the newly created tab when True. Notes: Clicking a link or performing another browser action may open a new tab. Use action="list" to inspect available tabs before switching by index. Tab indexes should be treated as current-session values and may change after tabs are opened or closed. |
| solve_captchaA | Attempt a SeleniumBase CDP-based CAPTCHA interaction. This tool attempts to interact with CAPTCHA controls such as Cloudflare Turnstile, reCAPTCHA, or FriendlyCaptcha using browser/CDP interaction. The tool does not guarantee that a 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 page with get_content when you need to determine whether CAPTCHA-related controls are present. 2. Call solve_captcha to attempt the 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, not a guarantee that the CAPTCHA challenge was solved. |
| save_outputA | Save the current browser page as a screenshot, HTML file, or PDF. Use this tool when an automation workflow needs a persistent artifact from the current page, such as a screenshot for debugging, page source for inspection, or a PDF representation. Args: format: - "screenshot": Save a PNG screenshot. - "html": Save the current page source as HTML. - "pdf": Save the current page as a PDF. filename: Output filename. Defaults to screenshot.png, page_source.html, or page.pdf depending on format. folder: Optional destination folder. Returns: A confirmation containing the output format and filename. Security: filename and folder can affect filesystem paths available to the MCP server. Existing files may be overwritten. Use trusted, authorized paths only. |
| 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_with_action, focus_on, 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. |
| wait_secondsA | Block the MCP server for a fixed number of seconds. This is a low-level timing tool. It performs no browser action while waiting and should not be used when waiting for a page condition. Prefer wait_for when waiting for an element or text to appear/disappear, because wait_for can return as soon as the requested condition is met. Args: seconds: Number of seconds to block. May be an integer or float. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/seleniumbase/seleniumbase-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server