The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Selenium MCP Server listing page.
A Model Context Protocol (MCP) server that provides web automation capabilities through Selenium WebDriver. This server allows AI assistants to interact with web pages by providing tools for navigation, element interaction, taking screenshots, and more.
The default compact profile is documented in Compact Profile (Default).
The explicit --tool-profile legacy compatibility fallback provides the following 24
tools with their original names and call contracts.
navigate(url, timeout) - Navigate to a specified URL with Chrome browsercheck_page_ready(wait_seconds) - Check if the current page is fully loaded with optional waitlist_tabs() - List all browser tabs and identify the active tabopen_tab(url=None) - Open a new tab and optionally navigate it to a URLswitch_tab(handle) - Switch to a tab using a handle returned by list_tabsclose_tab(handle=None) - Close a specific tab, or the active tab when no handle is providedtake_screenshot(file_name, directory="tmp/selenium-screenshot") - Take a screenshot of the active tab. A descriptive file_name is required; .png is added when omitted. When the Agent knows its current workspace path, it should prefer an absolute directory inside that workspace so the destination does not depend on the MCP server cwd. Otherwise, omit directory to use the configured workspace default. Existing files receive a numeric suffix instead of being overwritten.record_video(action, file_name="", directory="tmp/selenium-video", include_address=false, window_handle="", max_duration_seconds=600, window_handles=[]) - start records one fixed window_handle, one MP4 following switches among 2-4 window_handles, or the active tab when both are omitted. The selectors are mutually exclusive. Always call stop immediately after the final browser action; the finite deadline auto-finalizes only as a fallback. Paths follow screenshot rules and include_address=true adds a synthetic URL header.get_an_element(text, class_name, id, attributes, element_type, in_iframe_id, in_iframe_name, return_html, xpath) - Get an element identified by various criteriaget_elements(text, class_name, id, attributes, element_type, in_iframe_id, in_iframe_name, page, page_size, return_html, xpath) - Get multiple elements with pagination supportget_direct_children(text, class_name, id, attributes, element_type, in_iframe_id, in_iframe_name, return_html, xpath, page, page_size) - Get all direct child nodes of an element with paginationclick_to_element(text, class_name, id, attributes, element_type, in_iframe_id, in_iframe_name, element_index, xpath) - Click on an element identified by various criteriaset_value_to_input_element(text, class_name, id, attributes, element_type, input_value, in_iframe_id, in_iframe_name, xpath) - Set a value to an input elementget_style_an_element(text, class_name, id, attributes, element_type, in_iframe_id, in_iframe_name, return_html, xpath, all_styles, computed_style) - Get style information for an elementrun_javascript_in_console(javascript_code) - Execute JavaScript without intentionally reading buffered console logsrun_javascript_and_get_console_output(javascript_code) - Drain old console logs, execute JavaScript, then return its value and newly captured console outputget_console_logs(log_level) - Read and consume browser console logs with optional level filteringget_network_logs(filter_url_by_text, only_errors_log) - Read and consume performance logs as network events with optional filteringget_response(request_id) - Retrieve a response body using a request ID from get_network_logslocal_storage_add(key, string_value, object_value, create_empty_string, create_empty_object) - Add or update a key-value pair in browser's local storagelocal_storage_read(key) - Read a value from browser's local storage by keylocal_storage_read_all() - Read all key-value pairs from browser's local storagelocal_storage_remove(key) - Remove a key-value pair from browser's local storagelocal_storage_remove_all() - Remove all key-value pairs from browser's local storageThe compact profile is the default and exposes the same browser capabilities through 11
tools and a smaller tools/list payload. It remains under evaluation; use
--tool-profile legacy when an existing client still depends on the original 24 names.
Legacy removal, if ever planned, will be announced as a separate breaking lifecycle
change. Legacy names are not advertised as compact aliases because aliases would keep
their schemas in Agent context.
Start it with:
All compact calls share one browser session and global active tab. A reliable default workflow is:
Use only fields relevant to an action. The 24 legacy names map to compact as follows:
| Legacy tool | Compact call |
|---|---|
navigate(url, timeout) | navigate(url, wait_until="complete", timeout=timeout) |
list_tabs() | tabs(action="list") |
open_tab(url) | tabs(action="open", url=url) |
switch_tab(handle) | tabs(action="switch", handle=handle) |
close_tab(handle) | tabs(action="close", handle=handle) |
take_screenshot(file_name, directory) | take_screenshot(file_name, directory, mode="viewport") |
record_video(action, file_name, directory, include_address, window_handle, max_duration_seconds, window_handles) | Same record_video(...) contract in both profiles |
check_page_ready(wait_seconds) | wait_for(condition="ready", state="complete") |
get_console_logs(log_level) | browser_logs(action="console", log_level=log_level) |
get_network_logs(filter_url_by_text, only_errors_log) | browser_logs(action="network", filter_url_by_text=..., only_errors_log=...) |
get_response(request_id) | browser_logs(action="response", request_id=request_id) |
local_storage_add(...) | local_storage(action="add", key=..., string_value=... or object_value=...) |
local_storage_read(key) | local_storage(action="read", key=key) |
local_storage_remove(key) | local_storage(action="remove", key=key) |
local_storage_read_all() | local_storage(action="read_all") |
local_storage_remove_all() | local_storage(action="remove_all") |
get_an_element(...) | query_elements(action="one", selector=...) |
get_elements(...) | query_elements(action="many", selector=...) |
get_direct_children(...) | query_elements(action="children", selector=...) |
click_to_element(...) | Query, then interact_element(action="click", element_ref=...) |
set_value_to_input_element(...) | Query, then interact_element(action="set_value", element_ref=..., input_value=...) |
run_javascript_in_console(javascript_code) | run_javascript(javascript_code) |
run_javascript_and_get_console_output(javascript_code) | run_javascript(javascript_code, capture_console=true) |
get_style_an_element(...) | Query, then get_element_style(element_ref=...) |
Each line is one JSON arguments object for the workflow step in the same order:
tabs(action="list") also reports the active handle, URL/title/readyState of every
tab, Chrome and ChromeDriver versions, and the absolute download directory. open
activates its new tab; switch requires a listed handle; close accepts a handle or the
active tab but never the final tab. Serialize tab-sensitive calls.
query_elements and element/text wait_for accept one discriminated selector:
Fields combine with AND; role and accessible_name use Selenium's computed
accessibility values. frame tries iframe ID, then name. For ordered nested traversal,
use up to eight options.scope steps; frame steps support CSS/ID/name and shadow steps
enter open shadow roots:
XPath is supported in documents/frames; use CSS or fields inside shadow roots. Query
pages are 1-based;
the default sizes are 3 for many and 5 for children, with a maximum of 50. one
requires exactly one match and children exactly one parent. Every result element has an
opaque element_ref. Queries include hidden DOM matches and report visible separately.
Refs store locator specifications, not WebElements, and re-resolve after same-document
rerenders while the exact locator still matches one element. They expire after 1,800
seconds and become invalid after a tab/document change, full navigation, or a zero/multiple
current match; query again in those cases.
wait_for.condition supports:
| Condition | Required/action fields |
|---|---|
ready | `state="interactive |
url | value, optional `match="contains |
element | selector, `state="present |
text | value, optional selector, `state="present |
network_idle | optional quiet_ms; options.ignore_url_regexes excludes known polling routes |
network_response | options.cursor, route filters, and optional dotted-path json_predicate |
all, any | options.conditions, 1-10 bounded nested clauses with one shared deadline |
For a selector-free text wait, the observed value is the complete
document.body.innerText. With a selector, it is every matched element's .text joined
with newline characters. Therefore match="equals" compares that entire exact string,
including browser-produced whitespace and newlines; use contains for a fragment.
Network-response waits peek without consuming diagnostic events. Take a baseline
latest_cursor from browser_logs, trigger the request, then wait after that cursor:
network_idle ignores long-lived EventSource/WebSocket requests but normal polling creates
fresh finite requests; declare only known polling routes in ignore_url_regexes or prefer
network_response. timeout is the deadline for the complete tool call/composed wait,
not for each poll or clause. timeout and poll_interval are seconds; quiet_ms is
milliseconds. Success and
timeout responses include elapsed time, URL, ready state, and the last observation.
navigate.wait_until accepts initiated, interactive, complete, or network_idle;
completed policies return the final URL after redirects, while initiated explicitly
reports that navigation remains pending.
All actions except viewport/nested scroll require element_ref. Action-specific fields are:
| Action | Additional fields |
|---|---|
inspect | none; returns CSS/geometry/hit-test/blocker/inert/animation/scroll-ancestor diagnostics |
click | optional `options.click_mode="native |
clear, hover, scroll_into_view | none |
type, set_value | input_value; options for target/input mode, clear, synthetic paste input type, verification |
press_key | key, for example ENTER, TAB, or ARROW_DOWN |
select_option | `option_by="value |
upload_file | existing absolute or workspace-relative file_path |
scroll | optional container ref; direction/amount/start/end, until_visible, nested sweep and step budget in options |
Click defaults to WebDriver native click. It re-resolves the ref, centers it, waits for a
stable actionable hit-test, and retries stale/intercepted/temporarily non-interactable
states within the one overall timeout. Failure reports the covering element and reasons
such as hidden, offscreen, inert, animation, or pointer-events:none. Actions/offset and
DOM JavaScript click are explicit choices; JavaScript is never a silent fallback.
type appends by default and set_value replaces. target_kind="auto|form_control|contenteditable"
and input_mode="auto|keyboard|dom" support inputs, textareas, and ProseMirror-style
contenteditable roots. DOM rich-text insertion dispatches cancelable beforeinput, then
input/change; input_type="insertFromPaste" supplies synthetic paste semantics without
reading or changing the system clipboard. Verification is on by default and compares
.value or rendered editor text; a mismatch returns input_postcondition_failed.
ok=true means the requested browser command completed and any declared postcondition
passed. It does not assert application intent. execution reports the actual strategy and
reported events; observed separately reports URL, target state, focus/selection, bounded
DOM mutations, effect_observed, and always application_outcome="not_asserted".
scroll is server-controlled rather than a long-running page loop. It can operate on one
container ref or scan bounded nested containers, stop when a selector/ref is truly visible
by viewport hit-test, and use direction="both" for a down-then-up sweep.
get_element_style(element_ref, ...) requires one ref. return_html=true returns only
bounded inner/outer HTML and overrides the style flags. Otherwise all_styles and
computed_style independently add their bounded sections; both false returns element
metadata only.
Screenshots use mode="viewport|full_page|element"; element mode requires a ref. Names
are safe PNG basenames and collisions get numeric suffixes. Directories may be absolute
or workspace-relative without traversal. Chrome downloads default to
<workspace>/tmp/selenium-downloads; configure them with --download_dir.
Video recording is stateful: call record_video(action="start", file_name=..., directory=..., include_address=..., window_handle=..., max_duration_seconds=..., window_handles=...),
continue interacting with the browser, then always call stop once immediately after the
final browser action. Pass window_handle for one exact fixed tab, or window_handles for
2-4 unique handles returned by tabs(action="list")/list_tabs(); the active handle at
start must be included in that list. The multi-tab mode publishes one MP4 and changes its
visible source whenever tabs(action="switch") or switch_tab() activates another selected
handle. These arguments are mutually exclusive; omit both to record the current tab. Stop
before closing any selected tab or shutting down the session. Only one recording may run
per server process. Names are safe MP4 basenames, the default directory is
<workspace>/tmp/selenium-video, collisions get numeric suffixes, and incomplete files
are never published.
max_duration_seconds defaults to 600 and must be 0.1-86,400. It is a forgotten-cleanup
fallback, not a replacement for stop: the server auto-finalizes at the deadline. start
returns cleanup_required and deadline_at; status adds elapsed/remaining time; the
final result records stop_reason as manual, deadline, or server shutdown.
For a multi-tab start, all selected targets provide frames to one live encoder, but only the
logically active selected tab is written to the timeline. For example, a flow that switches
A → B → A produces one checkout.mp4 showing those same scenes in order. Use the server's
tab tools for switching so the recorder receives the transition; activating a tab outside
window_handles freezes the video on the last selected tab until the flow returns. The
multi-tab mode requires ffmpeg; combined mosaic output is not supported.
include_address=false records tab content only. include_address=true uses ffmpeg to
add a synthetic header containing the visible top-level URL; in follow-active mode the
header updates with selected-tab switches and top-level navigations. It does not capture
Chrome's real toolbar or omnibox. The native Chrome recording command is experimental and
recent; older builds automatically use a tab-bound screencast/ffmpeg fallback.
unsupported_browser is returned only when neither transport is available. The URL-header
mode and the compatibility fallback require ffmpeg on PATH.
Combined multi-tab and address-header flow in the compact profile:
This produces one checkout-flow.mp4 whose timeline and synthetic URL header both follow
A → B → A. Perform the browser interactions for each tab between its switch and the next
switch, and call stop immediately after the final interaction.
Console/network log calls accept mode="peek|consume", cursor, limit (1-100), and
since_timestamp (epoch milliseconds). peek preserves returned entries; consume
removes them. Continue with next_cursor. Buffers and cursors are browser-session local
and bounded. Console levels are blank/ALL, DEBUG, INFO, WARNING, ERROR, or
SEVERE (ERROR aliases Chrome SEVERE). Network filters support URL regex, HTTP
method, resource type, request ID, and status in addition to legacy URL-text/error filters.
Correlated metadata lets response/finished events filter on original request properties.
Redaction is on by default for credentials, sensitive query values, and request
body/header text; redact=false is an explicit sensitive-data opt-in.
Response bodies can expire or be evicted from Chrome's CDP buffer; error envelopes give a stable reason code and retry hint. Bodies themselves may contain sensitive data.
run_javascript awaits Promises and returns bounded typed values for undefined, null,
primitives, DOM elements, arrays/objects, circular/max-depth values, and exceptions.
capture_console=false never reads logs. true returns only newly generated entries and
keeps older entries in the broker. Example:
Storage add requires key plus a value or explicit empty-value flag; object mode wins
over string mode. read/remove require key; read_all/remove_all need no extra
field. localStorage is scoped to the active page origin.
Treat screenshots, videos, visible URLs, uploads, downloads, response bodies, raw logs, tabs, and localStorage
as potentially sensitive. They can contain credentials, PHI, or data from another origin
in the shared session. Use explicit artifact paths and redact=false only when authorized.
Each line below is one complete JSON arguments object for the named tool. Replace handle, reference, request-ID, path, URL, and expected-text placeholders with observed values.
tabsnavigatewait_forquery_elementsinteract_elementtake_screenshotrecord_videobrowser_logslocal_storageget_element_stylerun_javascriptffmpeg on PATH for include_address=true and for Chrome builds that need the screencast compatibility fallbackYou can use this MCP server in two ways:
Install directly from PyPI:
Or using uv:
Or using pip with virtual environment:
The MCP server can work with Chrome in two ways:
After installing via pip/uv, you can run the server directly:
When running from source, ensure the Python path includes the src directory:
For development and testing, you can use the MCP inspector:
From Source Code:
From Installed Package:
Open your browser and navigate to: http://127.0.0.1:6274/#tools

