Skip to main content
Glama

Add to Cursor Add to VS Code Add to Claude Add to ChatGPT Add to Codex Add to Gemini

Selenium MCP Server

npm version

npm downloads

GitHub issues

LightNow capabilities

This is a server implementation that bridges the gap between MCP clients (AI assistants) and Selenium WebDriver. It exposes Selenium WebDriver's functionalities as MCP tools, allowing AI models to utilize them for tasks like:

  • Browser management (launching, navigating, closing browsers)

  • Element interaction (clicking, typing, finding elements)

  • Web scraping and automated testing

  • Advanced operations like screenshots, cookie management, and JavaScript execution

In essence, the selenium webdriver mcp setup allows AI assistants to leverage the power of Selenium Webdriver for web automation, by communicating with a dedicated Selenium MCP server via the Model Context Protocol. This facilitates tasks such as automated web interactions, testing, and data extraction, all controlled by AI.

🚀 Overview

A Model Context Protocol (MCP) server for Selenium that provides comprehensive Selenium WebDriver automation tools for AI assistants and applications. This server enables automated web browser interactions, testing, and scraping through a standardized interface.

Built with TypeScript and modern ES modules, it offers type-safe browser automation capabilities through the Model Context Protocol.

Related MCP server: mcp-server-webdriver

✨ Key Features

  • Multi-Browser Support: Chrome, Firefox, Safari, and Edge browser automation

  • Comprehensive Element Interaction: Click, type, hover, drag & drop, file uploads

  • Advanced Navigation: Forward, backward, refresh, window management

  • Wait Strategies: Intelligent waiting for elements and page states

  • Type Safety: Full TypeScript implementation with Zod validation

🤝 Integration

MCP Client Integration

Configure your MCP client to connect to the Selenium server:

Standard Configuration (applicable to Windsurf, Warp, Gemini CLI etc)

{
  "servers": {
    "selenium-mcp": {
      "command": "npx",
      "args": ["-y", "selenium-webdriver-mcp@latest"]
    }
  }
}

Installation in VS Code

Update your mcp.json in VS Code with below configuration

NOTE: If you're new to MCP servers, follow this link Use MCP servers in VS Code

Example 'stdio' type connection

{
  "servers": {
    "selenium-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "selenium-webdriver-mcp@latest"
      ],
      "type": "stdio"
    }
  },
  "inputs": []
}

Example 'http' type connection

{
  "servers": {
    "Selenium": {
      "url": "https://smithery.ai/server/@pshivapr/selenium-mcp",
      "type": "http"
    }
  },
  "inputs": []
}

After installation, the Selenium MCP server will be available for use with your GitHub Copilot agent in VS Code.

To install the Selenium MCP server using the VS Code CLI

# For VS Code
code --add-mcp '{\"name\":\"selenium-mcp\",\"command\": \"npx\",\"args\": [\"selenium-webdriver-mcp@latest\"]}'

# For VS Code Insiders
vscode-insiders --add-mcp '{\"name\":\"selenium-mcp\",\"command\": \"npx\",\"args\": [\"selenium-webdriver-mcp@latest\"]}'

To install the package using either npm, or Smithery

Using npm:

npm install -g selenium-webdriver-mcp@latest

Using Smithery

To install Selenium MCP for Claude Desktop automatically via Smithery

npx @smithery/cli install @pshivapr/selenium-mcp --client claude

Claude Desktop Integration

Add to your Claude Desktop configuration:

{
  "mcpServers": {
    "selenium-mcp": {
      "command": "npx",
      "args": ["-y", "selenium-webdriver-mcp@latest"]
    }
  }
}

Screenshot

Selenium + Claude

Prompts

An example prompt to start AI Agent interaction:

Using selenium mcp tools, navigate to <https://parabank.parasoft.com/> click the 'Register' link and signup using dynamic test data and click register. Then generate selenium tests in <YOUR_FAVOURITE_PROGRAMMING_LANGUAGE> using pom, create tests using cucumber features, steps and execute the tests.

