Skip to main content
Glama
juilanharkless

cloudflare-playwright-mcp

Cloudflare Playwright MCP の例

Cloudflare にデプロイ

概要

このプロジェクトは、Playwright with Cloudflare Workers を、Cloudflare Playwright MCP を使用した Model Control Protocol (MCP) サーバーとして使用する方法を示しています。

これにより、AI アシスタントは一連のツールを通じてブラウザを制御し、ナビゲーション、入力、クリック、スクリーンショット取得などの Web 自動化タスクを実行できるようになります。

このサーバーは、Cloudflare AI Playground、Claude Desktop、VS Code の GitHub Copilot など、さまざまな AI プラットフォームで使用できます。

デプロイ

プロジェクトをセットアップしてデプロイするには、次の手順に従います。

  1. 依存関係をインストールします:

npm ci
  1. Cloudflare Workers にデプロイします:

npx wrangler deploy

Cloudflare AI Playground で使用する

alt text

Cloudflare playground AI は、Workers AI で利用可能な LLM モデルを使用して MCP サーバーをテストするのに最適な方法です。

  • https://playground.ai.cloudflare.com/ に移動します。

  • モデルが llama-3.3-70b-instruct-fp8-fast に設定されていることを確認します。

  • MCP Servers で、URLhttps://[my-mcp-url].workers.dev/sse に設定します。

  • Connect をクリックします。

  • ステータスが Connected に更新され、利用可能なツールが 14 個表示されるはずです。

これでモデルとの対話を開始でき、要求されたことを達成するために必要なツールが実行されます。

[!TIP] 最良の結果を得るには、1 つのアクションだけからなる簡単な指示を与えてください。例: 「新しい TODO エントリを作成」「cloudflare サイトに移動」「スクリーンショットを撮る」

会話の例:

役割

メッセージ

ユーザー

demo.playwright.dev/todomvc に移動

アシスタント

browser_navigate ツールを実行 ページが https://demo.playwright.dev/todomvc/ に移動されました。ページタイトルは「React • TodoMVC」です。ページスナップショットには、見出し、テキストボックス、いくつかのリンクなど、ページのコンテンツが表示されています。

ユーザー

TODO エントリをいくつか作成

アシスタント

browser_type ツールを実行 新しい TODO エントリ「Buy groceries」が作成されました。ページスナップショットには、新しい TODO エントリを含む、更新されたページのコンテンツが表示されています。

ユーザー

いいね。では、オウム風の TODO を作成して

アシスタント

browser_type ツールを実行 オウム風の新しい TODO エントリ「Polly wants a cracker」が作成されました。ページスナップショットには、新しい TODO エントリを含む、更新されたページのコンテンツが表示されています。

ユーザー

そして、ヨーダ風の TODO をもう 1 つ作成して

アシスタント

browser_type ツールを実行 ヨーダ風の新しい TODO エントリ「A walk, I must take」が作成されました。ページスナップショットには、新しい TODO エントリを含む、更新されたページのコンテンツが表示されています。

ユーザー

スクリーンショットを撮って

アシスタント

browser_take_screenshot ツールを実行 alt text 現在のページのスクリーンショットが撮影されました。スクリーンショットは PNG 形式で、サイズは 56KB です。

ユーザー

次に、オウムの TODO エントリのチェックボックスをクリックして

アシスタント

browser_clickt ツールを実行 オウムの TODO エントリ「Polly wants a cracker」のチェックボックスがクリックされました。ページスナップショットには、チェックボックスがオンになった、更新されたページのコンテンツが表示されています。

ユーザー

スクリーンショットを撮って

アシスタント

browser_take_screenshot ツールを実行 alt text 現在のページのスクリーンショットが撮影されました。スクリーンショットは PNG 形式で、サイズは 58KB です。

ユーザー

完了した TODO エントリを削除して

アシスタント

browser_clickt ツールを実行 「Clear completed」ボタンがクリックされました。ページスナップショットには、完了した TODO エントリ「Polly wants a cracker」が削除された、更新されたページのコンテンツが表示されています。

ユーザー

最後のスクリーンショットを撮って

アシスタント

browser_take_screenshot ツールを実行 alt text 現在のページの最終スクリーンショットが撮影されました。スクリーンショットは PNG 形式で、サイズは 50KB です。

Claude Desktop で使用する

現時点では、Claude Desktop はローカル MCP サーバーのみをサポートしています。Claude Desktop で playground-mcp を使用するには、リモート MCP サーバーをプロキシしてローカルに公開するツールである mcp-remote を利用します。次の構成を使用してください。

  1. Claude Desktop の構成ファイルを開きます。

  2. mcpServers セクションの下に次の JSON スニペットを追加します:

{
  "mcpServers": {
    "cloudflare-playwright-mcp": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://[my-mcp-url].workers.dev/sse"
      ]
    }
  }
}
  1. 構成ファイルを保存し、変更を適用するために Claude Desktop を再起動します。

この設定により、Claude Desktop が Cloudflare Playwright MCP サーバーと通信できるようになります。

以下は、playwright-mcp ツールと Browser Rendering を利用して、TODO デモアプリを開き、「buy lemons」を追加してスクリーンショットを撮るセッションの例です:

alt text

VSCode で構成する

Playwright MCP サーバーは、VS Code CLI を使用してインストールできます:

# For VS Code
code --add-mcp '{"name":"cloudflare-playwright","type":"sse","url":"https://[my-mcp-url].workers.dev/sse"}'
# For VS Code Insiders
code-insiders --add-mcp '{"name":"cloudflare-playwright","type":"sse","url":"https://[my-mcp-url].workers.dev/sse"}'

インストール後、Playwright MCP サーバーは VS Code の GitHub Copilot エージェントで使用できるようになります。

F
license - not found
Not graded
quality - not tested
C
maintenance

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables AI assistants to control a browser through a set of tools, allowing them to perform web automation tasks like navigation, typing, clicking, and taking screenshots.
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables AI assistants to control a browser through a set of tools, allowing them to perform web automation tasks like navigation, typing, clicking, and taking screenshots.

View all related MCP servers

Related MCP Connectors

  • AI-powered browser automation — navigate, click, fill forms, and extract data from any website.

  • Provides cloud browser automation capabilities using Stagehand and Browserbase, enabling LLMs to i…

  • Reliable web access for AI agents: smart HTTP, rotating proxies, and full-browser rendering.

View all MCP Connectors

Latest Blog Posts

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/juilanharkless/playwright-mcp-agent37'

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