MCP Servers

A collection of Model Context Protocol servers, templates, tools and more.

S
Selenium MCP Natural Language Automation

🎭 Transform natural language into browser automation with Selenium MCP Server. Write tests in plain English - no complex locators needed! Demo includes complete e-commerce flow automation.

Created 10/25/2025
Updated 6 days ago
Repository documentation and setup instructions

🎭 Selenium MCP Server Configuration & Demo

Transform Natural Language into Browser Automation Magic ✨

Selenium Java Maven TestNG


πŸ“– Table of Contents


🌟 Overview

Welcome to the future of test automation! This project showcases the revolutionary Selenium MCP Server, which transforms natural language commands into sophisticated browser automation workflows. Say goodbye to complex XPath expressions and hello to plain English test creation! πŸŽ‰


βš™οΈ Setup Guide

πŸ“ Step 1: Create Project Workspace

# Open VSCode and create a new folder for your project

πŸ”§ Step 2: Configure MCP Server

Navigate to: C:\Users\mvsar\AppData\Roaming\Code\User\mcp.json

Add the following configuration:

{
  "mcpServers": {
    "selenium": {
      "command": "npx",
      "args": [
        "-y",
        "@angiejones/mcp-selenium"
      ]
    }
  }
}

πŸ“¦ Step 3: Install MCP Package

npm install -g @angiejones/mcp-selenium

πŸ—οΈ Step 4: Generate Maven Project

Open Command Prompt in VSCode terminal and run:

mvn archetype:generate -DgroupId=com.selenium.mcp -DartifactId=selenium-mcp-tests -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

πŸ“‚ Project Structure Created:

selenium-mcp-tests/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main/
β”‚   β”‚   └── java/
β”‚   └── test/
β”‚       └── java/
└── pom.xml

πŸ“ Step 5: Update pom.xml

Add these dependencies and plugins:

<dependencies>
    <!-- Selenium WebDriver -->
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>4.15.0</version>
    </dependency>
    
    <!-- TestNG -->
    <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>7.8.0</version>
        <scope>test</scope>
    </dependency>
    
    <!-- WebDriverManager -->
    <dependency>
        <groupId>io.github.bonigarcia</groupId>
        <artifactId>webdrivermanager</artifactId>
        <version>5.6.2</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>3.0.0</version>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.11.0</version>
            <configuration>
                <source>11</source>
                <target>11</target>
            </configuration>
        </plugin>
    </plugins>
</build>

πŸ”„ Step 6: Install Dependencies

cd selenium-mcp-tests
mvn clean install

🚦 Step 7: Start MCP Server

πŸ”΄ CRITICAL: Server must be running before generating tests!

  1. Open VS Code Command Palette:

    • Windows/Linux: Ctrl + Shift + P
    • macOS: Cmd + Shift + P
  2. Type: MCP: List Servers

  3. Find selenium in the server list

  4. Click Start button

  5. βœ… Verify status shows "Running" with green indicator


🎯 Magic Prompt Demo

πŸͺ„ The Single Command That Does It All

use selenium mcp server visit https://www.demoblaze.com/ 
select Samsung galaxy s6 product 
add to the cart and checkout

That's it! Watch as the MCP Server:

  • 🌐 Launches the browser
  • πŸ” Navigates to the website
  • 🎯 Identifies product elements
  • πŸ›’ Handles cart operations
  • βœ… Completes checkout flow
  • πŸ§ͺ Generates test code automatically

πŸ”„ How It Works

🎨 Automation Flow

graph TD
    A[🎀 Natural Language Input] --> B[🧠 MCP Server Processing]
    B --> C[πŸ” Element Detection]
    C --> D[🌐 Browser Launch]
    D --> E[πŸͺ Navigate to DemoBlaze]
    E --> F[πŸ“± Select Samsung Galaxy S6]
    F --> G[πŸ›’ Add to Cart]
    G --> H[πŸ’³ Checkout Process]
    H --> I[βœ… Test Generation]
    I --> J[πŸ“Š Verification Complete]

⚑ Key Automation Steps

| Step | Action | MCP Handling | |------|--------|--------------| | 1️⃣ | Browser Launch | Automatic driver management | | 2️⃣ | Navigation | URL routing & page load wait | | 3️⃣ | Product Selection | Smart element identification | | 4️⃣ | Cart Management | Click handling & alerts | | 5️⃣ | Checkout | Form interactions & submission | | 6️⃣ | Verification | Test code generation |


πŸ’» Tech Stack

