Skip to main content
Glama

Selenium MCP Server

by pshivapr

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

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

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_resizeResize browser windowwidth, height
browser_switch_tab_or_windowSwitch to a tab or windowhandle
browser_switch_to_original_windowSwitch to the original windowNone
browser_closeClose current browser sessionNone

Element Interaction Tools

ToolDescriptionParameters
browser_find_elementFind an element 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
browser_element_is_displayedCheck if element is displayedby, value, timeout
browser_switch_to_frameSwitch to a frame by locatorby, value, timeout, timeout

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_scroll_to_elementScroll element into viewby, 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

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

Related MCP Servers

  • A
    security
    A
    license
    A
    quality
    Facilitates browser automation with custom capabilities and agent-based interactions, integrated through the browser-use library.
    Last updated -
    1
    791
    MIT License
    • Apple
  • -
    security
    A
    license
    -
    quality
    Empowers AI agents to perform web browsing, automation, and scraping tasks with minimal supervision using natural language instructions and Selenium.
    Last updated -
    4
    Apache 2.0
    • Apple
  • A
    security
    A
    license
    A
    quality
    Allows AI agents to control web browser sessions via Selenium WebDriver, enabling web automation tasks like scraping, testing, and form filling through the Model Context Protocol.
    Last updated -
    6
    22
    3
    MIT License
  • -
    security
    F
    license
    -
    quality
    Enables AI assistants to control a browser through a set of tools, allowing them to perform web automation tasks like navigation, typing, clicking, and taking screenshots.
    Last updated -

View all related MCP servers

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pshivapr/selenium-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server