Note: For more prompts, look at examples directory of the project

🛠️ MCP Available Tools

Browser Management Tools

Tool

Description

Parameters

browser_open

Open a new browser session

browser, options

browser_navigate

Navigate to a URL

url

browser_navigate_back

Navigate back in history

None

browser_navigate_forward

Navigate forward in history

None

browser_title

Get the current page title

None

browser_refresh

Refresh the current page

None

browser_get_url

Get the current page URL

None

browser_get_page_source

Get the current page HTML source

None

browser_maximize

Maximize the browser window

None

browser_resize

Resize browser window

width, height

browser_close

Close current browser session

None

Tool

Description

Parameters

browser_get_cookies

Get all cookies from the current browser session

None

browser_get_cookie_by_name

Get a specific cookie by name

cookie (cookie name)

browser_add_cookie_by_name

Add a new cookie to the browser

cookie (cookie name), value

browser_set_cookie_object

Set a cookie object in the browser

cookie (cookie object as string)

browser_delete_cookie

Delete a specific cookie by name

value (cookie name to delete)

browser_delete_cookies

Delete all cookies from the current browser session

None

Window Management Tools

Tool

Description

Parameters

browser_switch_to_window

Switch to a different browser window by handle

windowHandle

browser_switch_to_original_window

Switch back to the original browser window

None

browser_switch_to_window_by_title

Switch to a window by its page title

title

browser_switch_window_by_index

Switch to a window by its index position

index

browser_switch_to_window_by_url

Switch to a window by its URL

url

Element Interaction Tools

Tool

Description

Parameters

browser_find_element

Find an element on the page

by, value, timeout

browser_find_elements

Find multiple elements on the page

by, value, timeout

browser_click

Click on an element

by, value, timeout

browser_type

Type text into an element

by, value, text, timeout

browser_get_element_text

Get text content of element

by, value, timeout

browser_file_upload

Upload file via input element

by, value, filePath, timeout

browser_clear

Clear text from an element

by, value, timeout

browser_get_attribute

Get element attribute value

by, value, attribute, timeout

Element State Validation Tools

Tool

Description

Parameters

browser_element_is_displayed

Check if an element is visible on the page

by, value, timeout

browser_element_is_enabled

Check if an element is enabled for interaction

by, value, timeout

browser_element_is_selected

Check if an element is selected (checkboxes, radio buttons)

by, value, timeout

Frame Management Tools

Tool

Description

Parameters

browser_switch_to_frame

Switch to an iframe element

by, value, timeout

browser_switch_to_parent_frame

Switch to the parent frame (from nested iframe)

None

browser_switch_to_default_content

Switch back to the main page content

None

Advanced Action Tools

Tool

Description

Parameters

browser_hover

Hover over an element

by, value, timeout

browser_double_click

Double-click on an element

by, value, timeout

browser_right_click

Right-click (context menu)

by, value, timeout

browser_drag_and_drop

Drag from source to target

by, value, targetBy, targetValue, timeout

browser_wait_for_element

Wait for element to appear

by, value, timeout

browser_execute_script

Execute JavaScript code

script, args

browser_screenshot

Take a screenshot

filename (optional)

browser_select_dropdown_by_text

Select dropdown option by visible text

by, value, text, timeout

browser_select_dropdown_by_value

Select dropdown option by value

by, value, dropdownValue, timeout

browser_key_press

Press a keyboard key in the browser

key, timeout

Scrolling Tools

Tool

Description

Parameters

browser_scroll_to_element

Scroll to bring an element into view

by, value, timeout

browser_scroll_to_top

Scroll to the top of the page

None

browser_scroll_to_bottom

Scroll to the bottom of the page

None

browser_scroll_to_coordinates

Scroll to specific coordinates

x, y

