Selenium MCP Server

Quick Start: Install & Use in VS Code

Prerequisites

1. Clone the Repository

git clone https://github.com/KiranMote/Selenium_MCP_Server.git
cd Selenium_MCP_Server
Clone repo screenshot

2. Install Dependencies

npm install

3. Build the Project

npm run build

4. (Optional) Test the Server

Add and run tests as needed.

5. Register the MCP Server in VS Code

Global Registration (Recommended):

  1. Open (or create) the file:
    C:\Users\\AppData\Roaming\Code\User\mcp.json
mcp.json screenshot

Add the following under "servers":

{
  "selenium-mcp-server": {
    "type": "stdio",
    "command": "node",
    "args": [
      "C:\\Users\\\\Selenium_MCP_Server\\dist\\index.js"
    ]
  }
}
servers config screenshot

Save the file. Now, the server is available in all VS Code workspaces.

VS Code folder screenshot

How to use Selenium MCP server

Check in Github Copilot Chat section Selenium MCP server tools present or not.

Copilot chat tools screenshot Copilot chat tools screenshot 2

Give Prompt As per Requirement:

Prompt example screenshot

It uses exploration, inspect, and more tools from that MCP and does work for us.

Features

Available Tools

Example Usage

{
  "tool": "start_browser",
  "arguments": {
    "browser": "chrome",
    "headless": false,
    "windowSize": "1920x1080"
  }
}

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

{
  "tool": "click",
  "arguments": {
    "selector": "#submit-button",
    "method": "css"
  }
}

{
  "tool": "type_text",
  "arguments": {
    "selector": "input[name='username']",
    "text": "user123",
    "method": "css"
  }
}

Configuration

Development

Building

npm run build

Running in Development

npm run dev

Project Structure

src/
  index.ts          # Main server implementation
dist/               # Compiled JavaScript output
.vscode/
  mcp.json         # MCP server configuration
.github/
  copilot-instructions.md  # Copilot development guidelines

Browser Driver Setup

Make sure you have the appropriate browser drivers installed:

Most drivers can be automatically managed by Selenium WebDriver 4+.

Error Handling

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

MIT License - see LICENSE file for details.

Related Projects