Skip to main content
Glama

劇作家-MCP

MCP(モデルコンテキストプロトコル)用のPlaywrightラッパー。このサーバーにより、LLM対応クライアントはブラウザを制御でき、自動化タスクを実行できます。

コンポーネント

リソース

サーバーはブラウザのスクリーンショットにアクセスするためのリソースを公開します。

  • スクリーンショットリソースURI: screenshot://{page_id}

  • スクリーンショットリソースは、開いているすべてのページで自動的に利用可能になります。

プロンプト

サーバーは、クライアントが Web ページを解釈できるようにプロンプトを提供します。

  • interpret-page : 現在のウェブページのコンテンツと構造を分析します

    • 解釈するページを選択するためのオプションのpage_id引数

    • 特定の側面(フル、フォーム、ナビゲーション、テキスト)に焦点を当てるためのオプションのfocus引数

    • テキスト分析とページのスクリーンショットの両方を返します

ツール

サーバーは包括的なブラウザ自動化ツールのセットを実装します。

  • ブラウザナビゲーション

    • navigate : 特定のURLに移動する

    • new_page : 特定のIDで新しいブラウザページを作成する

    • switch_page : 別のブラウザページに切り替える

    • get_pages : 利用可能なすべてのブラウザページを一覧表示する

  • ページインタラクション

    • click : CSSセレクターを使用して要素をクリックする

    • type : 入力要素にテキストを入力する

    • wait_for_selector : 要素がページに表示されるまで待つ

  • コンテンツ抽出

    • get_text : 要素からテキストコンテンツを取得する

    • get_page_content : ページ全体のHTMLを取得する

    • take_screenshot : ページまたは要素の視覚的な状態をキャプチャします

Related MCP server: mcp-browser-automation

構成

依存関係をインストールする

uv add playwright
playwright install chromium

クイックスタート

インストール

クロードデスクトップ

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

"mcpServers": {
  "playwright-mcp": {
    "command": "uv",
    "args": [
      "--directory",
      "/Users/shannon/Workspace/artivus/playwright-mcp",
      "run",
      "playwright-mcp"
    ]
  }
}
"mcpServers": {
  "playwright-mcp": {
    "command": "uvx",
    "args": [
      "playwright-mcp"
    ]
  }
}

発達

建築と出版

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

  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 /Users/shannon/Workspace/artivus/playwright-mcp run playwright-mcp

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

Available Tools

10 tools
clickC

Click on an element by selector

Inputs: selector (required), page_id.

get_page_contentC

Get the current page HTML content

Inputs: page_id.

get_pagesB

List all available browser pages

Inputs: no named parameters.

get_textC

Get text content from an element

Inputs: selector (required), page_id.

new_pageC

Create a new browser page

Inputs: page_id (required).

switch_pageC

Switch to a different browser page

Inputs: page_id (required).

take_screenshotC

Take a screenshot of the current page

Inputs: page_id, selector.

typeC

Type text into an input element

Inputs: selector (required), text (required), page_id.

wait_for_selectorC

Wait for an element to be visible on the page

Inputs: selector (required), page_id, timeout.

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 10 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with no ambiguity. For example, 'click' is for interacting with elements, 'navigate' is for URL changes, and 'take_screenshot' is for capturing visual output. The descriptions make it easy to differentiate between element interaction tools like 'click', 'type', and 'get_text'.

    Naming Consistency4/5

    The naming follows a consistent verb-based pattern with clear actions like 'click', 'navigate', and 'type'. There are minor deviations with 'get_page_content' and 'get_text' using 'get_' prefix while others use simple verbs, but overall the naming is highly readable and predictable.

    Tool Count5/5

    With 10 tools, this is well-scoped for a Playwright automation server. Each tool earns its place by covering essential browser automation tasks like navigation, page management, element interaction, and content retrieval without being overwhelming or redundant.

    Completeness5/5

    The toolset provides complete coverage for core browser automation workflows. It includes navigation, page management, element interaction, content retrieval, and screenshot capabilities. There are no obvious gaps—agents can perform full automation sequences from start to finish.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Exposes Playwright browser automation as MCP tools, enabling AI assistants to control a real browser tab-by-tab for form filling, navigation, and more, while preserving the user's active session.
      -
    • A
      license
      B
      quality
      D
      maintenance
      An MCP server for generic browser automation using Playwright. Enables MCP clients to navigate pages, inspect elements, execute JavaScript, capture screenshots, and monitor console logs and network traffic via a headless Chromium instance.
      7
      ISC
    • A
      license
      A
      quality
      D
      maintenance
      Enables MCP clients to automate a real Chrome browser via Playwright, supporting session sharing and tools for navigation, clicking, typing, and more.
      11
      108 npm
      2
      MIT
    • A
      license
      C
      quality
      D
      maintenance
      Exposes a remote browser as MCP tools via Playwright, enabling AI agents to navigate and interact with web pages through DOM snapshots, clicks, typing, and form operations.
      40
      14 npm
      14
      Apache 2.0