MCP Selenium server in JavaScript
This folder contains a JavaScript implementation of a basic Model Context Protocol (MCP) server. This server provides a set of tools for an AI agent to control a web browser using Selenium. This MCP server exposes the following tools:
open_browser: Launches a new browser instance (e.g., Chrome, Firefox).navigate_url: Navigates the open browser to a specified URL.get_browser_text: Retrieves the visible text content of the current page.close_browser: Closes the current browser instance.
Prerequisites
- Install dependencies:
bash
npm install- Run the server:
bash
npm start- Alternatively, you can debug the MCP server using the MCP Inspector:
bash
npx @modelcontextprotocol/inspector node mcp-selenium-server.jsOutput
The server communicates via standard input/output (stdio) and is intended to be used as an MCP server by an AI client.
If you use the MCP inspector for debugging, once connected, it will display the available tools. You can now use its user interface to execute these tools.
