Selenium WebDriver Model Context Protocol (MCP) server enabling AI agents and LLMs to control browsers
Server has 20 tools with consistent naming (verb_noun pattern) and reasonable descriptions. All tools have input schemas with type definitions and parameter descriptions. However, output schemas are not documented in the visible code, and error handling lacks recovery guidance. Descriptions average ~150 chars, which is acceptable but could be more concise. No tool annotations (readOnlyHint/destructiveHint) present. Session-based architecture is sound but not explicitly documented in tool descriptions.
Click an interactive element on the current webpage using its index. Purpose ------- This tool allows the agent to click buttons, links, or other interactive UI elements on the page. The element must first be discovered using `get_interactive_elements`, which returns a list of visible elements and assigns each one an index. The index returned by `get_interactive_elements` must be used with this tool to select the correct element.
Close the browser session and free its resources.
Switch the browser to fullscreen mode.
Retrieve a simplified accessibility tree of the current page. Purpose ------- Returns interactive elements with semantic roles so AI agents can understand UI meaning (buttons, links, inputs, dropdowns). Returned `index` values map directly to `click_element`.
Retrieve the currently active browser tab. Purpose ------- Allows the agent to confirm which tab is currently active without listing all tabs.
Output schemas not documented. Tools return dicts with status/message fields, but LLMs cannot plan downstream calls without knowing exact response structure. E.g., open_browser returns session_id, but this is not formally documented in schema.
Minimal descriptions on navigation and window control tools. open_url, navigate_back, navigate_forward, refresh_page, get_page_title have descriptions under 60 chars, providing insufficient context for LLM selection.
No tool annotations (readOnlyHint, destructiveHint, idempotentHint). LLMs cannot distinguish safe read-only tools from destructive ones without explicit hints. E.g., close_browser is destructive but unmarked.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | D | 55 | <=2025-11-25 | v2 |
Retrieve visible interactive elements from the current web page. Purpose ------- This tool scans the page for interactive elements using a performance-optimized selector that works across modern web applications (React, Angular, dynamic UIs). It identifies elements based on interaction signals such as: - semantic HTML tags (button, input, link) - ARIA roles (button, link, tab, option) - click handlers (onclick) - focusable elements (tabindex) The discovered elements are returned with an assigned `index`. This index must be used when interacting with elements using tools such as: - click_element - type_into_element The function also stores the discovered Selenium elements in an internal session cache so that subsequent tools can safely interact with the exact same elements without re-querying the DOM.
Retrieve visible text from the page body. Purpose ------- Provides page text for reasoning, validation, or extraction. Text is truncated to `max_chars` characters; check the returned `truncated` flag to know whether content was cut.
Retrieve the title of the current web page.
Retrieve all open browser tabs for the current session. Purpose ------- Provides visibility into all tabs so the agent can decide which tab to switch to. Each tab is identified by an index and optional name.
Maximize the browser window.
Navigate back one step in browser history.
Navigate forward in browser history.
Launch a new browser session. Purpose ------- Creates a Selenium WebDriver instance and registers it in the MCP session store. The returned `session_id` must be passed to all subsequent browser tool calls. Typical Agent Workflow ---------------------- 1. open_browser 2. open_url 3. wait_for_page 4. interact with elements
Open a new browser tab and optionally navigate to a URL. Purpose ------- Creates a new tab within the current browser session. The newly opened tab becomes the active tab.
Navigate the browser to a specific URL.
Reload the current web page.
Switch to a specific browser tab using its index. Purpose ------- Allows the agent to move between multiple open tabs in the same browser session. Always call `get_tabs` first to understand available tab indexes.
Capture a screenshot of the current browser window. Purpose ------- Useful for debugging, failure reporting, or visual analysis. Screenshots are saved to the directory set by the MCP_SCREENSHOT_DIR environment variable (default: system temp dir).
Enter text into an input field or textarea using an element index. Purpose ------- This tool allows the agent to type text into editable elements such as input fields or textareas. The element must first be discovered using `get_interactive_elements`, which returns a list of visible UI elements along with their corresponding indexes. The index returned by `get_interactive_elements` should be used directly with this tool to identify which element to type into.
Wait until the page body element is present in the DOM. Purpose ------- Call after `open_url` or any navigation to give the page time to load before attempting interactions.
Error handling lacks recovery guidance. Exceptions are caught and logged, but responses return generic 'failure' status with minimal context. No guidance on retryability, user-fixable errors, or next steps.
Session ID dependency not documented in tool descriptions. All tools require session_id, but descriptions do not explain that open_browser must be called first or what happens if session_id is invalid.