Skip to main content
Glama

playwright-mcp の使い方

npmバージョン ドキュメント

導入

playwright-mcp(Model Context Protocol)は、AIアシスタントとブラウザ自動化のギャップを埋める強力なツールです。AIモデルがウェブブラウザと対話し、DOM要素を検査し、ユーザーインタラクションを記録し、より高精度なPlaywrightテストスクリプトを生成することを可能にします。このガイドでは、playwright-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使用をお勧めします)

もっと詳しく知る

さらに詳しく知りたいですか? 完全なドキュメントをご覧ください。

📖

Related MCP Servers

  • A
    security
    A
    license
    A
    quality
    A MCP server that provides browser automation tools, allowing users to navigate websites, take screenshots, click elements, fill forms, and execute JavaScript through Playwright.
    Last updated -
    8
    1
    Apache 2.0
    • Apple
  • A
    security
    F
    license
    A
    quality
    Playwright wrapper for MCP that enables LLM-powered clients to control a browser for automation tasks.
    Last updated -
    10
    1
  • A
    security
    A
    license
    A
    quality
    A browser automation server providing Playwright capabilities for controlling web browsers, capturing screenshots, extracting content, and performing complex interactions through an MCP interface.
    Last updated -
    6
    Apache 2.0
    • Apple
  • -
    security
    F
    license
    -
    quality
    A service that provides Playwright browser automation functionality through Model Context Protocol (MCP), allowing clients to use Playwright features via SSE connections.
    Last updated -
    6

View all related MCP servers

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Ashish-Bansal/playwright-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server