Check logs:
--port: Chrome remote debugging port (default: 9222)--user_data_dir: Chrome user data directory (default: auto-generated in /tmp)--workspace_root: Base directory for relative screenshot/video directories (default: the server startup directory). Absolute artifact directories do not use it.--tool-profile: Agent-visible tool surface: compact (default) or legacy compatibility fallback--download_dir: Chrome download directory; defaults to <workspace_root>/tmp/selenium-downloads-v, --verbose: Increase verbosity (use multiple times for more details)The server communicates via stdio and follows the Model Context Protocol specification. You can integrate it with MCP-compatible AI assistants or clients.
For Claude Desktop (claude_desktop_config.json):
Using installed package:
For VS Code Copilot (.vscode/mcp.json):
Using installed package:
Using source code directly:
Alternative source code configuration using full path:
Omit --tool-profile to use the default compact surface. Add "--tool-profile", "legacy" to a client's server args only when it requires the original 24 tool names.
VS Code Copilot MCP Status:
If you open the .vscode/mcp.json file, you can see the MCP server status at the bottom of VS Code.

View MCP Logs:
tail -f /tmp/selenium-mcp.logNavigate to a website:
navigatehttps://example.comTake a screenshot:
take_screenshotexample-home<absolute-workspace-path>/tmp/selenium-screenshot; omit it when the workspace path is unavailable<absolute-workspace-path>/tmp/selenium-screenshot/example-home.pngFill a form:
set_value_to_input_elementxpath="//*[@id='email']", input_value="user@example.com"Click a button:
click_to_elementxpath="//button[@type='submit']"Execute JavaScript:
run_javascript_in_consolereturn document.title;JavaScript with console output:
run_javascript_and_get_console_outputconsole.log('Hello from browser'); return window.location.href;check_page_ready; query the target again when dynamic content is expectedrun_javascript_in_console with explicit return expressionsget_an_element, get_elements, or get_style_an_elementrun_javascript_in_console for complex DOM manipulation and data extractionrun_javascript_and_get_console_output to capture console logs for debuggingExtract page data:
Page performance monitoring:
Form automation:
The server logs all operations to /tmp/selenium-mcp.log with rotation. Use the -v flag to increase console verbosity:
-v: INFO level logging-vv: DEBUG level loggingPackage not found (installed package):
Module not found (source code):
--port optionMCP Client Connection Problems:
which python to find Python executable)Run the focused tests without starting Chrome:
Run the MCP stdio end-to-end test, which starts the real server and Chrome with an isolated temporary profile:
For issues and questions:
/tmp/selenium-mcp.logSee Available Tools, including the complete compact migration table, and Examples.