Selenium MCP Server
About
Control web browsers using the Selenium WebDriver for automation and testing.
Details
- Author
- themindmod
- Categories
- Web Scraping, Automation, Developer Tools
Jump to
Setup
Install Selenium MCP Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/themindmod/selenium-mcp-server
Follow the installation instructions in the repository README, then restart your MCP client.
Control web browsers using the Selenium WebDriver for automation and testing.
An MCP server that uses Selenium to interact with a WebDriver instance. Built using theMCP-Server-Startertemplate.
This server allows AI agents to control a web browser session via Selenium WebDriver, enabling tasks like web scraping, automated testing, and form filling through the Model Context Protocol.
- MCP Server: Exposes Selenium WebDriver actions as MCP tools.
- Selenium WebDriver: Interacts with the browser.
- MCP Clients: AI hosts (like Cursor, Claude Desktop) that can utilize the exposed tools.
- Node.js (v18 or later)
- npm (v7 or later)
- A WebDriver executable(e.g., ChromeDriver, GeckoDriver) installed and available in your system's PATH.
- A compatible web browser(e.g., Chrome, Firefox).
- Clone the repository:
git clone <your-repo-url> selenium-mcp-server cd selenium-mcp-server
- Ensure your WebDriver (e.g.,chromedriver) is installed and in your PATH.
- Modifysrc/seleniumService.ts(you'll create this file) if needed to specify browser options or WebDriver paths.
- selenium_navigate: Navigates the browser to a specific URL.
- selenium_findElement: Finds an element on the page using a CSS selector.
- selenium_click: Clicks an element.
- selenium_sendKeys: Sends keystrokes to an element.
- selenium_getPageSource: Retrieves the current page source HTML.
- (Add more tools as needed)
The server uses the@modelcontextprotocol/sdkandselenium-webdriverlibraries.
import { Server } from "@modelcontextprotocol/sdk/server/index.js"; import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { Builder, By, Key, until, WebDriver } from 'selenium-webdriver'; // Basic server setup (details in src/index.ts) const server = new Server({ name: "selenium-mcp-server", version: "0.1.0", capabilities: { tools: {}, // Enable tools capability } }); // Selenium WebDriver setup (details in src/seleniumService.ts) let driver: WebDriver; async function initializeWebDriver() { driver = await new Builder().forBrowser('chrome').build(); // Or 'firefox', etc. } // Example tool implementation (details in src/tools/) server.registerTool('selenium_navigate', { description: 'Navigates the browser to a specific URL.', inputSchema: { / ... zod schema ... / }, outputSchema: { / ... zod schema ... / }, handler: async (params) => { await driver.get(params.url); return { success: true }; } }); // Connect transport async function startServer() { await initializeWebDriver(); const transport = new StdioServerTransport(); await server.connect(transport); console.log("Selenium MCP Server connected via stdio."); // Graceful shutdown process.on('SIGINT', async () => { console.log("Shutting down WebDriver..."); if (driver) { await driver.quit(); } process.exit(0); }); } startServer();
- Build:npm run build
- Run:npm start(executesnode build/index.js)
- Lint:npm run lint
- Format:npm run format
Use the MCP Inspector or standard Node.js debugging techniques.
(Keep relevant sections from the original README for Cursor, Claude Desktop, Smithery, etc., updating paths and commands as necessary)
- Build your server:npm run build
- In Cursor:Settings>Features>MCP: Add a new MCP server.
- Register your server:
- Selectstdioas the transport type.
- Name:Selenium Server(or similar).
- Command:node /path/to/selenium-mcp-server/build/index.js.
- Build your server:npm run build
- Modifyclaude_desktop_config.json:
{ "mcpServers": { "selenium-mcp-server": { "command": "node", "args": [ "/path/to/selenium-mcp-server/build/index.js" ] } } }
- Use TypeScript and Zod for type safety and validation.
- Keep tools modular (e.g., one file per tool insrc/tools/).
- Handle WebDriver errors gracefully (e.g., element not found, navigation issues).
- Ensure proper WebDriver shutdown (e.g.,driver.quit()on server exit).
- Follow MCP best practices for schemas, error handling, and content types.
Official Playwright MCP server for browser automation, page inspection, screenshots, and web interaction from Claude, Cursor, and other AI agents.
Render website screenshots with ScreenshotOne
Attaches to existing browser sessions using the Chrome DevTools Protocol for automation and interaction.
Help your AI agent finish more browser tasks.
Automate remote browsers using the BrowserCat API.
Remote browser automation using the BrowserCat API.
Take screenshots and read console logs from web pages using Playwright.
Automate browser tasks using the Browser Use API.
A Node.js server that enables AI assistants to control the Chrome browser via WebSocket. Requires the CodingBaby Chrome Extension.
A configurable MCP server for browser automation using Puppeteer.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.


