selenium-mcp-server

skindyk/selenium-mcp-server

3.2

If you are the rightful owner of selenium-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The Selenium MCP Server is a Model Context Protocol server that integrates MCP clients with Selenium WebDriver for natural language browser interactions.

Selenium MCP Server

A Model Context Protocol (MCP) server that provides seamless integration between MCP clients and Selenium WebDriver. This server enables natural language interactions with web browsers for automated testing, web scraping, and page analysis.

Features

  • Natural Language Interface: Control browsers using conversational commands
  • Complete Browser Automation: 48 tools covering all essential Selenium operations
  • Multi-Browser Support: Chrome, Firefox, and Microsoft Edge
  • AI-Optimized Discovery: Specialized tools for page analysis and test generation
  • Flexible Tool Control: Limit available tools using environment variables
  • TypeScript Implementation: Full type safety and better error handling

📋 Prerequisites

  • Node.js: Version 18.0.0 or higher
  • TypeScript: Version 5.0.0 or higher
  • Browser Drivers: Appropriate WebDriver for your target browser(s)
    • Chrome: ChromeDriver (usually auto-managed by selenium-webdriver)
    • Firefox: GeckoDriver
    • Edge: EdgeDriver

🛠️ Installation

  1. Clone the project:

    git clone https://github.com/your-username/selenium-mcp-server.git
    cd selenium-mcp-server
    
  2. Install dependencies:

    npm install
    
  3. Build the project:

    npm run build
    
  4. Test the server (optional):

    node dist/index.js
    

    You should see: Selenium MCP Server running on stdio

⚙️ Configuration

MCP Client Configuration

Windows:

{
  "servers": {
    "selenium": {
      "command": "node",
      "args": ["C:\\path\\to\\your\\selenium-mcp-server\\wrapper.cjs"]
    }
  }
}

macOS/Linux:

{
  "servers": {
    "selenium": {
      "command": "node",
      "args": ["/path/to/your/selenium-mcp-server/wrapper.cjs"]
    }
  }
}

Replace the paths with your actual absolute path to wrapper.cjs.

Environment Variables

You can control which tools are available using the MCP_TOOLS environment variable:

  • No MCP_TOOLS set or no env section: All 48 tools are available by default
  • MCP_TOOLS with specific tools: Only those tools will be available

Examples:

Default configuration (all tools available):

{
  "servers": {
    "selenium": {
      "command": "node",
      "args": ["/path/to/your/selenium-mcp-server/wrapper.cjs"]
    }
  }
}

Limit to specific tools only:

{
  "servers": {
    "selenium": {
      "command": "node",
      "args": ["/path/to/your/selenium-mcp-server/wrapper.cjs"],
      "env": {
        "MCP_TOOLS": ["start_browser", "navigate", "click_element", "send_keys"]
      }
    }
  }
}

🚨 Troubleshooting

Common Issues

  • Server Won't Start: Check Node.js version (18+) and run npm run build
  • Connection Issues: Verify absolute paths in MCP configuration
  • Browser Driver Issues: Ensure appropriate WebDriver is installed and browser versions are compatible

📄 License

MIT License.