io.github.pshivapr/selenium-mcp

编码与调试

by pshivapr

为 MCP 提供 Selenium 工具集,可用于浏览器自动化、页面操作与 Web 测试流程。

什么是 io.github.pshivapr/selenium-mcp

为 MCP 提供 Selenium 工具集,可用于浏览器自动化、页面操作与 Web 测试流程。

README

Add to Cursor Add to VS Code Add to Claude Add to ChatGPT Add to Codex Add to Gemini

Selenium MCP Server

npm version

npm downloads

GitHub issues

smithery badge

This is a server implementation that bridges the gap between MCP clients (AI assistants) and Selenium WebDriver. It exposes Selenium WebDriver's functionalities as MCP tools, allowing AI models to utilize them for tasks like:

  • Browser management (launching, navigating, closing browsers)
  • Element interaction (clicking, typing, finding elements)
  • Web scraping and automated testing
  • Advanced operations like screenshots, cookie management, and JavaScript execution

In essence, the selenium webdriver mcp setup allows AI assistants to leverage the power of Selenium Webdriver for web automation, by communicating with a dedicated Selenium MCP server via the Model Context Protocol. This facilitates tasks such as automated web interactions, testing, and data extraction, all controlled by AI.

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

🚀 Overview

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.

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, Safari, 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)

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

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

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

Example 'http' type connection

