Skip to main content
Glama
Playwright Server MCP

Playwright Server MCP

プレイライトサーバー MCP サーバー

\Playwrightツールを備えたMCPサーバー\

コンポーネント

リソース

サーバーは、次の機能を備えたシンプルなメモ保存システムを実装します。

  • 個々のノートにアクセスするためのカスタム note:// URI スキーム

  • 各ノートリソースには、名前、説明、text/plain mimetype があります。

プロンプト

サーバーは単一のプロンプトを提供します:

  • 要約ノート: 保存されているすべてのノートの要約を作成します

    • 詳細レベル(簡潔/詳細)を制御するためのオプションの「スタイル」引数

    • 現在のすべてのメモをスタイルの好みに合わせて組み合わせたプロンプトを生成します

ツール

サーバーは次のツールを実装します。

  • playwright_navigate : 指定されたURLへ移動します。アクティブなセッションがない場合、この操作は自動的に新しいセッションを作成します。

    • url引数 (文字列) が必要です。

  • playwright_screenshot : 現在のページまたは特定の要素のスクリーンショットを撮ります。

    • スクリーンショット ファイル名にはname引数 (文字列) が必要です。

    • スクリーンショットを撮影する要素のCSSセレクターを指定するためのオプションのselector引数(文字列)。セレクターが指定されていない場合は、ページ全体のスクリーンショットが撮影されます。

  • playwright_click : CSS セレクターを使用してページ上の要素をクリックします。

    • クリックする要素の CSS セレクターを指定するには、 selector引数 (文字列) が必要です。

  • playwright_fill : 入力フィールドに入力します。

    • 入力フィールドの CSS セレクターを指定するには、 selector引数 (文字列) が必要です。

    • 入力する値を指定するには、 value引数 (文字列) が必要です。

  • playwright_evaluate : ブラウザコンソールで JavaScript コードを実行します。

    • 実行する JavaScript コードを指定するには、 script引数 (文字列) が必要です。

  • playwright_click_text : ページ上の要素をテキストコンテンツでクリックします。

    • クリックする要素のテキスト コンテンツを指定するには、 text引数 (文字列) が必要です。

  • playwright_get_text_content : 表示されているすべての要素のテキスト コンテンツを取得します。

  • playwright_get_html_content : ページの HTML コンテンツを取得します。

    • 要素の CSS セレクターを指定するには、 selector引数 (文字列) が必要です。

Related MCP server: Cloudflare Playwright MCP

構成

[TODO: 実装に固有の構成の詳細を追加する]

クイックスタート

インストール

クロードデスクトップ

MacOS の場合: ~/Library/Application\ Support/Claude/claude_desktop_config.json Windows の場合: %APPDATA%/Claude/claude_desktop_config.json

発達

建築と出版

配布用のパッケージを準備するには:

  1. 依存関係を同期し、ロックファイルを更新します。

uv sync
  1. パッケージディストリビューションをビルドします。

uv build

これにより、 dist/ディレクトリにソースとホイールのディストリビューションが作成されます。

  1. PyPI に公開:

uv publish

注: 環境変数またはコマンド フラグを使用して PyPI 資格情報を設定する必要があります。

  • トークン: --tokenまたはUV_PUBLISH_TOKEN

  • またはユーザー名/パスワード: --username / UV_PUBLISH_USERNAMEおよび--password / UV_PUBLISH_PASSWORD

デバッグ

MCPサーバーはstdio経由で実行されるため、デバッグが困難になる場合があります。最適なデバッグ環境を実現するには、 MCP Inspectorの使用を強くお勧めします。

次のコマンドを使用して、 npm経由で MCP Inspector を起動できます。

npx @modelcontextprotocol/inspector uv --directory C:\Users\YUNYING\Documents\project\python\mcp\playwright-server run playwright-server

起動すると、ブラウザでアクセスしてデバッグを開始できる URL がインスペクタに表示されます。

Available Tools

8 tools
playwright_clickC

Click an element on the page using CSS selector

Inputs: selector (required).

playwright_click_textB

Click an element on the page by its text content

Inputs: text (required).

playwright_evaluateC

Execute JavaScript in the browser console

Inputs: script (required).

playwright_fillC

Fill out an input field

Inputs: selector (required), value (required).

playwright_get_html_contentC

Get the HTML content of the page

Inputs: selector (required).

playwright_get_text_contentB

Get the text content of all elements

Inputs: no named parameters.

playwright_navigateC

Navigate to a URL,thip op will auto create a session

Inputs: url (required).

playwright_screenshotC

Take a screenshot of the current page or a specific element

Inputs: name (required), selector.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 8 tools

    Disambiguation4/5

    Most tools have distinct purposes targeting different page interactions (clicking, filling, navigating, etc.), but 'playwright_get_html_content' and 'playwright_get_text_content' could potentially be confused as both retrieve content from the page, though their descriptions clarify the difference. Overall, the overlap is minimal and manageable.

    Naming Consistency5/5

    All tool names follow a consistent 'playwright_' prefix with snake_case and clear verb_noun patterns (e.g., playwright_click, playwright_navigate). This predictability makes it easy for agents to understand and select tools without confusion.

    Tool Count5/5

    With 8 tools, this server is well-scoped for a Playwright automation purpose, covering essential actions like navigation, interaction, content retrieval, and screenshots. Each tool serves a clear, necessary function without bloat or redundancy.

    Completeness4/5

    The toolset covers core web automation tasks effectively, including navigation, element interaction, content extraction, and screenshots. A minor gap exists in advanced operations like handling pop-ups, waiting for elements, or managing sessions explicitly, but agents can likely work around these with the provided tools.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers