mcpField
S
Selenium MCP

Selenium MCP

Local
npmjs.comBrowser Automation0Updated 7w ago

About Selenium MCP

Selenium MCP is a TypeScript server for AI agents to automate real browsers through Selenium WebDriver. It combines browser controls with page snapshots, selector hints, multi-session support, and batched actions.

Key features

  1. 01Browser navigation and interaction tools
  2. 02Page snapshots with stable element refs
  3. 03Persistent per-domain selector hints
  4. 04Parallel browser sessions
  5. 05Batched multi-step execution
  6. 06Assertions and optional tracing

Use cases

  1. 01Automating browser-based workflows
  2. 02Testing pages with assertions
  3. 03Repeating tasks using saved selectors
  4. 04Debugging browser tool-call sequences

MCP support

Exposes browser automation tools and the `browser-status://current` and `accessibility://current` resources to MCP clients. Clients can use the tools to manage sessions, navigate pages, interact with elements, and capture screenshots.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"selenium-mcp-gaforov": {
"command": "npx",
"args": [
"-y",
"@gaforov/selenium-mcp"
]
}
}
}
Run commandnpx -y @gaforov/selenium-mcp

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@gaforov/selenium-mcp0.3.0

Tools

41

Saved tool list · updated 3w ago

ParameterTypeRequiredDescription
browserenumNoWhich browser to launch: chrome (default), firefox, or edge. It must be installed on this machine.chrome | firefox | edge
headlessbooleanNoRun without a visible window (default false). Use true for CI or background runs, false when the user wants to watch.
browserArgsarrayNoExtra command-line flags for the browser, e.g. ['--incognito'] or ['--lang=de']. Default none.
pageLoadTimeoutMsintegerNoMaximum time a page load may take before navigate fails, in milliseconds (default 30000).
scriptTimeoutMsintegerNoMaximum time an asynchronous script may run, in milliseconds (default 30000).
windowSizeobjectNoInitial window size, e.g. { width: 1440, height: 900 }. Change it later with the window tool's resize action.
windowSize.widthintegerYesWindow width in pixels (320-7680).
windowSize.heightintegerYesWindow height in pixels (240-4320).

Details

From the project README

selenium-mcp

Selenium MCP server for AI agents — 41 tools for real-browser automation: navigation, clicking, typing, assertions, screenshots, multi-session management, page snapshots with stable element refs, persistent selector hints, and batched multi-step execution.

npm version npm downloads CI license node

Built with TypeScript, the official MCP SDK, and Selenium WebDriver — strict zod input validation, explicit waits, and structured responses designed for LLM agents.

One-Click Install

Install in Cursor Install in VS Code Install in VS Code Insiders

What's new in 0.3.0

  • New tools: select_option for dropdowns, scroll (including infinite-scroll pages and scrollable panels), history for back, forward, and refresh, and wait_for_page to wait for a URL or title after a redirect.
  • Responsive testing: window can now resize the viewport to an exact size, such as a 390x844 phone, or maximize it.
  • Better tool choice by AI agents: every tool and parameter now explains what it does, what it returns, and when to use a similar tool instead.
  • Breaking: open_url and wait_until_visible were removed as duplicates. Use navigate, and wait_for_element with visible: true.
  • Verified releases: every release is tested end to end against a real browser and published with npm provenance.

See the changelog for details.

Setup

Claude Code
claude mcp add selenium -- npx -y @gaforov/selenium-mcp@latest
Claude Desktop / Cursor / Windsurf / other MCP clients

Add to your client's MCP config (e.g. claude_desktop_config.json or .cursor/mcp.json):

{
  "mcpServers": {
    "selenium": {
      "command": "npx",
      "args": ["-y", "@gaforov/selenium-mcp@latest"]
    }
  }
}
VS Code
code --add-mcp '{"name":"selenium","command":"npx","args":["-y","@gaforov/selenium-mcp@latest"]}'
Goose
goose session --with-extension "npx -y @gaforov/selenium-mcp@latest"
IntelliJ IDEA / JetBrains IDEs

Settings → Tools → AI Assistant → Model Context Protocol → Add, with command npx and arguments -y @gaforov/selenium-mcp@latest. Full walkthrough in docs/CLIENT_INTEGRATION.md.

From source
git clone https://github.com/gaforov/selenium-mcp.git
cd selenium-mcp
npm install
npm run build

Then point your MCP client at node /absolute/path/to/selenium-mcp/dist/server.js.

Example Usage

Ask your AI agent:

Use selenium-mcp to open Chrome, go to https://example.com, read the page title, take a screenshot, and close the browser.

The agent chains start_browser → navigate → get_title → take_screenshot → stop_browser on its own — no scripting needed.

Requirements

  • Node.js 20+
  • Chrome, Firefox, or Edge installed (Selenium Manager provisions the matching driver automatically)

How it compares

Most Selenium MCP servers wrap WebDriver's basic commands. This one adds the layer that makes agents reliable:

Capabilityselenium-mcpTypical Selenium MCP servers
Page snapshot with stable element refs (capture_page)✅rare
Persistent per-domain selector memory (selector_hint_*)✅❌
Parallel multi-session browsing✅rare
Batched multi-step execution in one call✅❌
Built-in test assertions✅some
Tool-call tracing (NDJSON audit log)✅❌
Strict input validation + structured errors✅varies
Every tool and parameter described for AI agents (enforced by tests)✅varies
End-to-end tests against a real browser in CI✅some

Why selenium-mcp

  • Snapshot-first workflows — capture_page returns a page snapshot with stable element refs the agent can act on directly, no brittle selector guessing
  • Selector hints — persist working locators per domain so repeat automations get faster and more reliable over time
  • Batched execution — batch_execute runs constrained multi-step sequences in a single tool call, cutting round-trips
  • Multi-session — create, select, list, and destroy parallel browser sessions
  • Agent-friendly errors — every response is structured and validated with zod, so agents can recover instead of stalling
  • Optional tracing — NDJSON trace of every tool call for debugging and auditing

Tools (41)

CategoryTools
Browser lifecyclestart_browser, stop_browser, session_create, session_select, session_list, session_destroy
Navigationnavigate, history (back/forward/refresh), wait_for_page (URL/title), get_current_url, get_title
Element discoveryfind_element, wait_for_element, capture_page, get_page_source
Interactionclick, retry_click, interact (hover/double/right-click), type, select_option, scroll, press_key, upload_file
Readingget_text, get_attribute
Assertionsassert_text, assert_visible, assert_attribute
Scriptingexecute_script, batch_execute
Selector hintsselector_hint_save, selector_hint_get, selector_hint_list, selector_hint_delete
Windows & contextwindow (tabs, windows, resize/maximize), frame, alert
Cookiesadd_cookie, get_cookies, delete_cookie
Capturetake_screenshot

Full parameter documentation: docs/TOOL_REFERENCE.md

MCP Resources

  • browser-status://current — live browser/session status
  • accessibility://current — accessibility snapshot of the current page

Optional Tracing

Enable lightweight NDJSON tracing of all tool calls:

SELENIUM_MCP_TRACE=true
SELENIUM_MCP_TRACE_PATH=./logs/selenium-mcp-trace.ndjson

If SELENIUM_MCP_TRACE_PATH is omitted, the default is logs/selenium-mcp-trace.ndjson.

Documentation

Contributing

Contributions are welcome — bug reports, feature requests, and pull requests. See CONTRIBUTING.md to get started.

npm run typecheck
npm run build
npm test

License

MIT. See LICENSE.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.