andbet39/selenium_mcp
If you are the rightful owner of selenium_mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
A TypeScript implementation of an MCP server that provides Selenium WebDriver automation capabilities.
MCP Selenium Server
A TypeScript implementation of an MCP (Model Context Protocol) server that provides Selenium WebDriver automation capabilities.
Overview
This MCP server provides web automation tools using Selenium WebDriver. It follows the official MCP TypeScript SDK patterns and uses stdio transport for communication.
Installation
# Install dependencies
npm install
# Build TypeScript
npm run build
# Run server
npm start
Development
# Watch mode (rebuilds on changes)
npm run dev
# Build only
npm run build
Usage
The server runs with stdio transport by default:
node ./dist/server.js
Features
- ✅ All essential Selenium WebDriver operations
- ✅ Support for Chrome, Firefox, and Edge browsers
- ✅ Simple state management (single browser session)
- ✅ Full TypeScript type safety
- ✅ Modern MCP SDK patterns
- ✅ Clean, maintainable code structure
Available Tools
Browser Management
start_browser- Launch Chrome, Firefox, or Edge browserclose_session- Close the current browser sessionget_session_info- Get information about current session
Navigation & Page Actions
navigate- Navigate to a URLtake_screenshot- Capture page screenshots
Element Interaction
click_element- Click on elementssend_keys- Type text into elementsget_element_text- Extract text from elements
Element Locator Strategies
All element interaction tools support these locator strategies:
id- Find by element IDcss- Find by CSS selectorxpath- Find by XPathname- Find by name attributetag- Find by tag nameclass- Find by class name
Example Usage
- Start a browser:
{
"browser": "chrome",
"options": {
"headless": false
}
}
- Navigate to a website:
{
"url": "https://example.com"
}
- Click an element:
{
"by": "id",
"value": "submit-button"
}
Architecture
This server follows the MCP TypeScript SDK documentation patterns:
- Uses
McpServerclass for server creation - Uses
StdioServerTransportfor communication - Simple state management without complex session handling
- Clean tool registration with proper schemas
- Proper error handling and cleanup