browser_scroll_by_pixels

Scroll by specified number of pixels

x, y

Form Interaction Tools

Tool

Description

Parameters

browser_select_checkbox

Select/check a checkbox

by, value, timeout

browser_unselect_checkbox

Unselect/uncheck a checkbox

by, value, timeout

browser_submit_form

Submit a form element

by, value, timeout

browser_focus_element

Focus on a specific element

by, value, timeout

browser_blur_element

Remove focus from a specific element

by, value, timeout

Element Locator Strategies

  • id: Find by element ID

  • css: Find by CSS selector

  • xpath: Find by XPath expression

  • name: Find by name attribute

  • tag: Find by HTML tag name

  • class: Find by CSS class name

📋 Requirements

  • Node.js: Version 18.0.0 or higher

  • Browsers: Chrome, Firefox, Safari, or Edge installed

  • WebDrivers: Automatically managed by selenium-webdriver

  • Operating System: Windows, macOS, or Linux

🚦 Development

Getting Started

Clone the repository

git clone https://github.com/pshivapr/selenium-mcp.git
cd selenium-mcp

Install dependencies

npm install

Build the project

npm run build

Running the Server

Production Mode

npm start

Development Mode (with auto-reload)

npm run dev

Direct Execution

node dist/index.js

Using as CLI Tool

After building, you can use the server as a global command:

npx selenium-webdriver-mcp@latest

📝 License

MIT License - see LICENSE file for details.

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository

  2. Create your feature branch (git checkout -b feature/AmazingFeature)

  3. Commit your changes (git commit -m 'Add some AmazingFeature')

  4. Push to the branch (git push origin feature/AmazingFeature)

  5. Open a Pull Request

Badges/Mentions

MCP Market

Pulse

MCP Badge


Built with ❤️ for the Model Context Protocol ecosystem

Available Tools

56 tools
browser_blur_elementC

Remove focus from a specific element

Inputs: by (required), value (required), timeout.

browser_clearB

Clears the value of an input element

Inputs: by (required), value (required), timeout.

browser_clickC

Perform a click on an element

Inputs: by (required), value (required), timeout.

browser_closeA

Close the current browser session

Inputs: no named parameters.

browser_delete_cookiesC

Delete cookies from the browser

Inputs: no named parameters.

browser_double_clickC

Perform double click on an element

Inputs: by (required), value (required), timeout.

browser_drag_and_dropC

Perform drag and drop between two elements

Inputs: by (required), value (required), targetBy (required), targetValue (required), +1 more.

browser_element_is_displayedC

Checks if an element is displayed

Inputs: by (required), value (required), timeout.

browser_element_is_enabledC

Checks if an element is enabled

Inputs: by (required), value (required), timeout.

browser_element_is_selectedC

Checks if an element is selected

Inputs: by (required), value (required), timeout.

browser_execute_scriptC

Execute JavaScript in the context of the current page

Inputs: script (required).

browser_file_uploadC

Uploads a file using a file input element

Inputs: by (required), value (required), filePath (required), timeout.

browser_find_elementC

Find an element

Inputs: by (required), value (required), timeout.

browser_find_elementsC

Find multiple elements

Inputs: by (required), value (required), timeout.

browser_focus_elementC

Focus on a specific element

Inputs: by (required), value (required), timeout.

browser_get_attributeC

Gets the value of an attribute from an element

Inputs: by (required), value (required), attribute (required), timeout.

browser_get_cookiesC

Get all cookies

Inputs: no named parameters.

browser_get_element_textC

Gets the text of an element

Inputs: by (required), value (required), timeout.

browser_get_page_sourceB

Get the current page source

Inputs: no named parameters.

browser_get_urlA

Get the current page URL

Inputs: no named parameters.

browser_hoverC

Hover over an element

Inputs: by (required), value (required), timeout.

browser_key_pressC

Press a key on the keyboard

