MCP Servers

ๆจกๅž‹ไธŠไธ‹ๆ–‡ๅ่ฎฎๆœๅŠกๅ™จใ€ๆก†ๆžถใ€SDK ๅ’Œๆจกๆฟ็š„็ปผๅˆ็›ฎๅฝ•ใ€‚

S
Selenium MCP Natural Language Automation
ไฝœ่€… @mvsaran

๐ŸŽญ 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.

ๅˆ›ๅปบไบŽ 10/25/2025
ๆ›ดๆ–ฐไบŽ about 2 months 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!

ๅฟซ้€Ÿ่ฎพ็ฝฎ
ๆญคๆœๅŠกๅ™จ็š„ๅฎ‰่ฃ…ๆŒ‡ๅ—

ๅฎ‰่ฃ…ๅ‘ฝไปค ๏ผˆๅŒ…ๆœชๅ‘ๅธƒ๏ผ‰

git clone https://github.com/mvsaran/Selenium-MCP-Natural-Language-Automation
ๆ‰‹ๅŠจๅฎ‰่ฃ…๏ผš ่ฏทๆŸฅ็œ‹ README ่Žทๅ–่ฏฆ็ป†็š„่ฎพ็ฝฎ่ฏดๆ˜Žๅ’Œๆ‰€้œ€็š„ๅ…ถไป–ไพ่ต–้กนใ€‚

Cursor ้…็ฝฎ (mcp.json)

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