MCP Selenium
MCP Selenium Server
A Model Context Protocol (MCP) server for Selenium WebDriver — browser automation for AI agents.

Setup
Paste into your browser address bar:
goose://extension?cmd=npx&arg=-y&arg=%40angiejones%2Fmcp-selenium%40latest&id=selenium-mcp&name=Selenium%20MCP&description=automates%20browser%20interactionsgoose session --with-extension "npx -y @angiejones/mcp-selenium@latest"claude mcp add selenium -- npx -y @angiejones/mcp-selenium@latest{
"mcpServers": {
"selenium": {
"command": "npx",
"args": ["-y", "@angiejones/mcp-selenium@latest"]
}
}
}Example Usage
Tell the AI agent of your choice:
Open Chrome, go to github.com/angiejones, and take a screenshot.
The agent will call Selenium's APIs to start_browser, navigate, and take_screenshot. No manual scripting or explicit directions needed.
Supported Browsers
Chrome, Firefox, Edge, and Safari.
Safari note: Requires macOS. Run
sudo safaridriver --enableonce and enable "Allow Remote Automation" in Safari → Settings → Developer. No headless mode.
start_browser
Launches a browser session.
Parameter | Type | Required | Description |
browser | string | Yes |
|
options | object | No |
|
navigate
Navigates to a URL.
Parameter | Type | Required | Description |
url | string | Yes | URL to navigate to |
interact
Performs a mouse action on an element.
Parameter | Type | Required | Description |
action | string | Yes |
|
by | string | Yes | Locator strategy: |
value | string | Yes | Value for the locator strategy |
timeout | number | No | Max wait in ms (default: 10000) |
send_keys
Types text into an element. Clears the field first.
Parameter | Type | Required | Description |
by | string | Yes | Locator strategy |
value | string | Yes | Locator value |
text | string | Yes | Text to enter |
timeout | number | No | Max wait in ms (default: 10000) |
get_element_text
Gets the text content of an element.
Parameter | Type | Required | Description |
by | string | Yes | Locator strategy |
value | string | Yes | Locator value |
timeout | number | No | Max wait in ms (default: 10000) |
get_element_attribute
Gets an attribute value from an element.
Parameter | Type | Required | Description |
by | string | Yes | Locator strategy |
value | string | Yes | Locator value |
attribute | string | Yes | Attribute name (e.g., |
timeout | number | No | Max wait in ms (default: 10000) |
press_key
Presses a keyboard key.
Parameter | Type | Required | Description |
key | string | Yes | Key to press (e.g., |
upload_file
Uploads a file via a file input element.
Parameter | Type | Required | Description |
by | string | Yes | Locator strategy |
value | string | Yes | Locator value |
filePath | string | Yes | Absolute path to the file |
timeout | number | No | Max wait in ms (default: 10000) |
take_screenshot
Captures a screenshot of the current page.
Parameter | Type | Required | Description |
outputPath | string | No | Save path. If omitted, returns base64 image data. |
close_session
Closes the current browser session. No parameters.
execute_script
Executes JavaScript in the browser. Use for advanced interactions not covered by other tools (e.g., drag and drop, scrolling, reading computed styles, DOM manipulation).
Parameter | Type | Required | Description |
script | string | Yes | JavaScript code to execute |
args | array | No | Arguments accessible via |
window
Manages browser windows and tabs.
Parameter | Type | Required | Description |
action | string | Yes |
|
handle | string | No | Window handle (required for |
frame
Switches focus to a frame or back to the main page.
Parameter | Type | Required | Description |
action | string | Yes |
|
by | string | No | Locator strategy (for |
value | string | No | Locator value (for |
index | number | No | Frame index, 0-based (for |
timeout | number | No | Max wait in ms (default: 10000) |
alert
Handles browser alert, confirm, or prompt dialogs.
Parameter | Type | Required | Description |
action | string | Yes |
|
text | string | No | Text to send (required for |
timeout | number | No | Max wait in ms (default: 5000) |
add_cookie
Adds a cookie. Browser must be on a page from the cookie's domain.
Parameter | Type | Required | Description |
name | string | Yes | Cookie name |
value | string | Yes | Cookie value |
domain | string | No | Cookie domain |
path | string | No | Cookie path |
secure | boolean | No | Secure flag |
httpOnly | boolean | No | HTTP-only flag |
expiry | number | No | Unix timestamp |
get_cookies
Gets cookies. Returns all or a specific one by name.
Parameter | Type | Required | Description |
name | string | No | Cookie name. Omit for all cookies. |
delete_cookie
Deletes cookies. Deletes all or a specific one by name.
Parameter | Type | Required | Description |
name | string | No | Cookie name. Omit to delete all. |
diagnostics
Gets browser diagnostics captured via WebDriver BiDi (auto-enabled when supported).
Parameter | Type | Required | Description |
type | string | Yes |
|
clear | boolean | No | Clear buffer after returning (default: false) |
MCP resources provide read-only data that clients can access without calling a tool.
browser-status://current
Returns the current browser session status (active session ID or "no active session").
Property | Value |
MIME type |
|
Requires browser | No |
accessibility://current
Returns an accessibility tree snapshot of the current page — a compact, structured JSON representation of interactive elements and text content. Much smaller than full HTML. Useful for understanding page layout and finding elements to interact with.
Property | Value |
MIME type |
|
Requires browser | Yes |
Setup
git clone https://github.com/angiejones/mcp-selenium.git
cd mcp-selenium
npm installRun Tests
npm testRequires Chrome + chromedriver on PATH. Tests run headless.
Install via Smithery
npx -y @smithery/cli install @angiejones/mcp-selenium --client claudeInstall globally
npm install -g @angiejones/mcp-selenium
mcp-seleniumLicense
MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/angiejones/mcp-selenium'
If you have feedback or need assistance with the MCP directory API, please join our Discord server