Selenium MCP Server
A powerful VS Code extension to control and automate browsers using your Selenium MCP server.

Features
- Start/stop the Selenium MCP server from VS Code
- Status bar indicator for server status
- Manage browser sessions (Chrome/Firefox, headless/full) in a sidebar
- Start/stop browser sessions
- Navigate, click, type, and take screenshots in browser sessions
- View server logs and screenshots directly in VS Code
- Configurable Python path, arguments, and working directory
- Quick Start onboarding and helpful error messages
- Full MCP tool coverage: All Selenium MCP server tools are available as Copilot/LLM tools
All of the following tools are registered and callable from Copilot, LLMs, and the MCP protocol. Usage examples show how to call each tool with sample arguments:
- start_browser: Launches browser with enhanced session management
{
"name": "start_browser",
"arguments": { "browser": "chrome", "options": { "headless": true } }
}
- list_sessions: Lists all active browser sessions
{ "name": "list_sessions", "arguments": {} }
- switch_session: Switches to a different browser session
{ "name": "switch_session", "arguments": { "session_id": "your-session-id" } }
- close_session: Closes a specific browser session
{ "name": "close_session", "arguments": { "session_id": "your-session-id" } }
- navigate: Navigates to a URL with enhanced error handling
{ "name": "navigate", "arguments": { "url": "https://example.com", "wait_for_load": true } }
- find_element: Finds an element with enhanced waiting
{ "name": "find_element", "arguments": { "by": "css", "value": "#my-element", "timeout": 5000 } }
- click_element: Clicks an element with enhanced error handling
{ "name": "click_element", "arguments": { "by": "css", "value": "#my-button", "force_click": true } }
- send_keys: Sends keys to an element with enhanced typing
{ "name": "send_keys", "arguments": { "by": "css", "value": "#input", "text": "hello", "clear_first": true } }
- get_element_text: Gets the text of an element
{ "name": "get_element_text", "arguments": { "by": "css", "value": "#output" } }
- hover: Moves the mouse to hover over an element
{ "name": "hover", "arguments": { "by": "css", "value": "#hover-target" } }
- drag_and_drop: Drags an element and drops it onto another element
{ "name": "drag_and_drop", "arguments": { "by": "css", "value": "#source", "targetBy": "css", "targetValue": "#target" } }
- double_click: Performs a double click on an element
{ "name": "double_click", "arguments": { "by": "css", "value": "#element" } }
- right_click: Performs a right click (context click) on an element
{ "name": "right_click", "arguments": { "by": "css", "value": "#element" } }
- press_key: Simulates pressing a keyboard key
{ "name": "press_key", "arguments": { "key": "Enter" } }
- upload_file: Uploads a file using a file input element
{ "name": "upload_file", "arguments": { "by": "css", "value": "input[type='file']", "filePath": "C:/Users/YourName/file.txt" } }
- take_screenshot: Captures a screenshot of the current page
{ "name": "take_screenshot", "arguments": { "full_page": true } }
- wait_for_element: Waits for an element to be present and optionally visible
{ "name": "wait_for_element", "arguments": { "by": "css", "value": "#wait-for-me", "wait_for_visible": true } }
- execute_script: Executes JavaScript code in the browser
{ "name": "execute_script", "arguments": { "script": "return document.title;" } }
- get_page_info: Gets information about the current page
{ "name": "get_page_info", "arguments": { "include_title": true, "include_url": true, "include_source": false } }
- get_server_version: Returns the current version of the Selenium MCP server
{ "name": "get_server_version", "arguments": {} }
Each tool exposes all its parameters and is fully documented in the extension and MCP server docs.
Requirements
Quick Start
- Install the Selenium MCP server (see server repo)
- Install this extension in VS Code (search for "Selenium MCP Server" or
krishnapollu.selenium-mcp-server )
- Start the MCP server: Use the status bar or Command Palette (
Start Selenium MCP Server )
- Open the MCP Sessions sidebar: Manage browser sessions
- Right-click a session for automation actions (navigate, click, type, screenshot, logs)
Installation
Selenium MCP Server on Visual Studio Marketplace

- From Marketplace:
Search for Selenium MCP Server in the VS Code Extensions view and click Install.
- From VSIX:
Download the latest .vsix from Marketplace or your GitHub releases, then run:
- Open Command Palette →
Extensions: Install from VSIX...
Usage
- Start/Stop Server: Use the status bar or Command Palette
- Manage Sessions: Use the MCP Sessions sidebar
- Automation Actions: Right-click a session for:
- Navigate Session
- Click Element (by CSS selector)
- Type Into Element
- Take Screenshot
- Show Server Logs
- Refresh Sessions: Use the refresh button in the sidebar
- Show Quick Start:
Show MCP Quick Start command in the palette
Prompting Cheat Sheet
Use these prompts and patterns to get the most out of the Selenium MCP Server extension and MCP server:
For AI/LLM Clients (Copilot, Cursor, Claude, etc.)
- Call any tool directly:
Use the selenium_mcp_server.<tool_name> tool with the required parameters.
Example: Call selenium_mcp_server.navigate with { "url": "https://example.com" } .
- Start a session:
Start a new Chrome session and navigate to https://example.com.
- Interact with elements:
Click the login button with selector #login .
Type 'myusername' into the username field and 'mypassword' into the password field, then click submit.
- Take screenshots or get logs:
Take a screenshot of the current page and show it in VS Code.
Show me the browser logs for this session.
- Session management:
List all active browser sessions and close the one running in headless mode.
For Manual Use in VS Code
- Use the Command Palette for actions like:
- Start Selenium MCP Server
- Start Browser Session
- Navigate Session
- Click Element
- Type Into Element
- Take Screenshot
- Show Server Logs
- Right-click sessions in the MCP Sessions sidebar for context actions.
For Custom Scripts (MCP Client API)
Prompting Tips
- Be specific: Specify browser, session, selector, and action.
- Use step-by-step instructions for complex flows.
- Request feedback: Ask for screenshots, logs, or confirmation after actions.
- Leverage session management: Start, stop, and list sessions as needed.
Configuration
Set these in your VS Code settings:
selenium-mcp-server.pythonPath : Path to Python executable
selenium-mcp-server.serverArgs : Arguments for MCP server (default: -m selenium_mcp_server )
selenium-mcp-server.workingDirectory : Working directory for the server
Troubleshooting
- Server not starting?
- Check your Python path and MCP server install
- See Output Channel for errors
- No sessions listed?
- Make sure the server is running
- Refresh the sidebar
- Automation commands not working?
- Check server logs for errors
- Ensure browser drivers are installed
Onboarding
- On first activation, a Quick Start guide is shown
- Use the
Show MCP Quick Start command anytime
- See this README for full details
Contributing
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page or submit a pull request.
License
MIT
Enjoy automating browsers with the power of VS Code and Selenium MCP!
| |