NS

naveenanimation20/selenium-mcp

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

6 stars 8 forks 품질 36 트렌드 14

selenium-mcp by Naveen Automation Labs

개요

A Java implementation of the Model Context Protocol (MCP) for Selenium WebDriver, enabling browser automation through standardized MCP clients. MCP Selenium provides a bridge between the Model Context Protocol and Selenium WebDriver. It allows AI assistants and other MCP-compatible clients to perform browser automation tasks using a standardized set of tools. - Java 11 or higher - Maven (for building) - Chrome or Firefox browser installed This will create the JAR file at target/mcp-selenium-0.1.0-jar-with-dependencies.jar. Start the MCP Selenium server from the command line: The server will start and wait for commands on standard input. You'll see the server information as initial output. You can now send JSON commands to the server. Type or paste the commands directly into the terminal, one per line. To stop the server, use Ctrl+C in the terminal.

README

원문 README의 일부입니다. 원문 보기.

MCP Selenium

A Java implementation of the Model Context Protocol (MCP) for Selenium WebDriver, enabling browser automation through standardized MCP clients.

Overview

MCP Selenium provides a bridge between the Model Context Protocol and Selenium WebDriver. It allows AI assistants and other MCP-compatible clients to perform browser automation tasks using a standardized set of tools.

Project Structure

selenium-mcp/
├── src/
│   └── main/
│       └── java/
│           └── io/
│               └── github/
│                   └── naveenautomation/
│                       └── mcpselenium/
│                           ├── McpSeleniumServer.java       # The main MCP server implementation
│                           ├── McpSeleniumLauncher.java     # Launcher script for the server
│                           └── AdvancedMcpClient.java       # GUI client for testing
├── target/
│   └── mcp-selenium-0.1.0-jar-with-dependencies.jar         # Compiled JAR with dependencies
└── pom.xml                                                  # Maven project configuration

Prerequisites

  • Java 11 or higher
  • Maven (for building)
  • Chrome or Firefox browser installed

Building the Project

# Clone the repository
git clone https://github.com/naveenautomation/selenium-mcp.git
cd selenium-mcp

# Build with Maven
mvn clean package

This will create the JAR file at target/mcp-selenium-0.1.0-jar-with-dependencies.jar.

Usage Options

Option 1: Command Line Usage

Starting the Server

Start the MCP Selenium server from the command line:

java -jar target/mcp-selenium-0.1.0-jar-with-dependencies.jar

The server will start and wait for commands on standard input. You’ll see the server information as initial output.

Sending Commands

You can now send JSON commands to the server. Type or paste the commands directly into the terminal, one per line.

Example Commands
  1. Start a Chrome browser:
{"type":"tool_call","tool_call_id":"call-1","name":"start_browser","params":{"browser":"chrome","options":{"headless":false}}}
  1. Navigate to a website:
{"type":"tool_call","tool_call_id":"call-2","name":"navigate","params":{"url":"https://www.example.com"}}
  1. Find an element:
{"type":"tool_call","tool_call_id":"call-3","name":"find_element","params":{"by":"css","value":"h1"}}
  1. Get element text:
{"type":"tool_call","tool_call_id":"call-4","name":"get_element_text","params":{"by":"css","value":"h1"}}
  1. Click an element:
{"type":"tool_call","tool_call_id":"call-5","name":"click_element","params":{"by":"id","value":"submit-button"}}
  1. Type text into an element:
{"type":"tool_call","tool_call_id":"call-6","name":"send_keys","params":{"by":"id","value":"search-box","text":"search query"}}
  1. Take a screenshot:
{"type":"tool_call","tool_call_id":"call-7","name":"take_screenshot","params":{"outputPath":"screenshot.png"}}
GitHub에서 전체 README 보기

설치

This server does not publish a one-line install command.

Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →