Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions mcp_servers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### The [SeleniumBase](https://github.com/seleniumbase/SeleniumBase) MCP server provides stealthy browser automation over the [Model Context Protocol](https://modelcontextprotocol.io) for MCP clients.

This server, (located in `server.py`), uses SeleniumBase's [Pure CDP Mode](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/cdp_mode_methods.md) (`seleniumbase.sb_cdp.Chrome`), where the browser is driven entirely over the Chrome DevTools Protocol, and there is no WebDriver in the loop at all, which makes it SeleniumBase's stealthiest mode. CAPTCHA-solving is included via the `solve_captcha()` method!
This server, (located in `server.py`), uses SeleniumBase's [Pure CDP Mode](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/cdp_mode_methods.md) (`seleniumbase.sb_cdp.Chrome`), where the browser is driven entirely over the Chrome DevTools Protocol, and there is no WebDriver in the loop at all, which makes it SeleniumBase's stealthiest mode. CAPTCHA-solving is available through `solve_captcha()`.

Other SeleniumBase automation styles, (such as `Driver()` and `SB()`), have their own MCP servers in [seleniumbase/seleniumbase-mcp](https://github.com/seleniumbase/seleniumbase-mcp).

Expand Down Expand Up @@ -37,15 +37,23 @@ uv sync

Pure CDP Mode doesn't use WebDriver, so no `chromedriver` download is needed... just a working Chrome/Chromium install.

(No `uv`? `python3 -m venv venv && pip install -r requirements.txt` works too. `requirements.txt` installs the local SeleniumBase checkout via `-e .` the same way. Substitute `python server.py` for `uv run seleniumbase-mcp` everywhere below, and use absolute `venv/bin/python` + script path in your MCP client config instead of the path-free options.)
(If you don't want to use `uv`, you can use a standard Python virtual environment instead: `python3 -m venv venv && pip install -r requirements.txt` works too. `requirements.txt` installs the local SeleniumBase checkout via `-e .` the same way. Substitute `python server.py` for `uv run seleniumbase-mcp` everywhere below, and use absolute `venv/bin/python` + script path in your MCP client config instead of the path-free options.)

Without `uv`, you can directly run the `seleniumbase-mcp` command to start the server after `pip`-installing `seleniumbase`.

## 2. Try it standalone (optional sanity check)

```bash
mcp dev server.py
```

Or if using `uv`:

```bash
uv run mcp dev server.py
```

That opens the MCP Inspector, where you can test commands ("Tools"). Ctrl+C to exit. Next step is wiring it into a client.
That opens the MCP Inspector, where you can test commands ("Tools"). Use Ctrl+C to exit from the terminal. Next step is wiring it into a client harness.

## 3. Connect it to Claude Desktop

Expand Down Expand Up @@ -117,15 +125,15 @@ Restart Claude Desktop. You should see a 🔨 tools icon indicating the server c
## 4. Connect it to Claude Code

This folder's `.mcp.json` is checked in and ready to use as-is.
No path editing is required because `uv run seleniumbase-mcp` resolves this project from `pyproject.toml` in the current directory:
No path editing is required because `seleniumbase-mcp` resolves this project from `pyproject.toml` in the current directory:

```json
{
"mcpServers": {
"seleniumbase-mcp": {
"type": "stdio",
"command": "uv",
"args": ["run", "seleniumbase-mcp"]
"command": "seleniumbase-mcp",
"args": []
}
}
}
Expand All @@ -134,7 +142,7 @@ No path editing is required because `uv run seleniumbase-mcp` resolves this proj
**The `.mcp.json` file helps clients connect to the MCP server.**

1. Claude Code auto-loads `.mcp.json` from whatever directory you launch `claude` in.
2. `uv run seleniumbase-mcp` needs `pyproject.toml` to be discoverable from the current directory. That resolves cleanly when `.mcp.json` and `pyproject.toml` sit next to each other.
2. `seleniumbase-mcp` needs `pyproject.toml` to be discoverable from the current directory. That resolves cleanly when `.mcp.json` and `pyproject.toml` sit next to each other.

Run `claude` from inside `mcp_servers/` or the root folder to get it auto-loaded.

Expand Down
2 changes: 1 addition & 1 deletion mcp_servers/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "seleniumbase-mcp"
version = "1.3.10dev0"
version = "1.3.11dev0"
description = "MCP server exposing SeleniumBase CDP Mode as tools for MCP clients."
readme = "README.md"
requires-python = ">=3.10"
Expand Down
22 changes: 8 additions & 14 deletions mcp_servers/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -1430,16 +1430,16 @@ def manage_cookies(

Args:
action:
- "get_all": Return all cookies currently available to the
browser, including attributes such as name, value, domain,
path, expiry, and security flags.
- "get_all": Return all cookies currently available to the browser,
including attributes such as name, value, domain, path, expiry,
and security flags.
- "clear": Delete all cookies from the current browser session.
- "save": Save current cookies to filename.
- "save": Save current cookies to filename. The file may be
created or overwritten.
- "load": Load cookies from filename into the current browser
session.

filename: The name of the file to save/load cookies from.
Will be sanitized and saved in a restricted directory.
filename: The sanitized filesystem path used by save/load.
Ignored for get_all and clear.

Returns:
Expand All @@ -1453,19 +1453,13 @@ def manage_cookies(
identifiers, and other private information. Only inspect, save,
load, or share cookies when explicitly authorized.

The save action can overwrite existing files.

Notes:
Loading saved cookies does not guarantee restoration of a login.
Cookies may be expired, invalidated, domain/path restricted, or
dependent on other browser state. Navigate to the relevant site when
necessary so the browser has the appropriate origin for the cookies.

Tool selection:
- Need cookies or authentication cookies -> use this tool.
- Need localStorage/sessionStorage -> use manage_storage.
- Need arbitrary JavaScript or storage operations not covered here ->
use run_javascript.
- Need visible page content or HTML -> use get_content.
- Need an element's HTML attributes -> use get_attributes.
"""
sb = _get_sb()

Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ certifi>=2026.7.22
exceptiongroup>=1.3.1
websockets~=16.1.1;python_version=="3.10"
websockets>=16.1.1;python_version>="3.11"
filelock>=4.0.0
filelock>=4.0.1
fasteners>=0.20
mycdp>=1.4.0
pynose>=1.5.5
platformdirs>=4.11.10
platformdirs>=4.11.12
typing-extensions>=4.16.0
sbvirtualdisplay>=1.4.0
MarkupSafe>=3.0.3
Jinja2>=3.1.6
six>=1.17.0
parse>=1.22.1
parse>=1.22.2
parse-type>=0.6.6
colorama>=0.4.6
psutil>=7.2.2
Expand Down
2 changes: 1 addition & 1 deletion seleniumbase/__version__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# seleniumbase package
__version__ = "4.54.10"
__version__ = "4.54.11"
4 changes: 2 additions & 2 deletions server.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "io.github.seleniumbase/seleniumbase",
"title": "SeleniumBase MCP",
"description": "Stealthy browser automation, testing, and web-scraping via CDP Mode.",
"version": "4.54.10",
"version": "4.54.11",
"repository": {
"url": "https://github.com/seleniumbase/SeleniumBase",
"source": "github"
Expand All @@ -13,7 +13,7 @@
{
"registryType": "pypi",
"identifier": "seleniumbase",
"version": "4.54.10",
"version": "4.54.11",
"transport": {
"type": "stdio"
},
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,17 +173,17 @@
'exceptiongroup>=1.3.1',
'websockets~=16.1.1;python_version=="3.10"',
'websockets>=16.1.1;python_version>="3.11"',
'filelock>=4.0.0',
'filelock>=4.0.1',
'fasteners>=0.20',
'mycdp>=1.4.0',
'pynose>=1.5.5',
'platformdirs>=4.11.10',
'platformdirs>=4.11.12',
'typing-extensions>=4.16.0',
'sbvirtualdisplay>=1.4.0',
'MarkupSafe>=3.0.3',
'Jinja2>=3.1.6',
'six>=1.17.0',
'parse>=1.22.1',
'parse>=1.22.2',
'parse-type>=0.6.6',
'colorama>=0.4.6',
'psutil>=7.2.2',
Expand Down Expand Up @@ -303,7 +303,7 @@
# Required for local MCP server debugging with:
# mcp dev server.py
"uv": [
"uv>=0.12.15"
"uv>=0.12.17"
],
},
packages=[
Expand Down
Loading