Use Selenium MCP Server with Claude Desktop on macOS
This guide connects Claude Desktop to the Selenium MCP server. After setup, you can ask Claude to browse and inspect pages using plain-language prompts.
What you need
- Claude Desktop installed and running on macOS
- Python 3.10 or later
- Chrome, Firefox, Edge, or Safari installed
- An internet connection the first time Selenium Manager sets up a browser driver
The server controls a real browser on your Mac. Chrome is selected by default, and the browser runs headlessly unless you turn headless mode off.
1. Download the project
git clone https://github.com/rpallavisharma/seleniummcpserver.git
cd seleniummcpserver
If you already downloaded the repository, use cd to move into the folder that
contains requirements.txt and the selenium_mcp_server directory.
2. Create an environment and install dependencies
Check that Python is new enough:
python3 --version
If the version is below 3.10, install a newer Python first. Then, from the repository directory:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
Keep the virtual environment in the repository. Claude will use its Python executable in the next step.
3. Copy the full repository path
pwd
Copy the printed path. It should be the directory containing both requirements.txt
and selenium_mcp_server/, for example /Users/yourname/Documents/seleniummcpserver.
4. Configure Claude Desktop
In Claude Desktop, open Settings → Developer → Edit Config. This opens
claude_desktop_config.json. If the file already contains settings, preserve them and
add the selenium entry inside the existing mcpServers object.
Replace both occurrences of /Users/yourname/Documents/seleniummcpserver with the exact path you copied:
{
"mcpServers": {
"selenium": {
"command": "/Users/yourname/Documents/seleniummcpserver/.venv/bin/python",
"args": ["-m", "selenium_mcp_server"],
"env": {
"PYTHONPATH": "/Users/yourname/Documents/seleniummcpserver",
"SELENIUM_BROWSER": "chrome",
"SELENIUM_HEADLESS": "false"
}
}
}
}
PYTHONPATH tells Python where to find the project package. Both paths must point to the
repository root, not the selenium_mcp_server subfolder. Use valid JSON: double quotes and
commas between entries.
To keep the browser hidden, set SELENIUM_HEADLESS to "true" or remove it. To use
another browser, set SELENIUM_BROWSER to "firefox", "edge", or
"safari". Safari requires enabling automation in its Develop menu.
5. Restart and check the connection
Save the config, fully quit Claude Desktop with Cmd+Q, then reopen it. Go to Settings → Developer and check that the Selenium server is running. If Claude asks permission to use a tool, review the request and allow it when appropriate.
6. Try a first browser task
Open https://example.com and tell me the page title and the main text.
Claude should navigate to the page and inspect it. With "SELENIUM_HEADLESS": "false" you
should also see the browser window.
7. Try more tasks
- “Open https://example.com and list its links.”
- “Take a screenshot of the current page.”
- “Find the heading on this page and tell me its text.”
- “Wait for the element with CSS selector
#resultsto appear, then read its text.” - “Go back one page and tell me the current URL.”
Troubleshooting
No module named selenium_mcp_server
Check that PYTHONPATH is the exact repository path from pwd and contains the
selenium_mcp_server directory, and that command points to
.venv/bin/python in that same repository. Quit and reopen Claude Desktop after editing the config.
/full/path/to/seleniummcpserver/.venv/bin/python -c "import selenium_mcp_server; print('Package found')"
Could not find a version while installing
Check python3 --version; Python 3.10 or later is required. If it is recent enough, check that
your network, VPN, or proxy allows access to PyPI, then retry.
Claude reports that the server disconnected
Open Settings → Developer and inspect the server logs. Check for invalid JSON, incorrect paths, and dependency errors, and make sure you restarted Claude Desktop after changing its config.
The browser does not open
Confirm the selected browser is installed. On first use, Selenium Manager may need internet access to obtain a driver. Safari requires macOS and Safari automation enabled in the Develop menu.
The server can click, type into forms, read page content, and execute JavaScript. Start with public, non-sensitive pages, review actions before allowing them, and avoid private accounts or sensitive data.