selenium-mcp
by masx200
README.md
# selenium-mcp
A MCP server for selenium
# install
```bash
uv sync
```
# mcp config
```json
{
"mcpServers": {
"selenium": {
"command": "cmd",
"args": ["/c", "uv", "run", "D:/github/selenium-mcp/server.py"],
"env": {}
}
}
}
```
## tools
### start_browser
Start a browser (supports Chrome and Firefox) :param browser: Browser type
("chrome" or "firefox") :param headless: Whether to run in headless mode :param
arguments: Additional startup arguments
### navigate
Navigates the browser to a specified URL. :param url: The URL to navigate to.
### find_element
Finds an element on the page. :param by: Locator strategy to find the element
(e.g., "id", "css", "xpath", etc.). :param value: The value for the locator
strategy. :param timeout: Maximum time to wait for the element in milliseconds
(default: 10000ms).
### click_element
Clicks an element on the page. :param by: Locator strategy (e.g., "id", "css",
"xpath", etc.). :param value: The value for the locator strategy. :param
timeout: Maximum time to wait for the element in milliseconds (default:
10000ms).
### send_keys
Sends keys to an element (typing). :param by: Locator strategy (e.g., "id",
"css", "xpath", etc.). :param value: The value for the locator strategy. :param
text: The text to send to the element. :param timeout: Maximum time to wait for
the element in milliseconds (default: 10000ms).
### get_element_text
Gets the text of an element. :param by: Locator strategy (e.g., "id", "css",
"xpath", etc.). :param value: The value for the locator strategy. :param
timeout: Maximum time to wait for the element in milliseconds (default:
10000ms).
### hover
Hovers over an element. :param by: Locator strategy (e.g., "id", "css", "xpath",
etc.). :param value: The value for the locator strategy. :param timeout: Maximum
time to wait for the element in milliseconds (default: 10000ms).
### drag_and_drop
Drags an element and drops it onto another element. :param by: Locator strategy
for the source element. :param value: The value for the source locator strategy.
:param target_by: Locator strategy for the target element. :param target_value:
The value for the target locator strategy. :param timeout: Maximum time to wait
for the elements in milliseconds (default: 10000ms).
### double_click
Performs a double click on an element. :param by: Locator strategy (e.g., "id",
"css", "xpath", etc.). :param value: The value for the locator strategy. :param
timeout: Maximum time to wait for the element in milliseconds (default:
10000ms).
### right_click
Performs a right click (context click) on an element. :param by: Locator
strategy (e.g., "id", "css", "xpath", etc.). :param value: The value for the
locator strategy. :param timeout: Maximum time to wait for the element in
milliseconds (default: 10000ms).
### press_key
Simulates pressing a keyboard key. :param key: Key to press (e.g., "Enter",
"Tab", "a", etc.).
### upload_file
Uploads a file using a file input element. :param by: Locator strategy (e.g.,
"id", "css", "xpath", etc.). :param value: The value for the locator strategy.
:param file_path: Absolute path to the file to upload. :param timeout: Maximum
time to wait for the element in milliseconds (default: 10000ms).
### take_screenshot
Captures a screenshot of the current page. :param output_path: Optional path
where to save the screenshot. If not provided, returns base64 data.
### close_session
Closes the current browser session.
This server cannot be deployed
Maintenance
ActivityInactive
ResponsivenessNo issues