Selenium MCP server

Automates web browser actions with Selenium WebDriver.
Back to servers
Provider
Angie Jones
Release date
Feb 12, 2025
Language
TypeScript
Package
Stats
2.4K downloads
115 stars

The MCP Selenium Server is an implementation of the Model Context Protocol for Selenium WebDriver, allowing you to automate browser interactions through standardized MCP clients. It provides a comprehensive set of browser automation capabilities through a consistent API.

Installation Options

Installing for Goose

One-Click Installation

You can easily add this extension to Goose Desktop by copying and pasting this link into your browser's address bar:

goose://extension?cmd=npx&arg=-y&arg=%40angiejones%2Fmcp-selenium&id=selenium-mcp&name=Selenium%20MCP&description=automates%20browser%20interactions

Manual Installation for Goose

Alternatively, you can add it manually with these settings:

  • Name: Selenium MCP
  • Description: automates browser interactions
  • Command: npx -y @angiejones/mcp-selenium

Installing for Other MCP Clients

For Claude Desktop or other MCP clients, add this configuration to your settings:

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

Installing via Smithery

If you use Smithery:

npx -y @smithery/cli install @angiejones/mcp-selenium --client claude

Manual Global Installation

You can also install the package globally:

npm install -g @angiejones/mcp-selenium

Running the Server

Start the server by running:

mcp-selenium

Supported Browsers

The MCP server currently supports:

  • Chrome
  • Firefox

Available Tools

Browser Management

Starting a Browser

{
  "tool": "start_browser",
  "parameters": {
    "browser": "chrome",
    "options": {
      "headless": true,
      "arguments": ["--no-sandbox"]
    }
  }
}

Parameters:

  • browser (required): Either "chrome" or "firefox"
  • options: Browser configuration options
    • headless: Run browser without UI (boolean)
    • arguments: Additional browser-specific arguments

Closing a Session

{
  "tool": "close_session",
  "parameters": {}
}

Navigation

Navigate to a URL

{
  "tool": "navigate",
  "parameters": {
    "url": "https://www.example.com"
  }
}

Parameters:

  • url (required): The URL to navigate to

Element Interactions

Finding Elements

{
  "tool": "find_element",
  "parameters": {
    "by": "id",
    "value": "search-input",
    "timeout": 5000
  }
}

Parameters:

  • by (required): Locator strategy ("id", "css", "xpath", "name", "tag", "class")
  • value (required): Value for the locator
  • timeout: Maximum wait time in milliseconds (default: 10000)

Clicking Elements

{
  "tool": "click_element",
  "parameters": {
    "by": "css",
    "value": ".submit-button"
  }
}

Parameters:

  • by (required): Locator strategy
  • value (required): Value for the locator
  • timeout: Maximum wait time in milliseconds (default: 10000)

Typing Text

{
  "tool": "send_keys",
  "parameters": {
    "by": "name",
    "value": "username",
    "text": "testuser"
  }
}

Parameters:

  • by (required): Locator strategy
  • value (required): Value for the locator
  • text (required): Text to enter
  • timeout: Maximum wait time in milliseconds (default: 10000)

Getting Element Text

{
  "tool": "get_element_text",
  "parameters": {
    "by": "css",
    "value": ".message"
  }
}

Parameters:

  • by (required): Locator strategy
  • value (required): Value for the locator
  • timeout: Maximum wait time in milliseconds (default: 10000)

Mouse Actions

Hovering Over Elements

{
  "tool": "hover",
  "parameters": {
    "by": "css",
    "value": ".dropdown-menu"
  }
}

Parameters:

  • by (required): Locator strategy
  • value (required): Value for the locator
  • timeout: Maximum wait time in milliseconds (default: 10000)

Drag and Drop

{
  "tool": "drag_and_drop",
  "parameters": {
    "by": "id",
    "value": "draggable",
    "targetBy": "id",
    "targetValue": "droppable"
  }
}

Parameters:

  • by (required): Locator strategy for source element
  • value (required): Value for source locator
  • targetBy (required): Locator strategy for target element
  • targetValue (required): Value for target locator
  • timeout: Maximum wait time in milliseconds (default: 10000)

Double Click

{
  "tool": "double_click",
  "parameters": {
    "by": "css",
    "value": ".editable-text"
  }
}

Parameters:

  • by (required): Locator strategy
  • value (required): Value for the locator
  • timeout: Maximum wait time in milliseconds (default: 10000)

Right Click

{
  "tool": "right_click",
  "parameters": {
    "by": "css",
    "value": ".context-menu-trigger"
  }
}

Parameters:

  • by (required): Locator strategy
  • value (required): Value for the locator
  • timeout: Maximum wait time in milliseconds (default: 10000)

Keyboard Actions

{
  "tool": "press_key",
  "parameters": {
    "key": "Enter"
  }
}

Parameters:

  • key (required): Key to press (e.g., 'Enter', 'Tab', 'a')

File Operations

Uploading Files

{
  "tool": "upload_file",
  "parameters": {
    "by": "id",
    "value": "file-input",
    "filePath": "/path/to/file.pdf"
  }
}

Parameters:

  • by (required): Locator strategy
  • value (required): Value for the locator
  • filePath (required): Absolute path to the file
  • timeout: Maximum wait time in milliseconds (default: 10000)

Screenshots

{
  "tool": "take_screenshot",
  "parameters": {
    "outputPath": "/path/to/screenshot.png"
  }
}

Parameters:

  • outputPath (optional): Path to save the screenshot (returns base64 data if not provided)

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later