Inputs: key (required).

browser_maximizeB

Maximize the browser window

Inputs: no named parameters.

browser_navigateC

Navigate to a URL

Inputs: url (required).

browser_navigate_backA

Navigate back in the browser

Inputs: no named parameters.

browser_navigate_forwardB

Navigate forward in the browser

Inputs: no named parameters.

browser_openC

Open a new browser session

Inputs: browser (required), options.

browser_refreshA

Refresh the current page

Inputs: no named parameters.

browser_resizeC

Resize the browser window

Inputs: width (required), height (required).

browser_right_clickB

Perform right click (context click) on an element

Inputs: by (required), value (required), timeout.

browser_screenshotC

Take a screenshot of the current page

Inputs: outputPath.

browser_scroll_by_pixelsC

Scroll by a specific number of pixels

Inputs: x (required), y (required).

browser_scroll_to_bottomB

Scroll to the bottom of the page

Inputs: no named parameters.

browser_scroll_to_coordinatesC

Scroll to specific coordinates

Inputs: x (required), y (required).

browser_scroll_to_elementC

Scroll to an element

Inputs: by (required), value (required), timeout.

browser_scroll_to_topA

Scroll to the top of the page

Inputs: no named parameters.

browser_select_checkboxC

Select a checkbox

Inputs: by (required), value (required), timeout.

browser_select_dropdown_by_textC

Select dropdown by visible text

Inputs: by (required), text (required), value (required), timeout.

browser_select_dropdown_by_valueC

Select dropdown by value

Inputs: by (required), value (required), timeout.

browser_submit_formC

Submit a form

Inputs: by (required), value (required), timeout.

browser_switch_to_default_contentB

Switches to the default content

Inputs: no named parameters.

browser_switch_to_frameC

Switches to an iframe element

Inputs: by (required), value (required), timeout.

browser_switch_to_original_windowA

Switches back to the original browser window

Inputs: no named parameters.

browser_switch_to_parent_frameB

Switches to the parent iframe

Inputs: no named parameters.

browser_switch_to_windowC

Switch to a different browser window

Inputs: windowHandle (required).

browser_switch_to_window_by_titleC

Switch to a window by its title

Inputs: title (required).

browser_switch_to_window_by_urlC

Switch to a window by its URL

Inputs: url (required).

browser_switch_window_by_indexC

Switch to a window by its index

Inputs: index (required).

browser_titleA

Get the current page title

Inputs: no named parameters.

browser_typeC

Type into an editable field

Inputs: by (required), text (required), value (required), timeout.

browser_unselect_checkboxC

Unselect a checkbox

Inputs: by (required), value (required), timeout.

browser_wait_for_elementC

Wait for an element to be present

Inputs: by (required), value (required), timeout (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.8/5.0

    Scored across 56 tools

    Disambiguation4/5

    Most tools map to clearly distinct Selenium actions, but window-switching and cookie tools overlap (e.g., add_cookie_by_name vs set_cookie_object, multiple switch_to_window variants), and several scroll tools could be confused without careful reading. Descriptions help, but boundaries are not perfectly crisp.

    Naming Consistency4/5

    All names use the browser_ prefix and snake_case, giving the set a predictable, readable structure. However, the verb/noun pattern is not uniform: some are verb-only (browser_refresh, browser_maximize) or noun-only (browser_title), and element-state getters use subject_is_state phrasing.

    Tool Count1/5

    56 tools far exceeds the 3-15 well-scoped range and passes the 50+ threshold for extreme mismatch. Many granular low-level operations could be consolidated, making the surface unwieldy for an agent.

    Completeness4/5

    Core lifecycle and interaction coverage is strong: open/close, navigation, find, click/type/clear, frames, windows, cookies, screenshots, scrolling, upload, and script execution. Notable gaps include alert/dialog handling and explicit wait conditions beyond element presence, so a few common automation workflows may dead-end.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers