Selenium MCP Server
Supports Firefox browser automation through Selenium WebDriver, enabling automated testing and interaction.
Provides browser automation tools for navigation, interaction, screenshots, assertions, cookies, tabs, HTTP API, recording, batch execution, iframes, and raw WebDriver access using Selenium WebDriver.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Selenium MCP ServerGo to example.com and take a screenshot"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
π Selenium MCP Server
Model Context Protocol server for browser automation using Selenium WebDriver.
66 tools for navigation, interaction, screenshots, assertions, cookies, tabs, HTTP API, recording, batch execution, iframes, and raw WebDriver access β all with strict hexagonal architecture.
Why this MCP?
Most Selenium MCPs expose basic WebDriver commands. This one adds the layers that make AI agents truly reliable:
Feature | Status |
Page snapshot with stable element refs ( | β |
Persistent per-domain selector hints | β |
HTTP API tools (GET/POST/PUT/PATCH/DELETE) | β |
Batch multi-step execution (up to 20 steps in 1 call) | β |
Built-in test assertions | β |
Raw WebDriver API access ( | β |
Recording for test generation | β |
Dialog handling (alert/confirm/prompt) | β |
Cookie management | β |
Stealth mode | β |
Strict hexagonal architecture (Domain/Ports/Adapters) | β |
Session tracing (NDJSON) | β |
Selenium Manager auto-provisioning | β |
Related MCP server: Selenium MCP Server
Quick Start
One-click install
From npm
npm install -g mcp-selenium-webdriverOr run directly:
npx mcp-selenium-webdriverPrerequisites
Node.js 18+
Chrome, Firefox, or Edge installed
Selenium Manager provisions the matching driver automatically β no manual setup needed.
# Verify everything is ready
npx mcp-selenium-webdriver doctorMCP Client Configuration
VS Code Copilot (.vscode/mcp.json):
{
"servers": {
"selenium-mcp": {
"command": "npx",
"args": ["mcp-selenium-webdriver"],
"type": "stdio"
}
}
}Claude Desktop:
{
"mcpServers": {
"selenium-mcp": {
"command": "npx",
"args": ["mcp-selenium-webdriver"]
}
}
}Cursor (.cursor/mcp.json):
{
"mcpServers": {
"selenium-mcp": {
"command": "npx",
"args": ["mcp-selenium-webdriver"]
}
}
}Environment Variables
Variable | Default | Description |
|
| Browser: |
|
| Run browser in headless mode |
|
| Hide automation indicators |
| β | Selenium Grid hub URL |
|
| Output: |
| auto | Custom output directory |
|
| Save session trace as NDJSON |
|
| Bypass workspace sandbox |
| β | Corporate proxy |
Pass them in your MCP config:
{
"mcpServers": {
"selenium-mcp": {
"command": "npx",
"args": ["mcp-selenium-webdriver"],
"env": {
"SELENIUM_HEADLESS": "true",
"SELENIUM_STEALTH": "true"
}
}
}
}CLI Flags
npx mcp-selenium-webdriver [flags]
npx mcp-selenium-webdriver doctor # preflight diagnosticsFlag | Description |
| Run diagnostics (Chrome, driver, proxy, cache) and exit |
| Run browser headless |
| Enable stealth mode |
| Save session trace JSON |
| Set output mode |
| Custom output directory |
| Selenium Grid hub URL |
| Bypass workspace sandbox |
Tools (66)
π§ Navigation (7)
Tool | Description |
| Navigate to a URL. Starts browser automatically. |
| Navigate back in history. |
| Navigate forward in history. |
| Refresh the current page. |
| Scroll the page or element into view. |
| Get the current URL. Read-only. |
| Get the page title. Read-only. |
πΈ Page Analysis (5)
Tool | Description |
| Capture page state as element list with stable refs (e1-e300). Read-only. |
| Get the full HTML DOM. Read-only. |
| Get visible text, optionally scoped to a CSS selector. Read-only. |
| Get visible HTML (scripts removed by default). Read-only. |
| Take a screenshot (viewport, full-page, or element). |
π±οΈ Elements (9)
Tool | Description |
| Click an element by CSS selector or ref. |
| Hover over an element. |
| Double-click an element. |
| Right-click (context menu) an element. |
| Select a dropdown option by value, text, or index. |
| Drag one element to another. |
| Teach a preferred CSS selector for a domain. |
| Click an element inside an iframe. |
| Fill an input inside an iframe. |
β¨οΈ Input (3)
Tool | Description |
| Type text into an input field. |
| Press a keyboard key, optionally with modifiers (ctrl, alt, shift, meta). |
| Upload a file through a file input. |
π²οΈ Mouse (3)
Tool | Description |
| Move mouse to coordinates. |
| Click at coordinates (left, right, middle). |
| Drag from one position to another. |
π Tabs (4)
Tool | Description |
| List all open tabs. Read-only. |
| Switch to a specific tab. |
| Open a new tab. |
| Close a tab. |
β Verification (4)
Tool | Description |
| Verify an element is visible. Read-only. |
| Verify text is visible. Read-only. |
| Verify an input has the expected value. Read-only. |
| Verify multiple texts are visible. Read-only. |
π Browser Control (7)
Tool | Description |
| Wait for a condition (element visible, URL, title...). |
| Run JavaScript in the browser context. |
| Resize the browser window. |
| Handle dialogs (alert, confirm, prompt). |
| Get browser console logs with filtering. Read-only. |
| Monitor network requests / toggle offline mode. |
| Generate a PDF from the current page. Read-only. |
π Browser Lifecycle (5)
Tool | Description |
| Start the browser explicitly with options. |
| Close the browser and end the session. |
| Reset the session (close + restart). |
| Enable/disable stealth mode. |
| Get session status (URL, title, state). Read-only. |
πͺ Cookies (3)
Tool | Description |
| Get all cookies. Read-only. |
| Add a cookie. |
| Delete a cookie by name. |
βΊοΈ Recording (4)
Tool | Description |
| Start recording actions for test generation. |
| Stop recording and return the action log. |
| Check recording status. Read-only. |
| Clear all recorded actions. |
πΎ Selector Hints (4)
Tool | Description |
| Save a preferred CSS selector for a domain. |
| Get saved hints for a domain. Read-only. |
| List domains with hints. Read-only. |
| Delete a hint. |
π HTTP API (5)
Tool | Description |
| HTTP GET request. Read-only. |
| HTTP POST request with body. |
| HTTP PUT request. |
| HTTP PATCH request. |
| HTTP DELETE request. |
β‘ Power Tools (3)
Tool | Description |
| Execute up to 20 tool steps in a single call. |
| Execute raw Selenium WebDriver API code (access to |
| Generate a robust locator for an element by description. Read-only. |
Architecture
Hexagonal architecture (Ports & Adapters):
src/
βββ domain/
β βββ models/ Pure types & value objects
β βββ ports/ 18 interfaces (IBrowserPort, INavigationPort...)
β βββ services/ 16 use cases
βββ adapters/
β βββ selenium/ 14 Selenium WebDriver implementations
β βββ mcp/ MCP SDK server & tool registry
β βββ persistence/ File system & selector hints storage
β βββ logging/ Console & trace (NDJSON) loggers
βββ infrastructure/ DI container (tsyringe), bootstrap, config
βββ index.ts Entry point
βββ cli.ts CLI (doctor, flags)Key design decisions:
Dependency Injection via
tsyringewithSymboltokens β every port is swappableZod would be used for runtime validation (planned)
Selenium Manager auto-provisions chromedriver matching your installed Chrome version
16-phase selector engine for
capture_page(ID β testId β role β label β ... β positional index)Stealth mode injects scripts to hide
navigator.webdriverand automation indicators
Example Usage
Ask your AI agent:
Navigate to https://example.com, capture the page, click the first link, take a screenshot, verify "Example Domain" is visible.
The agent chains the tools automatically:
navigate_to β capture_page β click_element β take_screenshot β verify_text_visibleOr use raw WebDriver API:
run_selenium with:
const el = await driver.findElement(By.css('h1'));
const text = await el.getText();
return text;Batch execution:
batch_execute with:
steps: [
{ tool: "navigate_to", args: { url: "https://example.com" } },
{ tool: "take_screenshot", args: { name: "before" } },
{ tool: "click_element", args: { selector: "a" } },
{ tool: "take_screenshot", args: { name: "after" } }
]Development
git clone <this-repo>
cd mcp-selenium-webdriver
npm install
npm run build
npm run doctorScripts
npm run build # Compile TypeScript
npm run dev # Run with tsx (hot reload)
npm run typecheck # Type-check without emitting
npm test # Run all tests
npm run test:coverage # Run tests with coverageLicense
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceEmpowers AI agents to perform web browsing, automation, and scraping tasks with minimal supervision using natural language instructions and Selenium.Last updated9Apache 2.0
- AlicenseBqualityCmaintenanceEnables AI assistants to automate web browser interactions through Selenium WebDriver. Supports multi-browser automation, element interaction, navigation, and web testing capabilities.Last updated561196MIT

MCP Macaco Playwrightofficial
Alicense-qualityDmaintenanceEnables comprehensive browser automation and web interaction through Playwright with 50+ specialized functions for navigation, form filling, data extraction, and Chrome DevTools Protocol support. Designed specifically for AI agents to perform complex web workflows including scraping, testing, and automated browsing tasks.Last updated311Apache 2.0- Alicense-qualityDmaintenanceProvides complete browser automation capabilities for AI agents via 44 tools, including navigation, element interaction, state management, and session recording.Last updated1,2161Apache 2.0
Related MCP Connectors
AI-powered browser automation β navigate, click, fill forms, and extract data from any website.
Provides cloud browser automation capabilities using Stagehand and Browserbase, enabling LLMs to iβ¦
Automate cloud browsers to navigate websites, interact with elements, and extract structured data.β¦
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/GonzaloRando03/selenium-server-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server