A Model Context Protocol (MCP) server for browser automation using Selenium WebDriver. Enables LLMs and teams to automate browsers via a standard protocol, similar to Playwright MCP.
- Multi-browser support (Chrome, Firefox, Edge, Safari)
- Team-friendly: visible browser by default
- MCP-compliant API (navigate, click, type, screenshot, etc.)
- Easy onboarding for teams and CI
- Ensure your
package.json
is correct (see below) - Run:
npm publish --access public
- Or for private registry:
npm publish --access restricted
npm install -g selenium-mcp-server
selenium-mcp-server --browser chrome
npx selenium-mcp-server@latest --browser chrome
Add to your .cursor/mcp.json
or equivalent:
{
"mcpServers": {
"selenium": {
"command": "selenium-mcp-server",
"args": ["--browser", "chrome"]
}
}
}
- For CI, run the server as a background process and point clients to its port.
- Install Node.js 18+ and Java 11+
- Install the MCP server globally or use npx
- Share the npm package name and README with your team
- Provide example configs and usage (see above)
- For support, use the GitHub repo issues page
{
"name": "selenium-mcp-server",
"version": "1.0.0",
"description": "Selenium MCP server for browser automation",
"main": "index.js",
"bin": { "selenium-mcp-server": "index.js" },
"repository": { "type": "git", "url": "https://github.com/your-org/selenium-mcp-server.git" },
"author": "Your Name",
"license": "MIT"
}
-
browser_navigate
- Navigate to any URL -
browser_snapshot
- Get page accessibility snapshot with element references -
browser_click
- Click on elements using references from snapshots -
browser_type
- Type text into form fields with optional submission -
browser_wait_for
- Wait for time, text to appear, or text to disappear -
browser_take_screenshot
- Capture screenshots of the current page
-
Add to Cursor Settings:
- Go to
Cursor Settings
→MCP
→Add new MCP Server
- Name:
selenium-mcp
- Command type:
command
- Command:
npx
- Arguments:
["selenium-mcp-server@latest"]
- Go to
-
Alternative JSON Configuration:
{
"mcpServers": {
"selenium-mcp": {
"command": "npx",
"args": ["selenium-mcp-server@latest"]
}
}
}
Use the same configuration pattern with your MCP client:
{
"mcpServers": {
"selenium-mcp": {
"command": "npx",
"args": ["selenium-mcp-server@latest"]
}
}
}
Click to see other installation options
npm install selenium-mcp-server
npm install -g selenium-mcp-server
Create .cursor/mcp.json
in your project root:
{
"mcpServers": {
"selenium": {
"command": "npx",
"args": [
"selenium-mcp-server@latest",
"--browser", "chrome"
]
}
}
}
- Quit Cursor completely
- Restart Cursor
- npx will automatically download and run the server
Alternative Setup Methods
npm install selenium-mcp-server
{
"mcpServers": {
"selenium": {
"command": "node",
"args": ["./node_modules/selenium-mcp-server/dist/index.js", "--browser", "chrome", "--headless"]
}
}
}
npm install -g selenium-mcp-server
{
"mcpServers": {
"selenium": {
"command": "selenium-mcp",
"args": ["--browser", "chrome", "--headless"]
}
}
}
Ask Cursor to perform browser automation:
- "Navigate to google.com and take a screenshot"
- "Fill out the contact form on example.com"
- "Extract all links from the current page"
selenium-mcp [options]
Options:
--browser <browser> Browser to use (chrome, firefox, edge, safari) (default: "chrome")
--headless Run browser in headless mode
--executable-path <path> Path to browser executable
--user-data-dir <path> Path to user data directory
--isolated Keep browser profile in memory
--viewport-size <size> Browser viewport size (e.g., 1280,720)
--output-dir <path> Path to directory for output files
-h, --help Display help for command
-
browser_navigate
- Navigate to URLs -
browser_navigate_back
- Go back in history -
browser_navigate_forward
- Go forward in history
-
browser_click
- Click on elements -
browser_type
- Type text into inputs -
browser_hover
- Hover over elements -
browser_drag
- Drag and drop elements -
browser_select_option
- Select dropdown options -
browser_press_key
- Press keyboard keys
-
browser_snapshot
- Capture accessibility tree -
browser_take_screenshot
- Take screenshots -
browser_network_requests
- List network requests -
browser_console_messages
- Get console messages
-
browser_tab_list
- List open tabs -
browser_tab_new
- Open new tabs -
browser_tab_select
- Switch tabs -
browser_tab_close
- Close tabs
-
browser_wait_for
- Wait for elements/text -
browser_file_upload
- Upload files -
browser_handle_dialog
- Handle alerts/dialogs -
browser_resize
- Resize browser window -
browser_pdf_save
- Save page as PDF
// In Cursor, ask:
"Navigate to https://example.com and take a screenshot"
// In Cursor, ask:
"Go to the contact page and fill out the form with name 'John Doe' and email 'john@example.com'"
// In Cursor, ask:
"Visit the product page and extract all product names and prices"
- Node.js 18+
- Java 11+ (for Selenium WebDriver)
- Browser drivers (automatically managed by WebDriverManager)
{
"mcpServers": {
"selenium": {
"command": "selenium-mcp",
"args": ["--browser", "chrome"]
}
}
}
{
"mcpServers": {
"selenium": {
"command": "selenium-mcp",
"args": [
"--browser", "chrome",
"--headless",
"--viewport-size", "1920,1080"
]
}
}
}
{
"mcpServers": {
"selenium": {
"command": "selenium-mcp",
"args": [
"--browser", "chrome",
"--executable-path", "/path/to/chrome"
]
}
}
}
If you get browser not found errors:
- Install the browser (Chrome, Firefox, etc.)
- Use
--executable-path
to specify browser location - Check that Java is installed and accessible
On macOS, you might need to grant accessibility permissions:
- Go to System Preferences > Security & Privacy > Privacy
- Select "Accessibility"
- Add your terminal application
For large pages or long-running sessions:
{
"mcpServers": {
"selenium": {
"command": "selenium-mcp",
"args": ["--isolated", "--headless"]
}
}
}
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
MIT License - see LICENSE file for details.
- Playwright MCP - Similar server using Playwright
- Model Context Protocol - The protocol specification
- Selenium WebDriver - The underlying browser automation framework