Skip to main content
Glama
SeleniumMCP
by Lokii0911

Selenium MCP 서버

Selenium 브라우저 자동화를 위한 배포 준비가 완료된 Python MCP 서버입니다. 로컬 STDIO 사용과 /mcp에서의 프로덕션 스타일 스트리밍 HTTP를 지원하며, 컨테이너 플랫폼을 위한 상태 확인 엔드포인트도 제공합니다.

도구

  • browser_start, browser_stop, browser_reset, browser_state

  • navigate, go_back, go_forward, refresh

  • set_window_size, open_new_tab, switch_window, close_window

  • find_element, wait_for_element, click, type_text

  • get_text, get_attribute, execute_script, scroll

  • page_source, screenshot, save_screenshot

  • list_cookies, add_cookie, delete_cookies

로케이터 전략: id, name, css selector, xpath, link text, partial link text, tag name, class name.

Related MCP server: Selenium MCP Server

HTTP 엔드포인트

  • POST /mcp 및 관련 스트리밍 가능 HTTP MCP 호출

  • GET /healthz

  • GET /readyz

  • POST /browser/start

  • POST /browser/stop

로컬 설정

Windows Python 필수 조건

PowerShell에서 Python was not found라고 표시되면 먼저 Python 3.11 이상을 설치하세요. 가장 빠른 방법은 다음과 같습니다:

winget install Python.Python.3.12

그런 다음 PowerShell을 닫았다가 다시 여세요. python --version이 여전히 Microsoft Store 프롬프트를 열면 다음 위치에서 python.exe 및 python3.exe 앱 실행 별칭을 비활성화하세요:

Settings > Apps > Advanced app settings > App execution aliases
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

PowerShell:

python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -e ".[dev]"

로컬 STDIO MCP 서버로 실행:

selenium-mcp

스트리밍 가능 HTTP MCP 서버로 실행:

selenium-mcp-http

그런 다음 MCP 클라이언트를 다음에 연결하세요:

http://localhost:8000/mcp

Claude Desktop 예시

{
  "mcpServers": {
    "selenium": {
      "command": "selenium-mcp",
      "env": {
        "SELENIUM_BROWSER": "chrome",
        "SELENIUM_HEADLESS": "true"
      }
    }
  }
}

Docker

컨테이너 내 Chromium 브라우저로 빌드 및 실행:

docker build -t selenium-mcp .
docker run --rm -p 8000:8000 selenium-mcp

전용 Selenium Grid 브라우저 컨테이너로 실행:

docker compose up --build

구성

.env.example을 .env로 복사하고 조정하세요:

SELENIUM_BROWSER=chrome
SELENIUM_HEADLESS=true
SELENIUM_REMOTE_URL=
SELENIUM_IMPLICIT_WAIT_SECONDS=2
SELENIUM_PAGE_LOAD_TIMEOUT_SECONDS=30
SELENIUM_SCRIPT_TIMEOUT_SECONDS=30
SELENIUM_WINDOW_WIDTH=1440
SELENIUM_WINDOW_HEIGHT=1000
SELENIUM_ALLOW_FILE_URLS=false
SELENIUM_DEFAULT_DOWNLOAD_DIR=/tmp/selenium-downloads
SELENIUM_HTTP_HOST=0.0.0.0
SELENIUM_HTTP_PORT=8000
SELENIUM_MCP_TRANSPORT=stdio

원격 Selenium Grid의 경우 다음을 설정하세요:

SELENIUM_REMOTE_URL=http://selenium:4444/wd/hub

보안 참고 사항

이 서버는 웹을 탐색하고, JavaScript를 실행하며, 페이지 HTML을 읽고, 호스트에 스크린샷을 저장할 수 있습니다. 프로덕션 환경에서는 잠긴 컨테이너나 VM에서 실행하고, 아웃바운드 네트워크 액세스를 제한하며, SELENIUM_ALLOW_FILE_URLS=false로 유지하고, HTTP MCP 엔드포인트를 플랫폼 인증 계층 뒤에 배치하세요.

유효성 검사

ruff check .
pytest

Available Tools

26 tools
browser_resetB

Restart the Selenium browser session.

Inputs: no named parameters. Returns: object

browser_startA

Start a Selenium browser session if one is not already running.

Inputs: no named parameters. Returns: object

browser_stateA

Return session id, URL, title, and window information.

Inputs: no named parameters. Returns: object

browser_stopA

Stop the current Selenium browser session.

Inputs: no named parameters. Returns: object

clickC

Click an element located by CSS selector, XPath, id, name, text, tag, or class.

Inputs: strategy (required), value (required), timeout_seconds. Returns: object

close_windowA

Close the active browser window or tab.

Inputs: no named parameters. Returns: object

delete_cookiesA

Delete all browser cookies.

Inputs: no named parameters. Returns: object

execute_scriptC

Execute JavaScript in the active page and return the JSON-serializable result.

Inputs: script (required), args. Returns: object

find_elementD

Find an element and return a compact summary of it.

Inputs: strategy (required), value (required), timeout_seconds. Returns: object

get_attributeB

Return one DOM attribute for an element.

Inputs: strategy (required), value (required), attribute (required), timeout_seconds. Returns: object

get_textC

Return the visible text for an element.

Inputs: strategy (required), value (required), timeout_seconds. Returns: object

go_backA

Navigate one step back in browser history.

Inputs: no named parameters. Returns: object

go_forwardA

Navigate one step forward in browser history.

Inputs: no named parameters. Returns: object

list_cookiesA

Return browser cookies for the current domain.

Inputs: no named parameters. Returns: object

open_new_tabB

Open a new browser tab and optionally navigate it to a URL.

Inputs: url. Returns: object

page_sourceA

Return the current page HTML.

Inputs: no named parameters. Returns: object

refreshA

Refresh the current page.

Inputs: no named parameters. Returns: object

save_screenshotB

Save a PNG screenshot to a server-local path and return the path.

Inputs: path (required). Returns: object

screenshotA

Return a PNG screenshot as base64.

Inputs: no named parameters. Returns: object

scrollC

Scroll the current page by the given x and y offsets.

Inputs: x, y. Returns: object

set_window_sizeC

Set the browser window size.

Inputs: width (required), height (required). Returns: object

switch_windowC

Switch to a browser window or tab by Selenium window handle.

Inputs: handle (required). Returns: object

type_textC

Type text into an element, optionally clearing it first.

Inputs: strategy (required), value (required), text (required), clear_first, +1 more. Returns: object

wait_for_elementC

Wait until an element exists, or until it is visible when requested.

Inputs: strategy (required), value (required), timeout_seconds, visible. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 26 tools

    Disambiguation4/5

    Tools are mostly distinct; find_element and wait_for_element have some conceptual overlap but descriptions clarify their different return behaviors. Overall, tools serve clear, separate purposes.

    Naming Consistency5/5

    All tools use consistent snake_case with verb_noun pattern (e.g., add_cookie, close_window, browser_start). Naming is predictable and follows a clear convention.

    Tool Count5/5

    26 tools cover browser lifecycle, navigation, element interaction, cookies, screenshots, and scripting. Each tool earns its place; the count is well-scoped for a Selenium automation server.

    Completeness4/5

    Core workflows are covered (start/stop, navigation, elements, cookies, screenshots). Minor gaps exist (frame switching, alert handling) but do not hinder primary use cases.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides browser automation using Selenium, supporting Chrome and Firefox, with tools for navigation, element interaction, screenshots, and more.
      1
      Mulan Permissive Software , Version 2