Skip to main content
Glama
Selenium MCP Server

Selenium MCP Server

by zulfiqar90

Selenium MCP Server

A Model Context Protocol (MCP) server that provides browser automation capabilities using Selenium WebDriver.

Features

  • Browser Automation: Navigate, click, type, and interact with web pages

  • Element Interaction: Find elements by CSS selectors, wait for elements, get text content

  • Screenshots: Capture screenshots of the current page

  • JavaScript Execution: Execute custom JavaScript in the browser

  • Page Information: Get page title and current URL

  • Headless Mode: Run browser in headless mode for CI/CD environments

Related MCP server: mcp-chrome-server

Prerequisites

  • Node.js (v16 or higher)

  • Chrome browser (for WebDriver)

  • npm

Installation

  1. Install dependencies:

npm install
  1. Configure the server by editing config.json:

{
  "selenium": {
    "browser": "chrome",
    "headless": true,
    "timeout": 30000,
    "windowSize": {
      "width": 1920,
      "height": 1080
    }
  }
}

Usage

Starting the Server

npm start

The server runs on stdio and communicates using the MCP protocol.

Available Tools

The server provides the following tools:

  1. navigate - Navigate to a URL

    • Parameters: url (string, required)

  2. click - Click on an element

    • Parameters: selector (string, required) - CSS selector

  3. type - Type text into an element

    • Parameters: selector (string, required), text (string, required)

  4. get_text - Get text content of an element

    • Parameters: selector (string, required)

  5. wait_for_element - Wait for an element to be present

    • Parameters: selector (string, required), timeout (number, optional)

  6. screenshot - Take a screenshot

    • Parameters: filename (string, optional)

  7. get_title - Get the page title

    • Parameters: none

  8. get_url - Get the current URL

    • Parameters: none

  9. execute_script - Execute JavaScript

    • Parameters: script (string, required)

  10. close_browser - Close the browser session

    • Parameters: none

Configuration

Edit config.json to customize:

  • browser: Browser to use (chrome, firefox, etc.)

  • headless: Run in headless mode (true/false)

  • timeout: Default timeout for operations (milliseconds)

  • windowSize: Browser window dimensions

Example Usage

Here's an example of how to use the server tools:

  1. Navigate to a page:

navigate: { "url": "https://example.com" }
  1. Wait for an element:

wait_for_element: { "selector": "#login-button" }
  1. Type into an input:

type: { "selector": "#username", "text": "user123" }
  1. Click a button:

click: { "selector": "#login-button" }
  1. Take a screenshot:

screenshot: { "filename": "login.png" }
  1. Close the browser:

close_browser: {}

Troubleshooting

  • Ensure Chrome browser is installed

  • Make sure ChromeDriver is compatible with your Chrome version

  • Check that the port in config.json is not already in use

  • Verify Node.js version is 16 or higher

License

ISC

AI_Automation_Framework_With_MCP_Server

This is an Automation framework which is built with AI using MCP Server,Java MCP Client and Automated Flows of Google Search

Available Tools

10 tools
clickB

Click on an element by CSS selector

Inputs: selector (required).

close_browserB

Close the browser session

Inputs: no named parameters.

execute_scriptC

Execute JavaScript in the browser

Inputs: script (required).

get_textB

Get text content of an element by CSS selector

Inputs: selector (required).

get_titleA

Get the title of the current page

Inputs: no named parameters.

get_urlA

Get the current URL

Inputs: no named parameters.

screenshotB

Take a screenshot of the current page

Inputs: filename.

typeB

Type text into an element by CSS selector

Inputs: text (required), selector (required).

wait_for_elementB

Wait for an element to be present by CSS selector

Inputs: selector (required), timeout.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 10 tools

    Disambiguation5/5

    Each tool targets a distinct action (click, navigate, type, screenshot, etc.) with no overlap. Even CSS-selector-based tools like click, get_text, type, and wait_for_element are clearly separated by their operation.

    Naming Consistency5/5

    All tool names follow a consistent snake_case verb_noun pattern (e.g., close_browser, execute_script, wait_for_element). The naming is predictable and easy to understand.

    Tool Count5/5

    With 10 tools, the set covers essential browser automation actions without being bloated. Each tool earns its place, and the count is appropriate for the domain.

    Completeness4/5

    The tools cover core browsing tasks (navigation, interaction, script execution, screenshots, session control). Minor gaps exist, such as retrieving element attributes or handling alerts, but the surface is largely complete for common workflows.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables MCP clients to control a real local browser window for web automation tasks such as clicking, typing, scrolling, and taking screenshots.
      11 npm
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides browser automation using Selenium, supporting Chrome and Firefox, with tools for navigation, element interaction, screenshots, and more.
      1
      Mulan Permissive Software , Version 2