Seleniumboot MCP
Control a real browser via MCP to record interactions and generate ready-to-run test code in multiple frameworks.
Browser control: Auto-starting Chrome/Firefox, navigate, screenshots, history, tabs/windows, scrolling, JS execution, device emulation, console/network logs, request mocking, accessibility audits, and visual regression.
Element interaction: Find/click/type, hover, double/right-click, drag-and-drop, selects, file uploads, alerts/dialogs, iframes, shadow DOM, table extraction, batch form filling, and self-healing locators.
Assertions: Verify titles, URLs, text, visibility, attributes, page content, and element counts.
Code generation: Produce Java TestNG, JUnit 5, Page Objects, Gherkin/Cucumber, pytest, C# NUnit, Playwright hints, and CI configs (GitHub Actions, Jenkins, GitLab CI) from recorded sessions.
Session & project tools: View/clear the recorded action log and detect Selenium Boot projects for framework-native Java output.
Generates Gherkin feature files and Java step definitions from recorded browser sessions for Cucumber BDD test frameworks.
Allows selecting Firefox as the browser for automation via Selenium, with options like headless mode and window size.
Generates GitHub Actions CI workflow YAML files to run generated tests on push or pull request.
Integrates with GitHub Copilot in VS Code to allow browser automation commands and test generation through the MCP server.
Generates GitLab CI pipeline (.gitlab-ci.yml) to run generated tests.
Generates Jenkins Pipeline (Jenkinsfile) to run generated tests in a CI/CD environment.
Generates JUnit 5 test classes from recorded browser sessions for Java test automation.
Generates pytest test classes from recorded browser sessions for Python test automation.
Provides tools to control web browsers via Selenium WebDriver for automated testing, including navigation, element interaction, assertions, and code generation.
seleniumboot-mcp
A Python Model Context Protocol (MCP) server for Selenium WebDriver automation.
Let Claude or GitHub Copilot control a real browser — navigate pages, interact with elements,
run assertions, and generate ready-to-run Java TestNG / JUnit 5 / Cucumber / pytest test code from recorded sessions.
43 tools by default (77 with SELENIUM_MCP_TOOLS=all). No ChromeDriver setup. Browser auto-starts on first use.
Demo
Related MCP server: Selenium MCP Server
Installation
pip install seleniumboot-mcpRequires Python 3.10+ and Chrome. No separate ChromeDriver needed — Selenium Manager handles it automatically.
Setup
VS Code — Marketplace Extension (easiest)
Install Selenium Boot MCP from the VS Code Marketplace.
The extension automatically:
Registers the MCP server with GitHub Copilot (no config file needed)
Creates a
.mcp.jsonin your project so Claude Code detects it on next openPrompts to
pip install seleniumboot-mcpif the Python package is missing
When Claude Code asks "Allow MCP server seleniumboot?" — click Allow.
JetBrains IDEs — Marketplace Plugin
Install Selenium Boot MCP from Settings → Plugins → Marketplace (search "Selenium Boot MCP"), or from the plugin page.
The plugin registers the MCP server with the JetBrains AI Assistant and prompts to
pip install seleniumboot-mcp if the Python package is missing. Use
Tools → Selenium Boot MCP to install/upgrade, register, or check status.
VS Code — Manual
Add .vscode/mcp.json to your project root (for GitHub Copilot):
{
"servers": {
"selenium": {
"type": "stdio",
"command": "seleniumboot-mcp"
}
}
}For Claude Code, add .mcp.json to your project root:
{
"mcpServers": {
"seleniumboot": {
"command": "seleniumboot-mcp",
"args": []
}
}
}Open the project in VS Code → Claude Code will prompt to approve the server → done.
Claude Desktop
Edit your Claude Desktop config:
Windows:
%APPDATA%\claude-desktop\config.jsonmacOS:
~/.config/claude-desktop/config.json
{
"mcpServers": {
"selenium": {
"command": "seleniumboot-mcp"
}
}
}Restart Claude Desktop.
How to use
Once the server is running, talk to Claude naturally — no start_browser call needed, Chrome launches automatically on first use:
Go to https://myapp.com and fill the login form with admin/password, then click LoginAssert the dashboard heading is visibleGenerate a Java TestNG test class for everything we just didGenerate a Gherkin feature file and step definitions for the login flowClaude controls the real browser, records every action, and on request generates complete test code ready to paste into your Maven or Gradle project.
Migrating an existing Selenium project
The migrate tool runs selenium-boot-migrator's
read-only analyze on a project and returns its JSON report (what maps cleanly, what needs a human).
It needs Java 17+. On first use it downloads the pinned migrator release (v0.1.2) from GitHub
into ~/.cache/seleniumboot-mcp/, verifies its SHA-256, and reuses it afterwards; this is the only
network call the tool makes. To skip the download, set SELENIUM_BOOT_MIGRATOR_JAR to a jar you
built, or put a selenium-boot-migrator launcher on PATH. It never edits your project.
Tools (77 total; 43 exposed by default)
Reducing token use
Tool definitions are sent to the model every session. Since 0.8.0 the server exposes the
core profile by default: 43 tools, ~3.9k tokens, covering the record-and-generate workflow
(browser, elements, assertions, the single generate tool for every output target, and migrate).
Cookies, storage, windows/tabs, network mocking, device emulation, screenshot-diff,
accessibility, healing, shadow DOM, tables and double/right-click/drag are left out.
Set SELENIUM_MCP_TOOLS=all to expose all 77 (~6.4k tokens).
{ "mcpServers": { "selenium": { "command": "seleniumboot-mcp", "env": { "SELENIUM_MCP_TOOLS": "all" } } } }Browser
Tool | Description |
| Optional — Chrome auto-starts on first use. Use this to pick Firefox, enable headless, or set window size |
| Go to a URL |
| Capture page as an inline image |
| Return page title |
| Return current URL |
| Return full HTML source |
| Run JavaScript |
| Browser history |
| Reload page |
| Switch between tabs by index |
| Open a new browser tab, optionally at a URL |
| Close the active tab and switch to the previous |
| List all open tabs with index, title, and URL |
| Quit the browser |
| Scroll page to the top |
| Scroll page to the bottom |
| Scroll page by x/y pixels |
| Emulate a mobile device (iPhone, iPad, Pixel, Galaxy) via CDP |
| Get browser console errors/warnings/info (Chrome) |
| Read or write a cookie |
| Remove cookies |
| Read or write localStorage |
| Read or write sessionStorage |
| Wait until XHR/fetch traffic is quiet — essential for SPAs |
| Discover all inputs, buttons, selects, links with best-fit CSS selectors |
| Captured XHR/fetch requests — method, URL, status, timing |
| Stub fetch/XHR by URL pattern with a canned response |
| Remove all active mock rules |
| Pixel diff against a saved baseline — visual regression |
| Built-in WCAG audit — alt text, labels, headings, keyboard access |
Elements
Tool | Description |
| Find element, return tag/text/state |
| Find all matching elements |
| Click with explicit wait |
| Clear + type into input |
| Get visible text |
| Get any attribute value |
| Select from |
| Mouse hover |
| Double click |
| Context menu click |
| Drag source → target |
| Check visibility |
| Check enabled state |
| Wait: visible / clickable / present / invisible |
| Scroll element into view |
| Clear input field |
| Send special keys (Tab, Enter, Escape, Ctrl+A, F5, …) |
| Upload a file via |
| Handle JS alert/confirm dialogs |
| Read the message from an alert |
| Type into a JS prompt and accept |
| Focus into an iframe by index, name, or selector |
| Return to the main page from a frame |
| Find element inside a shadow DOM |
| Extract an HTML table as a formatted text grid |
| Fill multiple fields at once — auto-detects input/select/checkbox/radio |
| View all self-healed selector mappings for the session |
| Reset the self-healing cache |
Assertions
Tool | Description |
| Page title equals/contains |
| URL equals/contains |
| Element text equals/contains |
| Element is visible |
| Element is hidden or absent |
| Element attribute has expected value |
| Page body contains a string |
| Count of matching elements equals expected |
Codegen
Tool | Description |
| Test code or CI config from the session. |
| View recorded actions |
| Reset the session recording |
Codegen Examples
Java TestNG
Go to https://myapp.com/login, enter admin/password, click Login
→ Generate a Java TestNG testpublic class LoginTest {
@BeforeMethod public void setUp() { driver = new ChromeDriver(); ... }
@AfterMethod public void tearDown() { driver.quit(); }
@Test
public void recordedFlowTest() {
driver.get("https://myapp.com/login");
WebElement f = wait.until(visibilityOf(By.cssSelector("#username")));
f.clear(); f.sendKeys("admin");
wait.until(elementToBeClickable(By.cssSelector("button[type='submit']"))).click();
}
}Page Object Model
Generate a Java Page Object for the login page// LoginPage.java
public class LoginPage {
private final By usernameField = By.cssSelector("#username");
private final By submitButton = By.cssSelector("button[type='submit']");
public LoginPage enterUsernameField(String text) { ... return this; }
public LoginPage clickSubmitButton() { ... return this; }
}
// LoginTest.java
public class LoginTest {
@Test public void recordedFlowTest() {
driver.get("https://myapp.com/login");
page.enterUsernameField("admin").clickSubmitButton();
}
}Cucumber / Gherkin
Generate a Gherkin feature file and step definitions for the login flowFeature: Login
Scenario: User logs in with valid credentials
Given I navigate to "https://myapp.com/login"
And I enter "admin" in the username field
And I enter "password" in the password field
And I click the submit button// LoginSteps.java
public class LoginSteps {
@Given("I navigate to {string}")
public void iNavigateTo(String url) { driver.get(url); }
@And("I enter {string} in the username field")
public void iEnterInUsernameField(String text) { ... el.sendKeys(text); }
@And("I click the submit button")
public void iClickTheSubmitButton() { wait.until(...).click(); }
}Selenium Boot projects
The Java examples above are raw Selenium: you own the ChromeDriver/WebDriverWait lifecycle
and get plain TestNG/JUnit 5 asserts. If the project you're working in has
Selenium Boot — detected automatically from selenium-boot.yml or
the io.github.seleniumboot dependency, no flag needed — the same tools emit framework-native
code instead: classes extend BaseTest/BaseJUnit5Test/BaseCucumberSteps, there's no driver
lifecycle boilerplate to write, locators follow an accessibility-first ladder
(getByRole/getByLabel/getByTestId), and assertions are web-first
(assertThat(locator).isVisible()/.hasText()) instead of raw TestNG/JUnit calls.
If no Selenium Boot project is detected, generated Java now includes a short comment noting it as an option, with a link — nothing else changes, and Python/C# output is unaffected either way.
Self-Healing Locators
When a selector fails to find an element, seleniumboot-mcp automatically tries alternative strategies before giving up:
Primary selector | Alternatives tried |
|
|
|
|
|
|
|
|
| tries A first, then B |
Successful fallbacks are cached so the healed selector is reused automatically. Use get_healed_locators to inspect the cache and update your test code, and clear_healed_locators to start fresh.
Links
VS Code Marketplace: marketplace.visualstudio.com
Roadmap
Java TestNG / JUnit 5 / Python pytest code generation
Screenshot returned as
ImageContent(renders inline in Claude)Full session recording — hover, double_click, right_click, scroll, select_option
Codegen for hover, drag-and-drop, select, scroll in Java and Python templates
Auto-start browser on first use (no explicit
start_browserneeded)Page Object Model generation (
generatewithlanguage=java, kind=page_object)Cucumber / Gherkin step generation (
generatewithlanguage=gherkin)Self-healing locators — automatic fallback when a selector breaks
Alert/dialog handling, iframe switching, shadow DOM, table extraction
Cookie, localStorage, sessionStorage management
Mobile device emulation via Chrome DevTools Protocol
Special key sending (Tab, Enter, F-keys, Ctrl+A, …)
File upload via
<input type="file">Browser console log capture
Multi-tab management (open, close, list)
Page scroll (top, bottom, by pixels)
C# NUnit + Selenium codegen
GitHub Actions CI workflow generator (Maven / Gradle / pytest)
Playwright TypeScript migration hints
CI/CD config for Jenkins / GitLab CI
License
MIT
Available Tools
43 toolsaccept_alertB
Accept (OK) a JavaScript alert, confirm, or prompt dialog.
Inputs: timeout.
assert_attributeC
Assert an element attribute has the expected value.
Inputs: expected (required), selector (required), attribute (required), by, +2 more.
assert_element_countB
Assert number of elements matching selector equals expected count.
Inputs: selector (required), expected_count (required), by.
assert_element_not_visibleB
Assert an element is NOT visible (hidden or absent).
Inputs: selector (required), by, timeout.
assert_element_visibleC
Assert an element is visible on the page.
Inputs: selector (required), by, timeout.
assert_page_containsC
Assert the full page source or visible text contains a string.
Inputs: text (required), source_only.
assert_textB
Assert element text equals or contains expected value.
Inputs: expected (required), selector (required), by, exact, +1 more.
assert_titleA
Assert the page title equals or contains expected text.
Inputs: expected (required), exact.
assert_urlB
Assert the current URL equals or contains expected value.
Inputs: expected (required), exact.
clear_fieldC
Clear the text in an input field.
Inputs: selector (required), by, timeout.
clear_session_logA
Clear the recorded action log and start fresh.
Inputs: no named parameters.
clickC
Click on an element.
Inputs: selector (required), by, timeout.
close_browserA
Close and quit the browser session.
Inputs: no named parameters.
detect_selenium_bootA
Detect whether the working directory is a Selenium Boot project. Call BEFORE generating Java; if detected=true use framework='selenium_boot'.
Inputs: project_dir.
dismiss_alertC
Dismiss (Cancel) a JavaScript confirm or prompt dialog.
Inputs: timeout.
execute_scriptC
Execute JavaScript in the browser.
Inputs: script (required), args.
fill_formA
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 dropdowns. Optionally clicks a submit button at the end.
Inputs: fields (required), by, submit, timeout.
find_elementB
Find an element and return its text, tag, and attributes.
Inputs: selector (required), by, timeout.
find_elementsB
Find all matching elements and return their texts.
Inputs: selector (required), by, timeout.
generateA
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.
Inputs: language (required), kind, build, runner, +9 more.
get_attributeC
Get an attribute value from an element.
Inputs: selector (required), attribute (required), by, timeout.
get_current_urlA
Return the current URL.
Inputs: no named parameters.
get_page_sourceA
Return the current page HTML source.
Inputs: no named parameters.
get_page_titleB
Return the current page title.
Inputs: no named parameters.
get_session_logA
Return the raw list of recorded actions in the current session.
Inputs: no named parameters.
get_textC
Get the visible text content of an element.
Inputs: selector (required), by, timeout.
go_backA
Navigate back in browser history.
Inputs: no named parameters.
hoverC
Hover the mouse over an element.
Inputs: selector (required), by, timeout.
inspect_pageA
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.
Inputs: no named parameters.
is_displayedC
Check if an element is visible on the page.
Inputs: selector (required), by, timeout.
migrateA
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.
Inputs: project_dir (required).
refreshB
Refresh the current page.
Inputs: no named parameters.
scroll_to_elementC
Scroll the page to bring an element into view.
Inputs: selector (required), by, timeout.
select_optionB
Select an option from a dropdown by visible text, value, or index.
Inputs: selector (required), by, by_text, timeout, +2 more.
send_keysA
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'.
Inputs: key (required), by, timeout, selector.
start_browserA
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.
Inputs: browser, headless, window_size.
switch_to_default_contentA
Switch back to the main page content from inside a frame.
Inputs: no named parameters.
switch_to_frameA
Switch focus into an iframe. Provide index (integer), name/id (string), or a CSS/XPath selector.
Inputs: by, name, index, timeout, +1 more.
take_screenshotA
Take a screenshot and return it as base64.
Inputs: no named parameters.
type_textC
Clear and type text into an input field.
Inputs: text (required), selector (required), by, timeout, +1 more.
upload_fileA
Upload a file by sending its absolute path to an element.
Inputs: selector (required), file_path (required), by, timeout.
wait_for_elementC
Wait until an element is visible on the page.
Inputs: selector (required), by, timeout, condition.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 43 tools
Most tools have clearly distinct purposes: navigation, element interaction, assertions, alerts, frames, and code generation are well separated. There is minor overlap among visibility-related tools like is_displayed, wait_for_element, assert_element_visible, and assert_element_not_visible, but descriptions make the intended use distinguishable.
The set is consistently snake_case and mostly follows verb_noun conventions such as get_page_title, wait_for_element, and assert_element_visible. Minor deviations exist with single-verb names like click, hover, refresh, generate, and migrate, but the overall pattern remains readable and predictable.
At 43 tools, the surface is very large for a browser automation server and exceeds the threshold where tool selection becomes costly. Many operations are granular and useful, but the count is high enough that the set feels heavier than necessary for its apparent scope.
The server covers core browser automation, assertions, alerts, frames, file upload, JavaScript execution, form filling, session logging, and test/code generation. Minor gaps remain around window/tab switching, cookie management, drag-and-drop, and richer wait conditions, but most workflows are fully supported.
Maintenance
Related MCP Connectors
MCP server for Mint — AI-powered QA that runs your app in a real browser on every PR.
Official Browserless MCP server: browser automation, scraping, screenshots and PDFs for AI agents.
Web scraping MCP server — scrape, extract structured data, screenshot any site with anti-bot bypass.
MCP server to assist with JxBrowser development.
Related MCP Servers
- AlicenseAqualityDmaintenanceExposes Selenium WebDriver as an MCP server, enabling AI agents and LLMs to control real browsers for automation tasks like navigation, element interaction, and screenshot capture.223MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server for web automation using Selenium WebDriver, enabling AI assistants to navigate, interact with elements, take screenshots, and manage browser storage.10MIT
- AlicenseBqualityDmaintenanceA production-ready MCP server that exposes Selenium 4 browser automation as MCP tools.27MIT
- FlicenseNot gradedqualityDmaintenanceAI-driven smart browser automation MCP server supporting multiple AI providers. Enables natural language element selection and self-healing for robust web automation.-