selenium-mcp-server
A Model Context Protocol server for browser automation using Selenium WebDriver, enabling LLMs and teams to automate browsers with multi-browser support and a standard MCP API.
README
Selenium MCP Server
A Model Context Protocol (MCP) server for browser automation using Selenium WebDriver. Enables LLMs and teams to automate browsers via a standard protocol, similar to Playwright MCP.
🚀 Key Features
- Multi-browser support (Chrome, Firefox, Edge, Safari)
- Team-friendly: visible browser by default
- MCP-compliant API (navigate, click, type, screenshot, etc.)
- Easy onboarding for teams and CI
📦 Exposing MCP Server for Team Usage
1. Publish to npm (for team-wide access)
- Ensure your
package.jsonis correct (see below) - Run:
npm publish --access public
- Or for private registry:
npm publish --access restricted
2. Install and Run (for any team)
Global install (recommended for teams)
npm install -g selenium-mcp-server
selenium-mcp-server --browser chrome
Or use npx (no install needed)
npx selenium-mcp-server@latest --browser chrome
3. Configure in MCP Client (e.g., Cursor, CI, or custom)
Add to your .cursor/mcp.json or equivalent:
{
"mcpServers": {
"selenium": {
"command": "selenium-mcp-server",
"args": ["--browser", "chrome"]
}
}
}
- For CI, run the server as a background process and point clients to its port.
📝 Onboarding for New Teams
- Install Node.js 18+ and Java 11+
- Install the MCP server globally or use npx
- Share the npm package name and README with your team
- Provide example configs and usage (see above)
- For support, use the GitHub repo issues page
Example package.json for Publishing
{
"name": "selenium-mcp-server",
"version": "1.0.0",
"description": "Selenium MCP server for browser automation",
"main": "index.js",
"bin": { "selenium-mcp-server": "index.js" },
"repository": { "type": "git", "url": "https://github.com/your-org/selenium-mcp-server.git" },
"author": "Your Name",
"license": "MIT"
}
📋 Available Tools
browser_navigate- Navigate to any URLbrowser_snapshot- Get page accessibility snapshot with element referencesbrowser_click- Click on elements using references from snapshotsbrowser_type- Type text into form fields with optional submissionbrowser_wait_for- Wait for time, text to appear, or text to disappearbrowser_take_screenshot- Capture screenshots of the current page
🛠️ Installation & Setup
For Cursor Users
-
Add to Cursor Settings:
- Go to
Cursor Settings→MCP→Add new MCP Server - Name:
selenium-mcp - Command type:
command - Command:
npx - Arguments:
["selenium-mcp-server@latest"]
- Go to
-
Alternative JSON Configuration:
{
"mcpServers": {
"selenium-mcp": {
"command": "npx",
"args": ["selenium-mcp-server@latest"]
}
}
}
For Other MCP Clients
Use the same configuration pattern with your MCP client:
{
"mcpServers": {
"selenium-mcp": {
"command": "npx",
"args": ["selenium-mcp-server@latest"]
}
}
}
Alternative Installation Methods
<details> <summary>Click to see other installation options</summary>
Method 1: Local Installation
npm install selenium-mcp-server
Method 2: Global Installation
npm install -g selenium-mcp-server
</details>
Quick Start
🎯 Zero-Installation (Recommended)
1. Add Configuration
Create .cursor/mcp.json in your project root:
{
"mcpServers": {
"selenium": {
"command": "npx",
"args": [
"selenium-mcp-server@latest",
"--browser", "chrome"
]
}
}
}
2. Restart Cursor
- Quit Cursor completely
- Restart Cursor
- npx will automatically download and run the server
<details> <summary>Alternative Setup Methods</summary>
Option A: Local Installation
1. Install in your project
npm install selenium-mcp-server
2. Configure Cursor
{
"mcpServers": {
"selenium": {
"command": "node",
"args": ["./node_modules/selenium-mcp-server/dist/index.js", "--browser", "chrome", "--headless"]
}
}
}
Option B: Global Installation
1. Install globally
npm install -g selenium-mcp-server
2. Configure Cursor
{
"mcpServers": {
"selenium": {
"command": "selenium-mcp",
"args": ["--browser", "chrome", "--headless"]
}
}
}
</details>
3. Use in Cursor
Ask Cursor to perform browser automation:
- "Navigate to google.com and take a screenshot"
- "Fill out the contact form on example.com"
- "Extract all links from the current page"
Configuration Options
selenium-mcp [options]
Options:
--browser <browser> Browser to use (chrome, firefox, edge, safari) (default: "chrome")
--headless Run browser in headless mode
--executable-path <path> Path to browser executable
--user-data-dir <path> Path to user data directory
--isolated Keep browser profile in memory
--viewport-size <size> Browser viewport size (e.g., 1280,720)
--output-dir <path> Path to directory for output files
-h, --help Display help for command
Available Tools
Navigation
browser_navigate- Navigate to URLsbrowser_navigate_back- Go back in historybrowser_navigate_forward- Go forward in history
Page Interaction
browser_click- Click on elementsbrowser_type- Type text into inputsbrowser_hover- Hover over elementsbrowser_drag- Drag and drop elementsbrowser_select_option- Select dropdown optionsbrowser_press_key- Press keyboard keys
Information Gathering
browser_snapshot- Capture accessibility treebrowser_take_screenshot- Take screenshotsbrowser_network_requests- List network requestsbrowser_console_messages- Get console messages
Tab Management
browser_tab_list- List open tabsbrowser_tab_new- Open new tabsbrowser_tab_select- Switch tabsbrowser_tab_close- Close tabs
Utilities
browser_wait_for- Wait for elements/textbrowser_file_upload- Upload filesbrowser_handle_dialog- Handle alerts/dialogsbrowser_resize- Resize browser windowbrowser_pdf_save- Save page as PDF
Usage Examples
Basic Navigation and Screenshot
// In Cursor, ask:
"Navigate to https://example.com and take a screenshot"
Form Interaction
// In Cursor, ask:
"Go to the contact page and fill out the form with name 'John Doe' and email 'john@example.com'"
Data Extraction
// In Cursor, ask:
"Visit the product page and extract all product names and prices"
Requirements
- Node.js 18+
- Java 11+ (for Selenium WebDriver)
- Browser drivers (automatically managed by WebDriverManager)
Configuration Examples
Local Development
{
"mcpServers": {
"selenium": {
"command": "selenium-mcp",
"args": ["--browser", "chrome"]
}
}
}
Headless Production
{
"mcpServers": {
"selenium": {
"command": "selenium-mcp",
"args": [
"--browser", "chrome",
"--headless",
"--viewport-size", "1920,1080"
]
}
}
}
Custom Browser Path
{
"mcpServers": {
"selenium": {
"command": "selenium-mcp",
"args": [
"--browser", "chrome",
"--executable-path", "/path/to/chrome"
]
}
}
}
Troubleshooting
Browser Not Found
If you get browser not found errors:
- Install the browser (Chrome, Firefox, etc.)
- Use
--executable-pathto specify browser location - Check that Java is installed and accessible
Permission Issues
On macOS, you might need to grant accessibility permissions:
- Go to System Preferences > Security & Privacy > Privacy
- Select "Accessibility"
- Add your terminal application
Memory Issues
For large pages or long-running sessions:
{
"mcpServers": {
"selenium": {
"command": "selenium-mcp",
"args": ["--isolated", "--headless"]
}
}
}
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
License
MIT License - see LICENSE file for details.
Related Projects
- Playwright MCP - Similar server using Playwright
- Model Context Protocol - The protocol specification
- Selenium WebDriver - The underlying browser automation framework
References
For more, see CONTRIBUTING.md and TEAM_SETUP_GUIDE.md
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。