Selenium MCP Server
Supported as a compatible web browser for WebDriver interaction, allowing the MCP server to automate Firefox browser sessions.
Allows AI agents to control web browser sessions through Selenium WebDriver, enabling web scraping, automated testing, and form filling by providing tools for navigation, element finding, clicking, sending keystrokes, and retrieving page content.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Selenium MCP Servernavigate to https://github.com and find the search input field"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Selenium MCP Server
smithery badge
An MCP server that uses Selenium to interact with a WebDriver instance. Built using the MCP-Server-Starter template.
Overview
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.
Related MCP server: mcp-selenium-python
Core Components
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.
Prerequisites
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).
Getting Started
Clone the repository:
git clone <your-repo-url> selenium-mcp-server cd selenium-mcp-serverInstall dependencies:
npm installConfigure WebDriver:
Ensure your WebDriver (e.g.,
chromedriver) is installed and in your PATH.Modify
src/seleniumService.ts(you'll create this file) if needed to specify browser options or WebDriver paths.
Build the server:
npm run buildRun the server:
npm startAlternatively, integrate it with an MCP host like Cursor or Claude Desktop (see Integration sections below).
Tools
This server will provide tools such as:
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)
TypeScript Implementation
The server uses the @modelcontextprotocol/sdk and selenium-webdriver libraries.
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();Development
Build:
npm run buildRun:
npm start(executesnode build/index.js)Lint:
npm run lintFormat:
npm run format
Debugging
Use the MCP Inspector or standard Node.js debugging techniques.
Integration with MCP Hosts
(Keep relevant sections from the original README for Cursor, Claude Desktop, Smithery, etc., updating paths and commands as necessary)
Cursor Integration
Build your server:
npm run buildIn Cursor:
Settings>Features>MCP: Add a new MCP server.Register your server:
Select
stdioas the transport type.Name:
Selenium Server(or similar).Command:
node /path/to/selenium-mcp-server/build/index.js.
Save.
Claude Desktop Integration
Build your server:
npm run buildModify
claude_desktop_config.json:{ "mcpServers": { "selenium-mcp-server": { "command": "node", "args": [ "/path/to/selenium-mcp-server/build/index.js" ] } } }Restart Claude Desktop.
Best Practices
Use TypeScript and Zod for type safety and validation.
Keep tools modular (e.g., one file per tool in
src/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.
Learn More
Credits
Based on the template created by Seth Rose:
Website: https://www.sethrose.dev
𝕏 (Twitter): https://x.com/TheSethRose
🦋 (Bluesky): https://bsky.app/profile/sethrose.dev
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityCmaintenanceEnables AI assistants to automate web browser interactions through Selenium WebDriver. Supports multi-browser automation, element interaction, navigation, and web testing capabilities.Last updated561526MIT
- Alicense-qualityDmaintenanceEnables LLMs to automate browser tasks (navigation, clicks, text input) via Selenium through the Model Context Protocol.Last updatedGPL 3.0
- Alicense-qualityDmaintenanceEnables AI agents to automate web tasks such as browsing, clicking, typing, and taking screenshots via the Model Context Protocol.Last updated1MIT
- AlicenseBqualityAmaintenanceEnables browser automation through the Model Context Protocol, allowing AI agents to control Chrome, Firefox, or Edge for tasks like navigation, clicking, typing, and screenshots.Last updated398MIT
Related MCP Connectors
Provides cloud browser automation capabilities using Stagehand and Browserbase, enabling LLMs to i…
AI-powered browser automation — navigate, click, fill forms, and extract data from any website.
Live browser debugging for AI assistants — DOM, console, network via MCP.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/themindmod/selenium-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server