Selenium Mcp

io.github.gaforov由 GitHub 帳號 gaforov 發布v0.3.0更新於 Oct 24, 2026

Selenium MCP server for AI agents — 41 browser automation tools with snapshots and sessions.

已驗證STDIO僅桌面瀏覽器自動化開發者工具

概覽

AI 產生的概覽

以 Selenium 為基礎的 MCP 伺服器,為 AI 助理提供 41 個工具,在本機驅動真實的 Chrome、Firefox 或 Edge 瀏覽器,支援頁面快照與多工作階段。

可以做什麼
  • 啟動、停止並管理多個平行瀏覽器工作階段,進行導覽、上一頁下一頁重新整理、等待跳轉,以及讀取網址與標題。
  • 尋找與等待元素,擷取帶有穩定元素參照的頁面快照,讀取頁面原始碼。
  • 點擊、重試點擊、懸停、輸入、選擇下拉選項、捲動、按鍵與上傳檔案。
  • 讀取文字與屬性,執行斷言,執行腳本以及批次多步驟操作。
  • 儲存、列出與刪除依網域記錄的定位器提示,管理視窗、框架、彈窗與 Cookie,並擷取螢幕截圖。
適用情境
適合需要助理操作使用者本機真實瀏覽器的情境:端對端網頁測試、填寫表單、檢查渲染後的頁面、響應式視窗尺寸檢查,以及可藉由已儲存定位器提示重複執行的自動化流程。
執行需求
以本機 stdio 程序執行,通常透過 npx 從 npm 套件啟動。需要 Node.js 20+ 以及已安裝的 Chrome、Firefox 或 Edge;Selenium Manager 會自動準備相符的驅動程式。選用追蹤透過環境變數 SELENIUM_MCP_TRACE 與 SELENIUM_MCP_TRACE_PATH 開啟。
安裝前請注意
助理可在真實瀏覽器中點擊、輸入、上傳檔案、執行腳本與修改 Cookie,操作會影響線上網站與帳號。選用追蹤會把每次工具呼叫寫入 NDJSON 日誌檔,可能記錄敏感頁面與輸入內容。僅支援桌面端,未宣告任何身分驗證。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Selenium Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

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
bash
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):

json
{  "mcpServers": {    "selenium": {      "command": "npx",      "args": ["-y", "@gaforov/selenium-mcp@latest"]    }  }}
VS Code
bash
code --add-mcp '{"name":"selenium","command":"npx","args":["-y","@gaforov/selenium-mcp@latest"]}'
Goose
bash
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
bash
git clone https://github.com/gaforov/selenium-mcp.gitcd selenium-mcpnpm installnpm 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:

bash
SELENIUM_MCP_TRACE=trueSELENIUM_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.

bash
npm run typechecknpm run buildnpm test

License

MIT. See LICENSE.

來源:README.md,提交 d04777a

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.3.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分