seleniumboot-mcp

v0.9.4
seleniumboot-mcp Checked 4 days ago Published 9 days ago

A Python MCP server for Selenium WebDriver — 43 tools by default (77 total) for browser automation, alerts, frames, shadow DOM, cookies, mobile emulation…

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

start_browser

Start a browser session. Optional — any tool will auto-start Chrome if no browser is open. Use this to choose Firefox, enable headless mode, or set a custom window size.

ParameterTypeDescription
browserstring
headlessboolean
window_sizestringe.g. 1920x1080

navigate

Navigate the browser to a URL.

ParameterTypeDescription
url *string

take_screenshot

Take a screenshot and return it as base64.

get_page_source

Return the current page HTML source.

get_page_title

Return the current page title.

get_current_url

Return the current URL.

close_browser

Close and quit the browser session.

go_back

Navigate back in browser history.

refresh

Refresh the current page.

execute_script

Execute JavaScript in the browser.

ParameterTypeDescription
script *string
argsarray

inspect_page

Discover all interactive elements on the current page — inputs, buttons, selects, checkboxes, textareas, and links — with their best CSS selectors and labels. Use this before writing locators so the AI knows exactly what's on the page.

find_element

Find an element and return its text, tag, and attributes.

ParameterTypeDescription
selector *stringLocator value
bystringStrategy
timeoutintegerSeconds

find_elements

Find all matching elements and return their texts.

ParameterTypeDescription
selector *stringLocator value
bystringStrategy
timeoutintegerSeconds

click

Click on an element.

ParameterTypeDescription
selector *stringLocator value
bystringStrategy
timeoutintegerSeconds

type_text

Clear and type text into an input field.

ParameterTypeDescription
selector *stringLocator value
text *stringText to type
bystringStrategy
clear_firstboolean
timeoutintegerSeconds

get_text

Get the visible text content of an element.

ParameterTypeDescription
selector *stringLocator value
bystringStrategy
timeoutintegerSeconds

get_attribute

Get an attribute value from an element.

ParameterTypeDescription
attribute *stringAttribute name e.g. href, value, class
selector *stringLocator value
bystringStrategy
timeoutintegerSeconds

select_option

Select an option from a <select> dropdown by visible text, value, or index.

ParameterTypeDescription
selector *stringLocator value
bystringStrategy
by_indexinteger
by_textstring
by_valuestring
timeoutintegerSeconds

hover

Hover the mouse over an element.

ParameterTypeDescription
selector *stringLocator value
bystringStrategy
timeoutintegerSeconds

is_displayed

Check if an element is visible on the page.

ParameterTypeDescription
selector *stringLocator value
bystringStrategy
timeoutintegerSeconds

wait_for_element

Wait until an element is visible on the page.

ParameterTypeDescription
selector *stringLocator value
bystringStrategy
conditionstring
timeoutintegerSeconds

scroll_to_element

Scroll the page to bring an element into view.

ParameterTypeDescription
selector *stringLocator value
bystringStrategy
timeoutintegerSeconds

clear_field

Clear the text in an input field.

ParameterTypeDescription
selector *stringLocator value
bystringStrategy
timeoutintegerSeconds

fill_form

Fill multiple form fields in a single call. Pass a map of CSS selector → value. Automatically handles text inputs, textareas, checkboxes (true/false), radio buttons, and <select> dropdowns. Optionally clicks a submit button at the end.

ParameterTypeDescription
fields *objectMap of selector → value. Checkboxes: 'true'/'false'. Selects: visible text or value.
bystring
submitstringSelector of submit button to click after filling (optional)
timeoutinteger

accept_alert

Accept (OK) a JavaScript alert, confirm, or prompt dialog.

ParameterTypeDescription
timeoutinteger

dismiss_alert

Dismiss (Cancel) a JavaScript confirm or prompt dialog.

ParameterTypeDescription
timeoutinteger

