seleniumboot-mcp
v0.9.4A 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.
| Parameter | Type | Description |
|---|---|---|
browser | string | |
headless | boolean | |
window_size | string | e.g. 1920x1080 |
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.
| Parameter | Type | Description |
|---|---|---|
script * | string | |
args | array |
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.
| Parameter | Type | Description |
|---|---|---|
selector * | string | Locator value |
by | string | Strategy |
timeout | integer | Seconds |
find_elements
Find all matching elements and return their texts.
| Parameter | Type | Description |
|---|---|---|
selector * | string | Locator value |
by | string | Strategy |
timeout | integer | Seconds |
click
Click on an element.
| Parameter | Type | Description |
|---|---|---|
selector * | string | Locator value |
by | string | Strategy |
timeout | integer | Seconds |
type_text
Clear and type text into an input field.
| Parameter | Type | Description |
|---|---|---|
selector * | string | Locator value |
text * | string | Text to type |
by | string | Strategy |
clear_first | boolean | |
timeout | integer | Seconds |
get_text
Get the visible text content of an element.
| Parameter | Type | Description |
|---|---|---|
selector * | string | Locator value |
by | string | Strategy |
timeout | integer | Seconds |
get_attribute
Get an attribute value from an element.
| Parameter | Type | Description |
|---|---|---|
attribute * | string | Attribute name e.g. href, value, class |
selector * | string | Locator value |
by | string | Strategy |
timeout | integer | Seconds |
select_option
Select an option from a <select> dropdown by visible text, value, or index.
| Parameter | Type | Description |
|---|---|---|
selector * | string | Locator value |
by | string | Strategy |
by_index | integer | |
by_text | string | |
by_value | string | |
timeout | integer | Seconds |
hover
Hover the mouse over an element.
| Parameter | Type | Description |
|---|---|---|
selector * | string | Locator value |
by | string | Strategy |
timeout | integer | Seconds |
is_displayed
Check if an element is visible on the page.
| Parameter | Type | Description |
|---|---|---|
selector * | string | Locator value |
by | string | Strategy |
timeout | integer | Seconds |
wait_for_element
Wait until an element is visible on the page.
| Parameter | Type | Description |
|---|---|---|
selector * | string | Locator value |
by | string | Strategy |
condition | string | |
timeout | integer | Seconds |
scroll_to_element
Scroll the page to bring an element into view.
| Parameter | Type | Description |
|---|---|---|
selector * | string | Locator value |
by | string | Strategy |
timeout | integer | Seconds |
clear_field
Clear the text in an input field.
| Parameter | Type | Description |
|---|---|---|
selector * | string | Locator value |
by | string | Strategy |
timeout | integer | Seconds |
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.
| Parameter | Type | Description |
|---|---|---|
fields * | object | Map of selector → value. Checkboxes: 'true'/'false'. Selects: visible text or value. |
by | string | |
submit | string | Selector of submit button to click after filling (optional) |
timeout | integer |
accept_alert
Accept (OK) a JavaScript alert, confirm, or prompt dialog.
| Parameter | Type | Description |
|---|---|---|
timeout | integer |
dismiss_alert
Dismiss (Cancel) a JavaScript confirm or prompt dialog.
| Parameter | Type | Description |
|---|---|---|
timeout | integer |
switch_to_frame
Switch focus into an iframe. Provide index (integer), name/id (string), or a CSS/XPath selector.
| Parameter | Type | Description |
|---|---|---|
by | string | |
index | integer | Frame index |
name | string | Frame name or id attribute |
selector | string | CSS/XPath to locate the iframe element |
timeout | integer |
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'.
| Parameter | Type | Description |
|---|---|---|
key * | string | Key name or combo e.g. 'tab', 'ctrl+a', 'enter' |
by | string | |
selector | string | Element to focus before sending (optional) |
timeout | integer |
upload_file
Upload a file by sending its absolute path to an <input type='file'> element.
| Parameter | Type | Description |
|---|---|---|
file_path * | string | Absolute path to the file to upload |
selector * | string | Locator value |
by | string | Strategy |
timeout | integer | Seconds |
assert_title
Assert the page title equals or contains expected text.
| Parameter | Type | Description |
|---|---|---|
expected * | string | |
exact | boolean |
assert_url
Assert the current URL equals or contains expected value.
| Parameter | Type | Description |
|---|---|---|
expected * | string | |
exact | boolean |
assert_text
Assert element text equals or contains expected value.
| Parameter | Type | Description |
|---|---|---|
expected * | string | |
selector * | string | |
by | string | |
exact | boolean | |
timeout | integer |
assert_element_visible
Assert an element is visible on the page.
| Parameter | Type | Description |
|---|---|---|
selector * | string | |
by | string | |
timeout | integer |
assert_element_not_visible
Assert an element is NOT visible (hidden or absent).
| Parameter | Type | Description |
|---|---|---|
selector * | string | |
by | string | |
timeout | integer |
assert_attribute
Assert an element attribute has the expected value.
| Parameter | Type | Description |
|---|---|---|
attribute * | string | |
expected * | string | |
selector * | string | |
by | string | |
exact | boolean | |
timeout | integer |
assert_page_contains
Assert the full page source or visible text contains a string.
| Parameter | Type | Description |
|---|---|---|
text * | string | |
source_only | boolean | If true, checks page source; otherwise checks body visible text |
assert_element_count
Assert number of elements matching selector equals expected count.
| Parameter | Type | Description |
|---|---|---|
expected_count * | integer | |
selector * | string | |
by | string |
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.
| Parameter | Type | Description |
|---|---|---|
language * | string | Output target |
build | string | CI targets only: build tool |
class_name | string | Test class name (python; java/csharp: same as test_name) |
feature_name | string | gherkin only: e.g. Login; inferred from URL if omitted |
framework | string | java: testng (default) | junit5 | selenium_boot. gherkin: raw (default) | selenium_boot. Ignored otherwise. |
java_version | string | CI targets only |
kind | string | java only: page_object emits Page Object + test class |
namespace | string | csharp only |
package_name | string | java/gherkin package (page_object: base package) |
page_name | string | page_object only: e.g. LoginPage; inferred from URL if omitted |
runner | string | java kind=test with framework=selenium_boot only: BaseTest (testng) or BaseJUnit5Test (junit5) |
scenario_name | string | gherkin only |
test_name | string | Test 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'.
| Parameter | Type | Description |
|---|---|---|
project_dir | string | Optional 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.
| Parameter | Type | Description |
|---|---|---|
project_dir * | string | Path to the Selenium project to analyze. |