json
{
  "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

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

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

To install the package using either npm, or Smithery

Using npm:

bash
npm install -g selenium-webdriver-mcp@latest

Using Smithery

To install Selenium MCP for Claude Desktop automatically via smithery badge

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

Claude Desktop Integration

Add to your Claude Desktop configuration:

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

Screenshot

Selenium + Claude

Prompts

An example prompt to start AI Agent interaction:

Using selenium mcp tools, navigate to <https://parabank.parasoft.com/> click the 'Register' link and signup using dynamic test data and click register. Then generate selenium tests in <YOUR_FAVOURITE_PROGRAMMING_LANGUAGE> using pom, create tests using cucumber features, steps and execute the tests.

Note: For more prompts, look at examples directory of the project

🛠️ MCP Available Tools

Browser Management Tools

ToolDescriptionParameters
browser_openOpen a new browser sessionbrowser, options
browser_navigateNavigate to a URLurl
browser_navigate_backNavigate back in historyNone
browser_navigate_forwardNavigate forward in historyNone
browser_titleGet the current page titleNone
browser_refreshRefresh the current pageNone
browser_get_urlGet the current page URLNone
browser_get_page_sourceGet the current page HTML sourceNone
browser_maximizeMaximize the browser windowNone
browser_resizeResize browser windowwidth, height
browser_closeClose current browser sessionNone

Cookie Management Tools

ToolDescriptionParameters
browser_get_cookiesGet all cookies from the current browser sessionNone
browser_get_cookie_by_nameGet a specific cookie by namecookie (cookie name)
browser_add_cookie_by_nameAdd a new cookie to the browsercookie (cookie name), value
browser_set_cookie_objectSet a cookie object in the browsercookie (cookie object as string)
browser_delete_cookieDelete a specific cookie by namevalue (cookie name to delete)
browser_delete_cookiesDelete all cookies from the current browser sessionNone

Window Management Tools

ToolDescriptionParameters
browser_switch_to_windowSwitch to a different browser window by handlewindowHandle
browser_switch_to_original_windowSwitch back to the original browser windowNone
browser_switch_to_window_by_titleSwitch to a window by its page titletitle
browser_switch_window_by_indexSwitch to a window by its index positionindex
browser_switch_to_window_by_urlSwitch to a window by its URLurl

Element Interaction Tools

ToolDescriptionParameters
browser_find_elementFind an element on the pageby, value, timeout
browser_find_elementsFind multiple elements on the pageby, value, timeout
browser_clickClick on an elementby, value, timeout
browser_typeType text into an elementby, value, text, timeout
browser_get_element_textGet text content of elementby, value, timeout
browser_file_uploadUpload file via input elementby, value, filePath, timeout
browser_clearClear text from an elementby, value, timeout
browser_get_attributeGet element attribute valueby, value, attribute, timeout

Element State Validation Tools

ToolDescriptionParameters
browser_element_is_displayedCheck if an element is visible on the pageby, value, timeout
browser_element_is_enabledCheck if an element is enabled for interactionby, value, timeout
browser_element_is_selectedCheck if an element is selected (checkboxes, radio buttons)by, value, timeout

Frame Management Tools

ToolDescriptionParameters
browser_switch_to_frameSwitch to an iframe elementby, value, timeout
browser_switch_to_parent_frameSwitch to the parent frame (from nested iframe)None
browser_switch_to_default_contentSwitch back to the main page contentNone

Advanced Action Tools

ToolDescriptionParameters
browser_hoverHover over an elementby, value, timeout
browser_double_clickDouble-click on an elementby, value, timeout
browser_right_clickRight-click (context menu)by, value, timeout
browser_drag_and_dropDrag from source to targetby, value, targetBy, targetValue, timeout
browser_wait_for_elementWait for element to appearby, value, timeout
browser_execute_scriptExecute JavaScript codescript, args
browser_screenshotTake a screenshotfilename (optional)
browser_select_dropdown_by_textSelect dropdown option by visible textby, value, text, timeout
browser_select_dropdown_by_valueSelect dropdown option by valueby, value, dropdownValue, timeout
browser_key_pressPress a keyboard key in the browserkey, timeout

Scrolling Tools

ToolDescriptionParameters
browser_scroll_to_elementScroll to bring an element into viewby, value, timeout
browser_scroll_to_topScroll to the top of the pageNone
browser_scroll_to_bottomScroll to the bottom of the pageNone
browser_scroll_to_coordinatesScroll to specific coordinatesx, y
browser_scroll_by_pixelsScroll by specified number of pixelsx, y

Form Interaction Tools

ToolDescriptionParameters
browser_select_checkboxSelect/check a checkboxby, value, timeout
browser_unselect_checkboxUnselect/uncheck a checkboxby, value, timeout
browser_submit_formSubmit a form elementby, value, timeout
browser_focus_elementFocus on a specific elementby, value, timeout
browser_blur_elementRemove focus from a specific elementby, value, 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, Safari, or Edge installed
  • WebDrivers: Automatically managed by selenium-webdriver
  • Operating System: Windows, macOS, or Linux

🚦 Development

Getting Started

Clone the repository

bash
git clone https://github.com/pshivapr/selenium-mcp.git
cd selenium-mcp

Install dependencies

bash
npm install

Build the project

bash
npm run build

Running the Server

Production Mode

bash
npm start

Development Mode (with auto-reload)

bash
npm run dev

Direct Execution

bash
node dist/index.js

Using as CLI Tool

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

bash
npx selenium-webdriver-mcp@latest

📝 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

Badges/Mentions

MCP Market

Pulse

MCP Badge


Built with ❤️ for the Model Context Protocol ecosystem

常见问题

io.github.pshivapr/selenium-mcp 是什么?

为 MCP 提供 Selenium 工具集,可用于浏览器自动化、页面操作与 Web 测试流程。

相关 Skills

前端设计

by anthropics

Universal
热门

面向组件、页面、海报和 Web 应用开发,按鲜明视觉方向生成可直接落地的前端代码与高质感 UI,适合做 landing page、Dashboard 或美化现有界面,避开千篇一律的 AI 审美。

想把页面做得既能上线又有设计感,就用前端设计:组件到整站都能产出,难得的是能避开千篇一律的 AI 味。

编码与调试
未扫描165.3k

网页应用测试

by anthropics

Universal
热门

用 Playwright 为本地 Web 应用编写自动化测试,支持启动开发服务器、校验前端交互、排查 UI 异常、抓取截图与浏览器日志,适合调试动态页面和回归验证。

借助 Playwright 一站式验证本地 Web 应用前端功能,调 UI 时还能同步查看日志和截图,定位问题更快。

编码与调试
未扫描165.3k

网页构建器

by anthropics

Universal
热门

面向复杂 claude.ai HTML artifact 开发,快速初始化 React + Tailwind CSS + shadcn/ui 项目并打包为单文件 HTML,适合需要状态管理、路由或多组件交互的页面。

在 claude.ai 里做复杂网页 Artifact 很省心,多组件、状态和路由都能顺手搭起来,React、Tailwind 与 shadcn/ui 组合效率高、成品也更精致。

编码与调试
未扫描165.3k

相关 MCP Server

GitHub

编辑精选

by GitHub

热门

GitHub 是 MCP 官方参考服务器,让 Claude 直接读写你的代码仓库和 Issues。

这个参考服务器解决了开发者想让 AI 安全访问 GitHub 数据的问题,适合需要自动化代码审查或 Issue 管理的团队。但注意它只是参考实现,生产环境得自己加固安全。

编码与调试
89.1k

by Context7

热门

Context7 是实时拉取最新文档和代码示例的智能助手,让你告别过时资料。

它能解决开发者查找文档时信息滞后的问题,特别适合快速上手新库或跟进更新。不过,依赖外部源可能导致偶尔的数据延迟,建议结合官方文档使用。

编码与调试
60.0k

by tldraw

热门

tldraw 是让 AI 助手直接在无限画布上绘图和协作的 MCP 服务器。

这解决了 AI 只能输出文本、无法视觉化协作的痛点——想象让 Claude 帮你画流程图或白板讨论。最适合需要快速原型设计或头脑风暴的开发者。不过,目前它只是个基础连接器,你得自己搭建画布应用才能发挥全部潜力。

编码与调试
49.5k

评论