Skip to main content
Glama

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.

PyPI Python License: MIT VS Code Marketplace JetBrains Plugin JetBrains Downloads


Demo

▶ Watch the demo on YouTube


Related MCP server: Selenium MCP Server

Installation

pip install seleniumboot-mcp

Requires 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.json in your project so Claude Code detects it on next open

  • Prompts to pip install seleniumboot-mcp if 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.json

  • macOS: ~/.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 Login
Assert the dashboard heading is visible
Generate a Java TestNG test class for everything we just did
Generate a Gherkin feature file and step definitions for the login flow

Claude 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

start_browser

Optional — Chrome auto-starts on first use. Use this to pick Firefox, enable headless, or set window size

navigate

Go to a URL

take_screenshot

Capture page as an inline image

get_page_title

Return page title

get_current_url

Return current URL

get_page_source

Return full HTML source

execute_script

Run JavaScript

go_back / go_forward

Browser history

refresh

Reload page

switch_to_window

Switch between tabs by index

open_new_tab

Open a new browser tab, optionally at a URL

close_current_tab

Close the active tab and switch to the previous

list_windows

List all open tabs with index, title, and URL

close_browser

Quit the browser

scroll_to_top

Scroll page to the top

scroll_to_bottom

Scroll page to the bottom

scroll_by

Scroll page by x/y pixels

emulate_device

Emulate a mobile device (iPhone, iPad, Pixel, Galaxy) via CDP

get_console_logs

Get browser console errors/warnings/info (Chrome)

get_cookies / set_cookie

Read or write a cookie

delete_cookie / delete_all_cookies

Remove cookies

get_local_storage / set_local_storage

Read or write localStorage

get_session_storage / set_session_storage

Read or write sessionStorage

wait_for_network_idle

Wait until XHR/fetch traffic is quiet — essential for SPAs

inspect_page

Discover all inputs, buttons, selects, links with best-fit CSS selectors

get_network_logs

Captured XHR/fetch requests — method, URL, status, timing

mock_response

Stub fetch/XHR by URL pattern with a canned response

clear_mock_responses

Remove all active mock rules

compare_screenshot

Pixel diff against a saved baseline — visual regression

check_accessibility

Built-in WCAG audit — alt text, labels, headings, keyboard access

Elements

Tool

Description

find_element

Find element, return tag/text/state

find_elements

Find all matching elements

click

Click with explicit wait

type_text

Clear + type into input

get_text

Get visible text

get_attribute

Get any attribute value

select_option

Select from <select> by text, value, or index

hover

Mouse hover

double_click

Double click

right_click

Context menu click

drag_and_drop

Drag source → target

is_displayed

Check visibility

is_enabled

Check enabled state

wait_for_element

Wait: visible / clickable / present / invisible

scroll_to_element

Scroll element into view

clear_field

Clear input field

send_keys

Send special keys (Tab, Enter, Escape, Ctrl+A, F5, …)

upload_file

Upload a file via <input type="file">

accept_alert / dismiss_alert

Handle JS alert/confirm dialogs

get_alert_text

Read the message from an alert

type_in_alert

Type into a JS prompt and accept

switch_to_frame

Focus into an iframe by index, name, or selector

switch_to_default_content

Return to the main page from a frame

find_shadow_element

Find element inside a shadow DOM

get_table_data

Extract an HTML table as a formatted text grid

fill_form

Fill multiple fields at once — auto-detects input/select/checkbox/radio

get_healed_locators

View all self-healed selector mappings for the session

clear_healed_locators

Reset the self-healing cache

Assertions

Tool

Description

assert_title

Page title equals/contains

assert_url

URL equals/contains

assert_text

Element text equals/contains

assert_element_visible

Element is visible

assert_element_not_visible

Element is hidden or absent

assert_attribute

Element attribute has expected value

assert_page_contains

Page body contains a string

assert_element_count

Count of matching elements equals expected

Codegen

Tool

Description

generate

Test code or CI config from the session. language: python, java, csharp, gherkin, playwright, github_actions, jenkins, gitlab_ci. Java: framework = testng / junit5 / selenium_boot, kind = test / page_object.

get_session_log

View recorded actions

clear_session_log

Reset the session recording


Codegen Examples

Java TestNG

Go to https://myapp.com/login, enter admin/password, click Login
→ Generate a Java TestNG test
public 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 flow
Feature: 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

#my-id (CSS)

by=id "my-id", [id='my-id']

.my-class (CSS)

by=class "my-class", [class*='my-class']

input[type='email'] (CSS)

//input[@type='email'] (XPath)

//button[@id='ok'] (XPath)

button[id='ok'] (CSS), by=id "ok"

"A, B" comma list

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.



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_browser needed)

  • Page Object Model generation (generate with language=java, kind=page_object)

  • Cucumber / Gherkin step generation (generate with language=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 tools
accept_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

    B3.1/5.0

    Scored across 43 tools

    Disambiguation4/5

    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.

    Naming Consistency4/5

    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.

    Tool Count2/5

    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.

    Completeness4/5

    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

    ActivityActive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Exposes 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.
      22
      3
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      An MCP server for web automation using Selenium WebDriver, enabling AI assistants to navigate, interact with elements, take screenshots, and manage browser storage.
      10
      MIT