Selenium MCP Server
Allows controlling Mozilla Firefox through Selenium with browser automation tools for navigation, element interaction, screenshots, JavaScript execution, cookies, windows/frames, alerts, and WebDriver BiDi operations.
Allows controlling Google Chrome through Selenium, including navigation, page inspection, element interaction, screenshots, JavaScript execution, cookies, windows/frames, alerts, and WebDriver BiDi operations.
Allows controlling Safari through Selenium with automation for navigation, element interaction, screenshots, JavaScript execution, cookies, windows/frames, alerts, and related browser operations; Safari requires macOS and safaridriver.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Selenium MCP Server
A Model Context Protocol (MCP) server that lets an MCP client control Chrome, Firefox, Edge, or Safari through Selenium.
Browse the documentation website for a more visual guide.
For a step-by-step Claude Desktop setup, see the Claude Desktop tutorial.
Requirements
Python 3.10 or later
For local sessions, one supported browser installed: Google Chrome/Chromium, Mozilla Firefox, Microsoft Edge, or Safari on macOS
Safari automation enabled in Safari's Develop menu on macOS
Selenium Manager network access on first local use to obtain a compatible driver
Related MCP server: monkeysee
Install and run
python -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt
python -m selenium_mcp_serverThe server communicates over standard input/output using MCP stdio transport.
Configure your MCP client to launch python -m selenium_mcp_server from this
repository's directory. The browser starts on the first browser tool call.
Set SELENIUM_HEADLESS=false to show the browser window. Headless mode is enabled
by default for Chrome, Firefox, and Edge. Safari does not support headless mode.
Set SELENIUM_BROWSER to chrome, firefox, edge, or safari to select the
browser; it defaults to chrome. WebDriver setup is handled by Selenium Manager
where supported. Safari requires macOS and Safari's built-in safaridriver.
To connect to Selenium Grid instead of launching a local browser, set
SELENIUM_REMOTE_URL to the Grid WebDriver URL, for example
http://localhost:4444. SELENIUM_BROWSER selects the browser requested from
the Grid, so it must match a browser available on a Grid node. When
SELENIUM_REMOTE_URL is unset or empty, the server uses a local browser.
Tools
Navigation and page inspection:
navigate(url),navigate_history(direction): open a URL or goback,forward, orrefresh.get_current_url(),get_page_title(),get_page_text(),get_page_source(max_chars=20000): inspect the current page. Source output is capped at 100,000 characters.get_accessibility_tree(interesting_only=true): return a readable accessibility snapshot of the current browsing context and reachable child frames.take_screenshot(): return a PNG screenshot.
Elements and interactions:
find_elements(strategy, selector, limit=50): list matching elements and their tag, text, and displayed/enabled/selected state (limit 1–200).find_shadow_element(host_strategy, host_selector, strategy, selector),click_shadow_element(...), andtype_shadow_text(...)locate or interact inside a host element's shadow root.find_relative_elements(strategy, selector, relation, anchor_strategy, anchor_selector, near_distance=50, limit=50): locate elements above, below, left/right of, or near an anchor, including straight-line variants.get_element_attribute(strategy, selector, attribute)andget_element_state(strategy, selector).get_element_accessibility_tree(strategy, selector, interesting_only=true): return an accessibility snapshot of the first matching element's subtree.get_element_property(strategy, selector, name),get_element_css_value(strategy, selector, property_name),get_element_rect(strategy, selector), andtake_element_screenshot(strategy, selector).click_element(strategy, selector),submit_element(strategy, selector),clear_element(strategy, selector), andtype_text(strategy, selector, text, clear=true).press_key(strategy, selector, key): send a supported key such asENTER,TAB,ESCAPE, or an arrow key.select_option(strategy, selector, label|value|index): select one option in a<select>element using exactly one of the three selection criteria.hover_element(strategy, selector),click_action(strategy, selector, action)for double/right-click,drag_and_drop(source_strategy, source_selector, target_strategy, target_selector),scroll_to_element(strategy, selector), andscroll_page(x=0, y=0).wait_for_element(strategy, selector, timeout=10, visible=true): wait for presence or visibility; timeout is limited to 120 seconds.wait_for_title(title, timeout=10)andwait_for_url(url_fragment, timeout=10).execute_async_javascript(script, arguments, timeout=10): execute an async script that calls Selenium's final callback argument; timeout is capped at 120 seconds.get_active_element()andswitch_to_parent_frame().
Browser context and controls:
get_windows(),open_window(window_type=tab, url),switch_window(handle), andclose_window().switch_frame(strategy, selector)andswitch_to_default_content().get_alert_text()andhandle_alert(action, text): inspect or accept/dismiss alerts and enter text in prompts.get_cookies(),add_cookie(cookie), anddelete_cookies(name).set_window_size(width, height),maximize_window(), andfullscreen_window(), plusget_window_position()andset_window_position(x, y).set_timeout(timeout_type, seconds): configureimplicit,page_load, orscripttimeout (0–120 seconds).execute_javascript(script, arguments): execute JavaScript in the current page; arguments must be JSON-serializable.get_bidi_status(),get_bidi_context_tree(max_depth=5),bidi_navigate(context, url),get_bidi_user_contexts(),create_bidi_user_context(), andremove_bidi_user_context(user_context). WebDriver BiDi is requested at session creation; the selected browser and driver must support the specific BiDi command.close_browser(): end the current browser session.
Selenium Grid tools (require SELENIUM_REMOTE_URL):
get_grid_status(),list_grid_nodes(),get_grid_browser_availability(), andlist_grid_sessions()inspect Grid health, nodes, available browser slots, and active sessions.create_grid_session(browser_name, capabilities={})creates a separate Grid session; it is not controlled by the browser interaction tools.delete_grid_session(session_id)ends a Grid session, anddrain_grid_node(node_id)stops a node from accepting new sessions while existing sessions finish.
Supported locator strategies are id, name, css, xpath, tag, class,
link_text, and partial_link_text.
Accessibility snapshots are computed by Selenium from the DOM, not read from the
browser's native accessibility tree. Set interesting_only=false to include all
rendered elements. The text format omits element references, descriptions, and
URLs; use the existing locator-based tools for interactions. Snapshots can include
sensitive page text and form values.
Test
python -m unittest discover -s testsTool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Browser automation MCP for whole web tasks in a cloud browser: saved logins, bot checks, replays.
Hosted real Google Chrome MCP with per-user persistent state. Navigate, click, type, screenshot.
Unofficial Browserless MCP — wraps the Browserless headless-Chromium REST API (browserless.io)
Automate cloud Chrome—navigate, click, type, screenshot, run code, record screen video
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables browser automation using the Selenium WebDriver through MCP, supporting browser management, element location, and both basic and advanced user interactions.431MIT
- AlicenseNot gradedqualityDmaintenanceEnables MCP clients to drive a real, logged-in Chrome browser for web automation tasks like navigation, clicking, typing, and screenshotting.MIT
- FlicenseNot gradedqualityBmaintenanceEnables MCP clients to control a real local browser window for web automation tasks such as clicking, typing, scrolling, and taking screenshots.26 npm-
- AlicenseAqualityDmaintenanceProvides browser automation using Selenium WebDriver, enabling web navigation, element interaction, screenshots, and JavaScript execution via MCP.10ISC