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
5.6K downloads
194 stars

The MCP Selenium Server enables browser automation through Model Context Protocol (MCP) clients, allowing you to control web browsers programmatically with standardized commands. It supports Chrome and Firefox browsers with features like element interaction, navigation, screenshots, and file uploads.

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 Goose:

  • 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 Guide

Starting the Server

Run the server directly if installed globally:

mcp-selenium

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

Available Tools

Browser Control

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

Element Interaction

Finding Elements

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

Supported locator strategies: id, css, xpath, name, tag, class

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 Click

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

Right Click

{
  "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 and Ending Sessions

Taking Screenshots

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

Closing the Browser

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

Example Workflow

Here's a complete example of how to use the MCP Selenium Server to perform a Google search:

  1. Start Chrome browser:

    {
      "tool": "start_browser",
      "parameters": {
        "browser": "chrome"
      }
    }
    
  2. Navigate to Google:

    {
      "tool": "navigate",
      "parameters": {
        "url": "https://www.google.com"
      }
    }
    
  3. Find and click the search box:

    {
      "tool": "click_element",
      "parameters": {
        "by": "name",
        "value": "q"
      }
    }
    
  4. Type a search term:

    {
      "tool": "send_keys",
      "parameters": {
        "by": "name",
        "value": "q",
        "text": "MCP Selenium automation"
      }
    }
    
  5. Press Enter to search:

    {
      "tool": "press_key",
      "parameters": {
        "key": "Enter"
      }
    }
    
  6. Take a screenshot of the results:

    {
      "tool": "take_screenshot",
      "parameters": {}
    }
    
  7. Close the session:

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

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