
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.
概览
基于 Selenium 的 MCP 服务器,为 AI 助手提供 41 个工具,在本机驱动真实的 Chrome、Firefox 或 Edge 浏览器,支持页面快照和多会话。
- 可以做什么
- 启动、停止并管理多个并行浏览器会话,进行导航、前进后退刷新、等待跳转以及读取 URL 和标题。
- 查找和等待元素,抓取带稳定元素引用的页面快照,读取页面源码。
- 点击、重试点击、悬停、输入、选择下拉项、滚动、按键和上传文件。
- 读取文本与属性,执行断言,运行脚本以及批量多步操作。
- 保存、列出和删除按域名记录的定位器提示,管理窗口、框架、弹窗和 Cookie,并截图。
- 适用场景
- 适合需要助手操作用户本机真实浏览器的场景:端到端网页测试、填写表单、检查渲染后的页面、响应式视口检查,以及可借助已保存定位器提示反复运行的自动化流程。
- 运行要求
- 以本地 stdio 进程运行,通常通过 npx 从 npm 包启动。需要 Node.js 20+ 以及已安装的 Chrome、Firefox 或 Edge;Selenium Manager 会自动准备匹配的驱动。可选追踪通过环境变量 SELENIUM_MCP_TRACE 和 SELENIUM_MCP_TRACE_PATH 开启。
安装
在 SourceWeft 中
- 打开 控制台中的 Selenium Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
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_optionfor dropdowns,scroll(including infinite-scroll pages and scrollable panels),historyfor back, forward, and refresh, andwait_for_pageto wait for a URL or title after a redirect. - Responsive testing:
windowcan 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_urlandwait_until_visiblewere removed as duplicates. Usenavigate, andwait_for_elementwithvisible: 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 Desktop / Cursor / Windsurf / other MCP clients
Add to your client's MCP config (e.g. claude_desktop_config.json or .cursor/mcp.json):
VS Code
Goose
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
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:
Why selenium-mcp
- Snapshot-first workflows —
capture_pagereturns 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_executeruns 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)
Full parameter documentation: docs/TOOL_REFERENCE.md
MCP Resources
browser-status://current— live browser/session statusaccessibility://current— accessibility snapshot of the current page
Optional Tracing
Enable lightweight NDJSON tracing of all tool calls:
If SELENIUM_MCP_TRACE_PATH is omitted, the default is logs/selenium-mcp-trace.ndjson.
Documentation
- Usage guide — prompts & recipes
- Tool reference
- Client integration
- Architecture
- Development guide
- Changelog
- Roadmap
Contributing
Contributions are welcome — bug reports, feature requests, and pull requests. See CONTRIBUTING.md to get started.
License
MIT. See LICENSE.
来源:README.md,提交 d04777a
工具
0版本历史
1- v0.3.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分