MCP tools build using selenium to automate web testing or scraping
Selenium_MCP
This server is implemented in python to bridge the gap between the AI Assistant or (custom MCP clients) and Selenium Webdrivers. It exposes selenium webdriver functionalities as MCP tools allowing AI assistanct/MCP clients to user them to perform task for web automation, web testing or web scraping. It provide following set of tools to AI assistant/MCP clients:
- Web Driver: Create new or quit exiting webdiver sessions
- Cookies: To manage cookies (add, delete, get, clear)
- Clicks: To perform clicks on elements (left client, right click, double click)
- Browser: To navigate urls and manage browser capabilities like resize, maximize, minimize, fullscreen, etc.
- Scroll: To scroll the entire webpage
- Input: Input text into elements and select/unselect checkbox, radio buttons, dropdowns options, etc.
- Find: To find element by xPaths
Key Features
- Humanised error handleing, enables LLM to intreperate errors and reconfigure tool usage accordingly
- Comprehensive element interaction: Clicks, input, select are performed by checking if element is visible, enabled, clickable, etc
- Full Navigation control: Open New url, click forward, backward, refresh, etc
The tools leverages following technologies to support
- FastMCP: For MCP server implementation
- Selenium: For web automation
- Google GenAI: For AI assistant
Upcomming
Following are the list of features that will be added in the future:
- Tools to support Chrome Dev Tools & BiDi
- Tools to support Java Script Execution
- Tools to support Upload & Download of Files
Example
Prompt: "Open https://rfpnotification.com and join the waiting list by entering the email address: [test_user@example.com]"
|Before|After|
|------|-----|
|
|
|
After running the script, the browser took the screenshot to check if the email was entered successfully.

Test In Action

Dev Setup
Clone the repository
git clone {url}
Create virtual environment
python3 -m venv venv
source venv/bin/activate
Install dependencies
pip install -r requirements.txt
Run the server
python server.py
The package comes with a lightweight MCP client using Google GenAI SDK to test the server. It is implemented in server.py file. To use it, you need to have a Google GenAI API key. Set it in the .env file as GEMINI_API_KEY={your_api_key}.
Run the client
python server.py