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
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.8dev0"
version = "1.3.9dev0"
description = "MCP server exposing SeleniumBase CDP Mode as tools for MCP clients."
readme = "README.md"
requires-python = ">=3.10"
Expand Down
59 changes: 29 additions & 30 deletions mcp_servers/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,7 @@ def get_attributes(

Args:
selector: CSS selector or SeleniumBase-supported XPath selector.
If multiple elements match, then only the first one is used.

attribute: Specific HTML attribute to retrieve. When omitted, returns
all HTML attributes of the matching element as a dictionary.
Expand Down Expand Up @@ -1057,6 +1058,8 @@ def select_option(
) -> str:
"""Select an option from an HTML <select> dropdown.

Changing a dropdown selection can trigger additional events on a page.

Args:
dropdown_selector: CSS selector identifying the <select> element.

Expand Down Expand Up @@ -1445,8 +1448,11 @@ def manage_cookies(
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.
dependent on other browser state.

When not to use:
- Do not use this tool to load cookies if the cookie origin does
not match the origin of the current page.
"""
sb = _get_sb()

Expand Down Expand Up @@ -1800,45 +1806,38 @@ def manage_tabs(
annotations=ToolAnnotations(
read_only_hint=False,
destructive_hint=False,
idempotent_hint=False, # A 2nd attempt on an already-handled or
# rotated CAPTCHA widget isn't guaranteed to be a no-op.
idempotent_hint=False, # Re-attempting an already-handled or
# rotated CAPTCHA is not a no-op.
open_world_hint=True, # Interacts with a 3rd-party CAPTCHA widget.
),
)
@handle_sb_errors
def solve_captcha() -> str:
"""Perform a SeleniumBase CDP-based CAPTCHA interaction, such as clicking
a CAPTCHA checkbox, or performing a drag/drop action on a slider CAPTCHA.
"""Attempts a SeleniumBase CDP interaction (click or drag/drop) to solve
detectable CAPTCHAs on the current page.

Supported CAPTCHAs include: Cloudflare Turnstile, reCAPTCHA, hCaptcha,
DataDome Slider, and FriendlyCaptcha.
Supported CAPTCHAs:
- CF Turnstile, reCAPTCHA, hCaptcha, DataDome Slider, FriendlyCaptcha

This tool automatically detects the location of CAPTCHA checkboxes
for the click action. If none of the supported CAPTCHAs are detected
on the current page, then no click action is attempted.
Tool workflow:
1. Inspect page structure (e.g., via `get_content`) to verify that a
CAPTCHA is present.
2. Call `solve_captcha` if there's a CAPTCHA. (No-op if no CAPTCHA.)
3. Verify success via `get_page_info`, `get_content`, or `manage_cookies`.

The tool does not guarantee that the CAPTCHA gets solved. Some CAPTCHA
controls are embedded inside shadow DOM or otherwise do not expose an
easy success signal. A successful attempt may result in changes to page
state or browser cookies.
Notes:
This tool does not guarantee that the CAPTCHA gets solved.
A successful attempt may result in changes to page state and cookies.

Tool workflow:
1. Inspect the webpage with get_content when you need to
determine whether CAPTCHA-related controls are present.
2. Call 'solve_captcha' to attempt the CAPTCHA interaction.
3. Use 'get_page_info', 'get_content', 'check_if_condition', or
'manage_cookies' to inspect the resulting page/session state
to determine whether the interaction appears to have succeeded.
Tool Selection:
- Use `solve_captcha` specifically for automated CAPTCHA widget
interactions.
- Use `click_element` for standard visible elements.
- Use `hover_action` (action="hover_and_click") to reveal and
click targets.

Returns:
A message indicating that the CAPTCHA interaction was attempted.

Tool selection:
- Need to interact with one of the supported CAPTCHAs ->
use solve_captcha.
- Need to hover an element in order to click another ->
use hover_action with action="hover_and_click".
- Need to click a specific visible element -> use click_element.
A confirmation message indicating that the attempt was initiated.
"""
sb = _get_sb()
sb.solve_captcha()
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ 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>=3.32.7
filelock>=4.0.0
fasteners>=0.20
mycdp>=1.4.0
pynose>=1.5.5
Expand All @@ -26,7 +26,7 @@ pygments>=2.20.1
pyreadline3>=3.5.4;platform_system=="Windows"
tabcompleter>=1.4.1
pdbp>=1.8.3
idna>=3.19
idna>=3.20
charset-normalizer>=3.5.1,<4
urllib3>=2.8.0,<3
requests~=2.34.2
Expand All @@ -49,7 +49,7 @@ pytest-html==4.0.2
pytest-metadata==3.1.1
pytest-ordering==0.6
pytest-rerunfailures==16.3;python_version=="3.10"
pytest-rerunfailures==16.6.1;python_version>="3.11"
pytest-rerunfailures==16.7;python_version>="3.11"
pytest-xdist==3.8.0
parameterized==0.9.0
behave==1.2.6
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.8"
__version__ = "4.54.9"
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.8",
"version": "4.54.9",
"repository": {
"url": "https://github.com/seleniumbase/SeleniumBase",
"source": "github"
Expand All @@ -13,7 +13,7 @@
{
"registryType": "pypi",
"identifier": "seleniumbase",
"version": "4.54.8",
"version": "4.54.9",
"transport": {
"type": "stdio"
},
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
'exceptiongroup>=1.3.1',
'websockets~=16.1.1;python_version=="3.10"',
'websockets>=16.1.1;python_version>="3.11"',
'filelock>=3.32.7',
'filelock>=4.0.0',
'fasteners>=0.20',
'mycdp>=1.4.0',
'pynose>=1.5.5',
Expand All @@ -192,7 +192,7 @@
'pyreadline3>=3.5.4;platform_system=="Windows"',
'tabcompleter>=1.4.1',
'pdbp>=1.8.3',
'idna>=3.19',
'idna>=3.20',
'charset-normalizer>=3.5.1,<4',
'urllib3>=2.8.0,<3',
'requests~=2.34.2',
Expand All @@ -215,7 +215,7 @@
'pytest-metadata==3.1.1',
'pytest-ordering==0.6',
'pytest-rerunfailures==16.3;python_version=="3.10"',
'pytest-rerunfailures==16.6.1;python_version>="3.11"',
'pytest-rerunfailures==16.7;python_version>="3.11"',
'pytest-xdist==3.8.0',
'parameterized==0.9.0',
'behave==1.2.6', # Newer ones had issues
Expand Down