cloudflare-playwright-mcp
Cloudflare Playwright MCP の例
概要
このプロジェクトは、Playwright with Cloudflare Workers を、Cloudflare Playwright MCP を使用した Model Control Protocol (MCP) サーバーとして使用する方法を示しています。
これにより、AI アシスタントは一連のツールを通じてブラウザを制御し、ナビゲーション、入力、クリック、スクリーンショット取得などの Web 自動化タスクを実行できるようになります。
このサーバーは、Cloudflare AI Playground、Claude Desktop、VS Code の GitHub Copilot など、さまざまな AI プラットフォームで使用できます。
デプロイ
プロジェクトをセットアップしてデプロイするには、次の手順に従います。
依存関係をインストールします:
npm ciCloudflare Workers にデプロイします:
npx wrangler deployCloudflare AI Playground で使用する

Cloudflare playground AI は、Workers AI で利用可能な LLM モデルを使用して MCP サーバーをテストするのに最適な方法です。
モデルが
llama-3.3-70b-instruct-fp8-fastに設定されていることを確認します。MCP Servers で、URL を
https://[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 ツールを実行 |
ユーザー | 次に、オウムの TODO エントリのチェックボックスをクリックして |
アシスタント | browser_clickt ツールを実行 オウムの TODO エントリ「Polly wants a cracker」のチェックボックスがクリックされました。ページスナップショットには、チェックボックスがオンになった、更新されたページのコンテンツが表示されています。 |
ユーザー | スクリーンショットを撮って |
アシスタント | browser_take_screenshot ツールを実行 |
ユーザー | 完了した TODO エントリを削除して |
アシスタント | browser_clickt ツールを実行 「Clear completed」ボタンがクリックされました。ページスナップショットには、完了した TODO エントリ「Polly wants a cracker」が削除された、更新されたページのコンテンツが表示されています。 |
ユーザー | 最後のスクリーンショットを撮って |
アシスタント | browser_take_screenshot ツールを実行 |
Claude Desktop で使用する
現時点では、Claude Desktop はローカル MCP サーバーのみをサポートしています。Claude Desktop で playground-mcp を使用するには、リモート MCP サーバーをプロキシしてローカルに公開するツールである mcp-remote を利用します。次の構成を使用してください。
Claude Desktop の構成ファイルを開きます。
mcpServersセクションの下に次の JSON スニペットを追加します:
{
"mcpServers": {
"cloudflare-playwright-mcp": {
"command": "npx",
"args": [
"mcp-remote",
"https://[my-mcp-url].workers.dev/sse"
]
}
}
}構成ファイルを保存し、変更を適用するために Claude Desktop を再起動します。
この設定により、Claude Desktop が Cloudflare Playwright MCP サーバーと通信できるようになります。
以下は、playwright-mcp ツールと Browser Rendering を利用して、TODO デモアプリを開き、「buy lemons」を追加してスクリーンショットを撮るセッションの例です:

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 エージェントで使用できるようになります。
This server cannot be deployed
Related MCP Connectors
Control a real browser from AI agents: navigate, click, type, screenshot, read the page.
AI-powered browser automation — navigate, click, fill forms, and extract data from any website.
Let your AI agent operate any website through a real, logged-in browser session.
Web data extraction and browser workflows for AI assistants.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables 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.Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables 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.Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables 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.Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables 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.Apache 2.0
現在のページのスクリーンショットが撮影されました。スクリーンショットは PNG 形式で、サイズは 56KB です。
現在のページのスクリーンショットが撮影されました。スクリーンショットは PNG 形式で、サイズは 58KB です。
現在のページの最終スクリーンショットが撮影されました。スクリーンショットは PNG 形式で、サイズは 50KB です。