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
14.5K downloads
287 stars

The MCP Selenium Server provides a standardized interface for browser automation, allowing you to control Chrome, Firefox, and Edge browsers through Model Context Protocol (MCP) clients like Goose and Claude Desktop.

Installation Options

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 in the Goose extension configuration:

  • 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"]
    }
  }
}

Manual Installation

To install the package globally:

npm install -g @angiejones/mcp-selenium

Usage

Starting the Server

To start the server directly:

mcp-selenium

Available Tools

Browser Management

Starting a Browser

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

Parameters:

  • browser: Required, options are "chrome", "firefox"
  • options: Optional browser configuration
    • headless: Boolean to run browser without GUI
    • arguments: Array of additional browser arguments

Closing a Session

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

Navigation

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

Parameters:

  • url: Required, the URL to navigate to

Element Interaction

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 locator value
  • timeout: Optional wait time in milliseconds (default: 10000)

Clicking Elements

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

Typing Text

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

Parameters:

  • text: Required text to type into the element

Getting Element Text

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

Advanced Interactions

Hovering

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

Drag and Drop

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

Parameters:

  • targetBy: Required locator strategy for the drop target
  • targetValue: Required locator value for the drop target

Double-Click

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

Right-Click

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

Keyboard Actions

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

Parameters:

  • key: Required key to press (e.g., 'Enter', 'Tab')

File Handling

Uploading Files

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

Parameters:

  • filePath: Required absolute path to the file

Taking Screenshots

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

Parameters:

  • outputPath: Optional path to save the screenshot (returns base64 data if omitted)

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