MCP Selenium Server

MCP Selenium Server

Enables AI agents to automate browser interactions using Selenium WebDriver, supporting multiple browsers and tools for navigation, clicking, typing, screenshots, and more.

Category
访问服务器

README

MCP Selenium Server

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

Watch the video

<a href="https://glama.ai/mcp/servers/@angiejones/mcp-selenium"> <img width="380" height="200" src="https://glama.ai/mcp/servers/@angiejones/mcp-selenium/badge" alt="Selenium MCP server" /> </a>

Setup

<details open> <summary><strong>Goose (Desktop)</strong></summary>

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%20interactions

</details>

<details> <summary><strong>Goose (CLI)</strong></summary>

goose session --with-extension "npx -y @angiejones/mcp-selenium@latest"

</details>

<details> <summary><strong>Claude Code</strong></summary>

claude mcp add selenium -- npx -y @angiejones/mcp-selenium@latest

</details>

<details> <summary><strong>Cursor / Windsurf / other MCP clients</strong></summary>

{
  "mcpServers": {
    "selenium": {
      "command": "npx",
      "args": ["-y", "@angiejones/mcp-selenium@latest"]
    }
  }
}

</details>

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 --enable once and enable "Allow Remote Automation" in Safari → Settings → Developer. No headless mode.


<details> <summary><strong>Tools</strong></summary>

start_browser

Launches a browser session.

Parameter Type Required Description
browser string Yes chrome, firefox, edge, or safari
options object No { headless: boolean, arguments: string[] }

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 click, doubleclick, rightclick, or hover
by string Yes Locator strategy: id, css, xpath, name, tag, class
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., href, value, class)
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., Enter, Tab, a)

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 arguments[0], etc.

window

Manages browser windows and tabs.

Parameter Type Required Description
action string Yes list, switch, switch_latest, or close
handle string No Window handle (required for switch)

frame

Switches focus to a frame or back to the main page.

Parameter Type Required Description
action string Yes switch or default
by string No Locator strategy (for switch)
value string No Locator value (for switch)
index number No Frame index, 0-based (for switch)
timeout number No Max wait in ms (default: 10000)

alert

Handles browser alert, confirm, or prompt dialogs.

Parameter Type Required Description
action string Yes accept, dismiss, get_text, or send_text
text string No Text to send (required for send_text)
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 console, errors, or network
clear boolean No Clear buffer after returning (default: false)

</details>

<details> <summary><strong>Resources</strong></summary>

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 text/plain
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 application/json
Requires browser Yes

</details>


<details> <summary><strong>Development</strong></summary>

Setup

git clone https://github.com/angiejones/mcp-selenium.git
cd mcp-selenium
npm install

Run Tests

npm test

Requires Chrome + chromedriver on PATH. Tests run headless.

Install via Smithery

npx -y @smithery/cli install @angiejones/mcp-selenium --client claude

Install globally

npm install -g @angiejones/mcp-selenium
mcp-selenium

</details>

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选