
@selenium/mcp是来自 Selenium 项目的官方模型背景协议服务器. 它让一个编码代理驱动一个真实的浏览器通过Selenium:代理读取该页面作为可访问性. .
概览
@selenium/mcp是来自 Selenium 项目的官方模型背景协议服务器. 它让一个编码代理驱动一个真实的浏览器通过Selenium:代理读取该页面作为带有元素 refs的可访问快照,并对这些 refs采取行动. 它从来没有写 或猜一个选择者。 它是作为工具而暴露的硒捆绑,而不是测试跑道. 硒管理器随捆绑物而来,所以没有驱动器可以安装. Chrome),默认为无头,超过stdio,每个服务器有1个浏览器. 看它覆盖什么。 你需要节点.js ^22.23.4 ^24.22.1 → 26.12.1 和克罗姆. 然后将服务器添加到您的代理 : : 在.cursor/mcp.json(或~/.cursor/mcp.json)中添加: 任何其他 MCP 客户端: 运行 npx @ selenium/ mcp@latest 作为 stdio 服务器. 旗帜名称与@ playwright/ mcp 相匹配, 工具名称和参数匹配 @ playwright/ mcp , 只要操作是相同的, 习惯和技能文件就会继续 .
概述(AI 翻译)
[T0] 是来自硒的官方模式背景协议服务器 项目。 它让一个编码代理通过 Selenium 驱动一个真实的浏览器: 代理读取该页面为访问 与元素参考器的快照, 和这些参考器的行为。 它从来没有写 或猜一个选择者。
它是作为工具而暴露的硒捆绑,而不是测试跑道. 硒经理带了捆绑,所以有 无法安装驱动程序 。
** 现状:v1正在进行。 ** Chrome),默认为无头,超过stdio,每个服务器有1个浏览器. 见 {\fn黑体\fs22\bord1\shad0\3aHBE\4aH00\fscx67\fscy66\2cHFFFFFF\3cH808080}它所覆盖的
□ 设置
你需要Node.js^22.23.4 || ^24.22.1 || >= 26.12.1和克罗姆. 然后将服务器添加到您的代理 :
** 克劳德法典**
** 编码**
** 课程**:在[[T2] (或[T3]] 中添加:
** VS 码**:在 [[T4] 中添加:
任何其他MCP客户端:运行 npx @selenium/mcp@latest作为stdio服务器.
□ 选项
- 旗帜 * * 意思是 * *
|----------------------------------------------------------------------------------------- ----------------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - – - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - – - - - - - - - - -
[
--browserT7。 [[T8]和[T9]]开始但尚未测试。 QQ--headless/--headed] 运行无头(默认)或显示窗口. |
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Selenium MCP server
@selenium/mcp is the official Model Context Protocol server from the Selenium
project. It lets a coding agent drive a real browser through Selenium: the agent reads the page as an accessibility
snapshot with element refs, and acts on those refs. It never has to write or guess a selector.
It is the Selenium bindings exposed as tools, not a test runner. Selenium Manager comes with the bindings, so there is no driver to install.
Status: v1 in progress. Chrome, headless by default, over stdio, one browser per server. See What it covers.
Setup
You need Node.js ^22.23.4 || ^24.22.1 || >= 26.12.1 and Chrome. Then add the server to your agent:
Claude Code
claude mcp add selenium -- npx @selenium/mcp@latest
Codex
codex mcp add selenium -- npx @selenium/mcp@latest
Cursor: add to .cursor/mcp.json (or ~/.cursor/mcp.json):
{ "mcpServers": { "selenium": { "command": "npx", "args": ["@selenium/mcp@latest"] } } }
VS Code: add to .vscode/mcp.json:
{ "servers": { "selenium": { "command": "npx", "args": ["@selenium/mcp@latest"] } } }
Any other MCP client: run npx @selenium/mcp@latest as a stdio server.
Options
| Flag | Meaning |
|---|---|
--browser |
chrome (default). edge and firefox start but are not yet tested. |
--headless / --headed |
Run headless (the default) or show the window. |
--grid |
Run the browser on a Selenium Grid instead of locally. |
--allowed-origins |
Semicolon-separated origins or hosts (*.example.com) the browser may navigate to. |
--blocked-origins |
Semicolon-separated origins or hosts it may not navigate to. |
--allow-unrestricted-file-access |
Let browser_navigate open file:// URLs, and browser_file_upload send files from outside the working directory (both blocked by default). |
--allow-evaluate |
Offer browser_evaluate, which runs JavaScript the agent writes in the page. |
--caps |
Comma-separated optional tool groups: vision, pdf, storage. See Optional tools. |
--log-level |
Log to stderr: severe, warning (default), info, fine, all. all includes raw WebDriver traffic, so typed text such as passwords. |
Flag names match @playwright/mcp wherever they mean the same thing.
Tools
Tool names and arguments match @playwright/mcp wherever the operation is the same, so habits and skills files carry
over.
| Tool | What it does |
安装
npx @selenium/mcp@latest配置
{ "mcpServers": { "selenium": { "command": "npx", "args": ["@selenium/mcp@latest"] } } }