switch_to_frame

Switch focus into an iframe. Provide index (integer), name/id (string), or a CSS/XPath selector.

ParameterTypeDescription
bystring
indexintegerFrame index
namestringFrame name or id attribute
selectorstringCSS/XPath to locate the iframe element
timeoutinteger

switch_to_default_content

Switch back to the main page content from inside a frame.

send_keys

Send a key or key combination to the focused element (or a specific element if selector is given). Use key names like 'tab', 'enter', 'escape', 'up', 'down', 'f5', or combos like 'ctrl+a', 'shift+tab'.

ParameterTypeDescription
key *stringKey name or combo e.g. 'tab', 'ctrl+a', 'enter'
bystring
selectorstringElement to focus before sending (optional)
timeoutinteger

upload_file

Upload a file by sending its absolute path to an <input type='file'> element.

ParameterTypeDescription
file_path *stringAbsolute path to the file to upload
selector *stringLocator value
bystringStrategy
timeoutintegerSeconds

assert_title

Assert the page title equals or contains expected text.

ParameterTypeDescription
expected *string
exactboolean

assert_url

Assert the current URL equals or contains expected value.

ParameterTypeDescription
expected *string
exactboolean

assert_text

Assert element text equals or contains expected value.

ParameterTypeDescription
expected *string
selector *string
bystring
exactboolean
timeoutinteger

assert_element_visible

Assert an element is visible on the page.

ParameterTypeDescription
selector *string
bystring
timeoutinteger

assert_element_not_visible

Assert an element is NOT visible (hidden or absent).

ParameterTypeDescription
selector *string
bystring
timeoutinteger

assert_attribute

Assert an element attribute has the expected value.

ParameterTypeDescription
attribute *string
expected *string
selector *string
bystring
exactboolean
timeoutinteger

assert_page_contains

Assert the full page source or visible text contains a string.

ParameterTypeDescription
text *string
source_onlybooleanIf true, checks page source; otherwise checks body visible text

assert_element_count

Assert number of elements matching selector equals expected count.

ParameterTypeDescription
expected_count *integer
selector *string
bystring

generate

Generate test code or CI config from the recorded session. language: python (pytest) | java | csharp (NUnit) | gherkin (.feature + Java steps) | playwright (TS hints) | github_actions | jenkins | gitlab_ci. In a Selenium Boot project (see detect_selenium_boot) use language=java|gherkin, framework=selenium_boot.

ParameterTypeDescription
language *stringOutput target
buildstringCI targets only: build tool
class_namestringTest class name (python; java/csharp: same as test_name)
feature_namestringgherkin only: e.g. Login; inferred from URL if omitted
frameworkstringjava: testng (default) | junit5 | selenium_boot. gherkin: raw (default) | selenium_boot. Ignored otherwise.
java_versionstringCI targets only
kindstringjava only: page_object emits Page Object + test class
namespacestringcsharp only
package_namestringjava/gherkin package (page_object: base package)
page_namestringpage_object only: e.g. LoginPage; inferred from URL if omitted
runnerstringjava kind=test with framework=selenium_boot only: BaseTest (testng) or BaseJUnit5Test (junit5)
scenario_namestringgherkin only
test_namestringTest function/class name (python, java, csharp, playwright)

detect_selenium_boot

Detect whether the working directory is a Selenium Boot project. Call BEFORE generating Java; if detected=true use framework='selenium_boot'.

ParameterTypeDescription
project_dirstringOptional path to start detection from. Defaults to the server's working directory.

get_session_log

Return the raw list of recorded actions in the current session.

clear_session_log

Clear the recorded action log and start fresh.

migrate

Analyze an existing Selenium Java project for migration to Selenium Boot (read-only, via selenium-boot-migrator). Returns the JSON report: what maps cleanly and what needs manual work.

ParameterTypeDescription
project_dir *stringPath to the Selenium project to analyze.