Selenium MCP server

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

The MCP Selenium Server enables browser automation through standardized Model Context Protocol (MCP) clients, providing a convenient way to control Chrome, Firefox, and Edge browsers for automated testing and web interactions.

Installation

Using with Goose

One-Click Installation

Copy and paste this link into your browser address bar to add the extension to Goose Desktop:

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

Manual Addition to Goose

Add these details to Goose Desktop or CLI:

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

Using with Other MCP Clients

Add this configuration to your MCP client settings:

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

Direct Installation

You can install the package globally:

npm install -g @angiejones/mcp-selenium

Usage

Starting the Server

Run the server directly if installed globally:

mcp-selenium

Or use with NPX in your MCP configuration as shown in the installation section.

Available Tools

Browser Session Management

Starting a Browser

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

Navigating to a URL

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

Closing a Session

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

Element Interactions

Finding Elements

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

Clicking Elements

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

Typing Text

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

Getting Element Text

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

Advanced Interactions

Hovering Over Elements

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

Drag and Drop

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

Double-Clicking

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

Right-Clicking

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

Keyboard and File Operations

Pressing Keys

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

Uploading Files

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

Capturing Screenshots

{
  "tool": "take_screenshot",
  "parameters": {}
}

You can also specify an output path:

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

Common Locator Strategies

When finding elements, you can use these locator strategies:

  • id
  • css
  • xpath
  • name
  • tag
  • class

For example, to find an element by ID:

{
  "by": "id",
  "value": "login-button"
}

Or to find an element using CSS selectors:

{
  "by": "css",
  "value": ".navbar .dropdown-toggle"
}

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "selenium" '{"command":"npx","args":["-y","@angiejones/mcp-selenium"]}'

See the official Claude Code MCP documentation for more details.

For 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 > Tools & Integrations and click "New MCP Server".

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

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

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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

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

3. Restart Claude Desktop for the changes to take effect

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