Java-21-ED8B00?style=flat&logo=openjdk - Selenium MCP Natural Language Automation by mvsaran
Java 21
Selenium-4 - Selenium MCP Natural Language Automation by mvsaran
Selenium
TestNG-7 - Selenium MCP Natural Language Automation by mvsaran
TestNG
Maven-3 - Selenium MCP Natural Language Automation by mvsaran
Maven
WebDriverManager-5 - Selenium MCP Natural Language Automation by mvsaran
WebDriverManager
MCP_Server-Latest-9B59B6?style=flat - Selenium MCP Natural Language Automation by mvsaran
Selenium MCP
VSCode-Latest-007ACC?style=flat&logo=visualstudiocode - Selenium MCP Natural Language Automation by mvsaran
VS Code
Node - Selenium MCP Natural Language Automation by mvsaran
NPX

πŸš€ Running Tests

πŸ’¬ Open GitHub Copilot in VS Code

Simply type your natural language command:

use selenium mcp server visit https://www.demoblaze.com/ 
select Samsung galaxy s6 product 
add to the cart and checkout

🎬 What Happens Next:

  1. πŸ€– MCP Server interprets your command
  2. 🌐 Browser launches automatically
  3. πŸ” Consent prompt appears (grant permission)
  4. ⚑ Automation executes the workflow
  5. πŸ“ Test code is generated automatically
  6. βœ… Verification completes

✨ Key Features

🎯 Core Benefits

| Feature | Description | Impact | |---------|-------------|--------| | πŸ“ Natural Language | Write tests in plain English | 10x faster test creation | | πŸ” Smart Detection | Automatic element identification | No locator maintenance | | ⏱️ Auto-Timing | Intelligent wait mechanisms | No explicit waits needed | | 🚨 Alert Handling | Built-in popup management | Seamless flow handling | | πŸ”„ Synchronization | Smart state management | Reduced flakiness | | 🎨 Code Generation | Creates maintainable tests | Professional quality code |

🌟 Why This Matters

Traditional Approach 🐌

driver.get("https://www.demoblaze.com/");
WebDriverWait wait = new WebDriverWait(driver, 10);
WebElement product = wait.until(ExpectedConditions.elementToBeClickable(
    By.xpath("//a[contains(text(),'Samsung galaxy s6')]")));
product.click();
// ... 50+ more lines of code

MCP Server Approach πŸš€

use selenium mcp server visit https://www.demoblaze.com/ select Samsung galaxy s6 product add to the cart and checkout

πŸŽ‰ Results & Achievements

βœ… Complete E-Commerce Flow Automated

  • πŸͺ Product browsing
  • πŸ›’ Cart management
  • πŸ’³ Checkout process
  • ✨ Alert handling
  • πŸ“Š Data validation

πŸ“ˆ Metrics

  • Lines of Code: 1 prompt vs 100+ lines
  • Development Time: 2 minutes vs 2 hours
  • Maintenance: Minimal vs High
  • Readability: English vs Technical

🎨 Test Scenario Visualization

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  🌐 Browser Launch                      β”‚
β”‚           ↓                             β”‚
β”‚  πŸͺ Visit DemoBlaze Store               β”‚
β”‚           ↓                             β”‚
β”‚  πŸ” Browse Products                     β”‚
β”‚           ↓                             β”‚
β”‚  πŸ“± Select Samsung Galaxy S6            β”‚
β”‚           ↓                             β”‚
β”‚  πŸ›’ Add to Cart                         β”‚
β”‚           ↓                             β”‚
β”‚  🚨 Handle Alert                        β”‚
β”‚           ↓                             β”‚
β”‚  πŸ’³ Navigate to Checkout                β”‚
β”‚           ↓                             β”‚
β”‚  πŸ“ Complete Purchase Form              β”‚
β”‚           ↓                             β”‚
β”‚  βœ… Verification & Test Generation      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ† Success Story

This demo proves that natural language automation is not just a conceptβ€”it's a reality! The Selenium MCP Server bridges the gap between human intent and browser automation, making test creation accessible to everyone from developers to QA analysts to product managers.


πŸŽ“ Learning Resources


🀝 Contributing

Found this helpful? Star ⭐ the repository and share your experience!


πŸ“„ License

This project is open source and available for educational purposes.


πŸ’‘ "The best code is the code you don't have to write"


πŸ‘¨β€πŸ’» Author

Saran Kumar

GitHub-100000?style=for-the-badge&logo=github&logoColor=white - Selenium MCP Natural Language Automation by mvsaran LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white - Selenium MCP Natural Language Automation by mvsaran

Created with ❀️ using Selenium MCP Server


⭐ If you found this helpful, please star this repository!

Quick Setup
Installation guide for this server

Installation Command (package not published)

git clone https://github.com/mvsaran/Selenium-MCP-Natural-Language-Automation
Manual Installation: Please check the README for detailed setup instructions and any additional dependencies required.

Cursor configuration (mcp.json)

{ "mcpServers": { "mvsaran-selenium-mcp-natural-language-automation": { "command": "git", "args": [ "clone", "https://github.com/mvsaran/Selenium-MCP-Natural-Language-Automation" ] } } }