Skip to content

Commit a035346

Browse files
authored
Merge pull request #4511 from seleniumbase/mcp-server-patch-19
MCP Server: Patch 19
2 parents 4c54cb7 + 7b371c2 commit a035346

7 files changed

Lines changed: 34 additions & 32 deletions

File tree

mcp_servers/README.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

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

7-
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!
7+
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()`.
88

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

@@ -37,15 +37,23 @@ uv sync
3737

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

40-
(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.)
40+
(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.)
41+
42+
Without `uv`, you can directly run the `seleniumbase-mcp` command to start the server after `pip`-installing `seleniumbase`.
4143

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

46+
```bash
47+
mcp dev server.py
48+
```
49+
50+
Or if using `uv`:
51+
4452
```bash
4553
uv run mcp dev server.py
4654
```
4755

48-
That opens the MCP Inspector, where you can test commands ("Tools"). Ctrl+C to exit. Next step is wiring it into a client.
56+
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.
4957

5058
## 3. Connect it to Claude Desktop
5159

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

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

122130
```json
123131
{
124132
"mcpServers": {
125133
"seleniumbase-mcp": {
126134
"type": "stdio",
127-
"command": "uv",
128-
"args": ["run", "seleniumbase-mcp"]
135+
"command": "seleniumbase-mcp",
136+
"args": []
129137
}
130138
}
131139
}
@@ -134,7 +142,7 @@ No path editing is required because `uv run seleniumbase-mcp` resolves this proj
134142
**The `.mcp.json` file helps clients connect to the MCP server.**
135143

136144
1. Claude Code auto-loads `.mcp.json` from whatever directory you launch `claude` in.
137-
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.
145+
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.
138146

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

mcp_servers/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "seleniumbase-mcp"
3-
version = "1.3.10dev0"
3+
version = "1.3.11dev0"
44
description = "MCP server exposing SeleniumBase CDP Mode as tools for MCP clients."
55
readme = "README.md"
66
requires-python = ">=3.10"

mcp_servers/server.py

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,16 +1430,16 @@ def manage_cookies(
14301430
14311431
Args:
14321432
action:
1433-
- "get_all": Return all cookies currently available to the
1434-
browser, including attributes such as name, value, domain,
1435-
path, expiry, and security flags.
1433+
- "get_all": Return all cookies currently available to the browser,
1434+
including attributes such as name, value, domain, path, expiry,
1435+
and security flags.
14361436
- "clear": Delete all cookies from the current browser session.
1437-
- "save": Save current cookies to filename.
1437+
- "save": Save current cookies to filename. The file may be
1438+
created or overwritten.
14381439
- "load": Load cookies from filename into the current browser
14391440
session.
14401441
1441-
filename: The name of the file to save/load cookies from.
1442-
Will be sanitized and saved in a restricted directory.
1442+
filename: The sanitized filesystem path used by save/load.
14431443
Ignored for get_all and clear.
14441444
14451445
Returns:
@@ -1453,19 +1453,13 @@ def manage_cookies(
14531453
identifiers, and other private information. Only inspect, save,
14541454
load, or share cookies when explicitly authorized.
14551455
1456+
The save action can overwrite existing files.
1457+
14561458
Notes:
14571459
Loading saved cookies does not guarantee restoration of a login.
14581460
Cookies may be expired, invalidated, domain/path restricted, or
14591461
dependent on other browser state. Navigate to the relevant site when
14601462
necessary so the browser has the appropriate origin for the cookies.
1461-
1462-
Tool selection:
1463-
- Need cookies or authentication cookies -> use this tool.
1464-
- Need localStorage/sessionStorage -> use manage_storage.
1465-
- Need arbitrary JavaScript or storage operations not covered here ->
1466-
use run_javascript.
1467-
- Need visible page content or HTML -> use get_content.
1468-
- Need an element's HTML attributes -> use get_attributes.
14691463
"""
14701464
sb = _get_sb()
14711465

requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ certifi>=2026.7.22
77
exceptiongroup>=1.3.1
88
websockets~=16.1.1;python_version=="3.10"
99
websockets>=16.1.1;python_version>="3.11"
10-
filelock>=4.0.0
10+
filelock>=4.0.1
1111
fasteners>=0.20
1212
mycdp>=1.4.0
1313
pynose>=1.5.5
14-
platformdirs>=4.11.10
14+
platformdirs>=4.11.12
1515
typing-extensions>=4.16.0
1616
sbvirtualdisplay>=1.4.0
1717
MarkupSafe>=3.0.3
1818
Jinja2>=3.1.6
1919
six>=1.17.0
20-
parse>=1.22.1
20+
parse>=1.22.2
2121
parse-type>=0.6.6
2222
colorama>=0.4.6
2323
psutil>=7.2.2

seleniumbase/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# seleniumbase package
2-
__version__ = "4.54.10"
2+
__version__ = "4.54.11"

server.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "io.github.seleniumbase/seleniumbase",
44
"title": "SeleniumBase MCP",
55
"description": "Stealthy browser automation, testing, and web-scraping via CDP Mode.",
6-
"version": "4.54.10",
6+
"version": "4.54.11",
77
"repository": {
88
"url": "https://github.com/seleniumbase/SeleniumBase",
99
"source": "github"
@@ -13,7 +13,7 @@
1313
{
1414
"registryType": "pypi",
1515
"identifier": "seleniumbase",
16-
"version": "4.54.10",
16+
"version": "4.54.11",
1717
"transport": {
1818
"type": "stdio"
1919
},

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,17 +173,17 @@
173173
'exceptiongroup>=1.3.1',
174174
'websockets~=16.1.1;python_version=="3.10"',
175175
'websockets>=16.1.1;python_version>="3.11"',
176-
'filelock>=4.0.0',
176+
'filelock>=4.0.1',
177177
'fasteners>=0.20',
178178
'mycdp>=1.4.0',
179179
'pynose>=1.5.5',
180-
'platformdirs>=4.11.10',
180+
'platformdirs>=4.11.12',
181181
'typing-extensions>=4.16.0',
182182
'sbvirtualdisplay>=1.4.0',
183183
'MarkupSafe>=3.0.3',
184184
'Jinja2>=3.1.6',
185185
'six>=1.17.0',
186-
'parse>=1.22.1',
186+
'parse>=1.22.2',
187187
'parse-type>=0.6.6',
188188
'colorama>=0.4.6',
189189
'psutil>=7.2.2',
@@ -303,7 +303,7 @@
303303
# Required for local MCP server debugging with:
304304
# mcp dev server.py
305305
"uv": [
306-
"uv>=0.12.15"
306+
"uv>=0.12.17"
307307
],
308308
},
309309
packages=[

0 commit comments

Comments
 (0)