Skip to main content
Glama

playwright-mcp를 어떻게 사용하나요?

npm 버전 문서

소개

playwright-mcp(모델 컨텍스트 프로토콜)는 AI 어시스턴트와 브라우저 자동화 간의 간극을 메우는 강력한 도구입니다. AI 모델이 웹 브라우저와 상호 작용하고, DOM 요소를 검사하고, 사용자 상호작용을 기록하고, 더 높은 정확도로 Playwright 테스트 스크립트를 생성할 수 있도록 지원합니다. 이 가이드는 playwright-mcp를 효과적으로 설정하고 사용하는 방법을 안내합니다.

Related MCP server: browser-devtools-mcp

도구

브라우저 인터페이스에서 사용 가능한 도구:

브라우저 도구 상자

  1. DOM 선택(🎯): 페이지에서 HTML 요소를 선택하고 캡처하려면 클릭하세요. 테스트 케이스의 선택자를 기록하는 데 사용하세요.

  2. 이미지 선택(📸): 특정 요소의 스크린샷을 캡처하세요. 시각적 테스트나 문서화에 유용합니다.

  3. 상호작용 기록(📋): 클릭, 입력, 탐색 등 브라우저 상호작용을 기록합니다. 이러한 상호작용은 자동으로 선택자를 생성하며, Claude나 Cursor와 같은 MCP 클라이언트에 컨텍스트로 전달하여 테스트 케이스 작성에 도움을 줄 수 있습니다.

MCP 명령

  1. init-browser : Playwright 브라우저를 초기화합니다.

  2. get-context : 테스트 케이스를 작성하는 데 사용될 웹사이트 컨텍스트를 가져옵니다.

  3. execute-code : 현재 페이지에 대해 사용자 정의 Playwright JS 코드를 실행합니다.

  4. get-screenshot : 현재 페이지의 스크린샷을 가져옵니다

  5. get-full-dom : 현재 페이지의 전체 DOM을 가져옵니다. (대신 get-context 사용하는 것이 좋습니다.)

자세히 알아보기

더 자세히 알고 싶으신가요? 전체 문서를 확인해 보세요.

📖 문서 보기

Available Tools

5 tools
execute-codeA

Execute custom Playwright JS code against the current page

Inputs: code (required).

get-contextB

Get the website context which would be used to write the testcase

Inputs: no named parameters.

get-full-domA

Get the full DOM of the current page. (Deprecated, use get-context instead)

Inputs: no named parameters.

get-screenshotB

Get a screenshot of the current page

Inputs: no named parameters.

init-browserC

Initialize a browser with a URL

Inputs: url (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 5 tools

    Disambiguation3/5

    Most tools have distinct purposes, but get-context and get-full-dom overlap significantly, with the latter deprecated in favor of the former. This creates ambiguity about which to use for DOM-related tasks, though the deprecation note helps clarify.

    Naming Consistency4/5

    The tools follow a consistent verb_noun pattern with hyphens, such as execute-code and get-screenshot. The only minor deviation is init-browser, which uses 'init' instead of a more standard verb like 'initialize', but overall the naming is predictable and readable.

    Tool Count4/5

    With 5 tools, the count is reasonable for a Playwright automation server, covering core operations like initialization, execution, and inspection. It might benefit from additional tools for actions like navigation or element interaction, but it's well-scoped for basic functionality.

    Completeness3/5

    The tools cover initialization, code execution, and page inspection, but there are notable gaps for common Playwright workflows, such as navigation (e.g., go-to-url), element interaction (e.g., click, fill), or test assertion. This limits the server's ability to handle full automation tasks without workarounds.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers