Selenium MCP Server

Selenium MCP Server

Enables AI assistants to automate web browser interactions through Selenium WebDriver. Supports multi-browser automation, element interaction, navigation, and web testing capabilities.

Category
访问服务器

README

Selenium MCP Server

A Model Context Protocol (MCP) server for Selenium that provides comprehensive Selenium WebDriver automation tools for AI assistants and applications. This server enables automated web browser interactions, testing, and scraping through a standardized interface.

🚀 Overview

The Selenium MCP Server bridges the gap between AI models and web automation by providing a robust set of tools for browser control, element interaction, and web testing. Built with TypeScript and modern ES modules, it offers type-safe browser automation capabilities through the Model Context Protocol.

✨ Key Features

  • Multi-Browser Support: Chrome, Firefox, and Edge browser automation
  • Comprehensive Element Interaction: Click, type, hover, drag & drop, file uploads
  • Advanced Navigation: Forward, backward, refresh, window management
  • Wait Strategies: Intelligent waiting for elements and page states
  • Type Safety: Full TypeScript implementation with Zod validation

🤝 Integration

MCP Client Integration

Configure your MCP client to connect to the Selenium server:

Standard Configuration (applicable to Windsurf, Warp, Gemini CLI etc)

{
  "servers": {
    "Selenium": {
      "command": "npx",
      "args": ["-y", "selenium-webdriver-mcp"]
    }
  }
}

Installation in VS Code

Update your mcp.json in VS Code with below configuration

NOTE: If you're new to MCP servers, follow this link Use MCP servers in VS Code

Example 'stdio' type connection

{
  "servers": {
    "Selenium": {
      "command": "npx",
      "args": [
        "-y",
        "selenium-webdriver-mcp"
      ],
      "type": "stdio"
    }
  },
  "inputs": []
}

Example 'http' type connection

{
  "servers": {
    "Selenium": {
      "url": "https://smithery.ai/server/@pshivapr/selenium-mcp",
      "type": "http"
    }
  },
  "inputs": []
}

After installation, the Selenium MCP server will be available for use with your GitHub Copilot agent in VS Code.

To install the Selenium MCP server using the VS Code CLI

# For VS Code
code --add-mcp '{\"name\":\"Selenium\",\"command\": \"npx\",\"args\": [\"selenium-webdriver-mcp\"]}'

# For VS Code Insiders
vscode-insiders --add-mcp '{\"name\":\"Selenium\",\"command\": \"npx\",\"args\": [\"selenium-webdriver-mcp\"]}'

To install the package using either npm, or Smithery

Using npm:

npm install -g selenium-webdriver-mcp

Using smithery badge

To install Selenium MCP for Claude Desktop automatically via Smithery:

npx @smithery/cli install @pshivapr/selenium-mcp --client claude

Claude Desktop Integration

Add to your Claude Desktop configuration:

{
  "mcpServers": {
    "Selenium": {
      "command": "npx",
      "args": ["-y", "selenium-webdriver-mcp"]
    }
  }
}

Screenshot

Selenium + Claude

🛠️ MCP Available Tools

Browser Management Tools

Tool Description Parameters
browser_open Open a new browser session browser, options
browser_navigate Navigate to a URL url
browser_navigate_back Navigate back in history None
browser_navigate_forward Navigate forward in history None
browser_title Get the current page title None
browser_refresh Refresh the current page None
browser_resize Resize browser window width, height
browser_switch_tab_or_window Switch to a tab or window handle
browser_switch_to_original_window Switch to the original window None
browser_close Close current browser session None

Element Interaction Tools

Tool Description Parameters
browser_find_element Find an element on the page by, value, timeout
browser_click Click on an element by, value, timeout
browser_type Type text into an element by, value, text, timeout
browser_get_element_text Get text content of element by, value, timeout
browser_file_upload Upload file via input element by, value, filePath, timeout
browser_clear Clear text from an element by, value, timeout
browser_get_attribute Get element attribute value by, value, attribute, timeout
browser_element_is_displayed Check if element is displayed by, value, timeout
browser_switch_to_frame Switch to a frame by locator by, value, timeout, timeout

Advanced Action Tools

Tool Description Parameters
browser_hover Hover over an element by, value, timeout
browser_double_click Double-click on an element by, value, timeout
browser_right_click Right-click (context menu) by, value, timeout
browser_drag_and_drop Drag from source to target by, value, targetBy, targetValue, timeout
browser_wait_for_element Wait for element to appear by, value, timeout
browser_scroll_to_element Scroll element into view by, value, timeout
browser_execute_script Execute JavaScript code script, args
browser_screenshot Take a screenshot filename (optional)
browser_select_dropdown_by_text Select dropdown option by visible text by, value, text, timeout
browser_select_dropdown_by_value Select dropdown option by value by, value, dropdownValue, timeout
browser_key_press Press a keyboard key in the browser key, timeout

Element Locator Strategies

  • id: Find by element ID
  • css: Find by CSS selector
  • xpath: Find by XPath expression
  • name: Find by name attribute
  • tag: Find by HTML tag name
  • class: Find by CSS class name

📋 Requirements

  • Node.js: Version 18.0.0 or higher
  • Browsers: Chrome, Firefox, or Edge installed
  • WebDrivers: Automatically managed by selenium-webdriver
  • Operating System: Windows, macOS, or Linux

🚦 Development

Getting Started

  1. Clone the repository:

    git clone https://github.com/pshivapr/selenium-mcp.git
    cd selenium-mcp
    
  2. Install dependencies:

    npm install
    
  3. Build the project:

    npm run build
    

Running the Server

Production Mode

npm start

Development Mode (with auto-reload)

npm run dev

Direct Execution

node dist/index.js

Using as CLI Tool

After building, you can use the server as a global command:

npx selenium-webdriver-mcp

📝 License

MIT License - see LICENSE file for details.

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📊 Version History

  • 0.2.0 - Selenium MCP Server
    • Multi-browser support (Chrome, Firefox, Edge)
    • Complete element interaction toolset
    • Advanced action capabilities
    • Type-safe TypeScript implementation
    • MCP protocol compliance

Built with ❤️ for the Model Context Protocol ecosystem

推荐服务器

Baidu Map

Baidu Map

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

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

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

官方
精选
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

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

官方
精选
本地
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

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

官方
精选
本地
TypeScript
VeyraX

VeyraX

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

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

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

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

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

官方
精选
TypeScript
Exa MCP Server

Exa MCP Server

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

官方
精选
mcp-server-qdrant

mcp-server-qdrant

这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。

官方
精选
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选