Cloudflare Playwright MCP MCP Server

$npm ci && npx wrangler deploy
README.md

Enables AI assistants to perform web automation tasks using Playwright.

Cloudflare Playwright MCP Example

Overview

This project demonstrates how to use Playwright with Cloudflare Workers as a Model Control Protocol (MCP) server using Cloudflare Playwright MCP.

It 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.

The server can be used with various AI platforms including Cloudflare AI Playground, Claude Desktop, and GitHub Copilot in VS Code.

Deploy

Follow these steps to set up and deploy the project:

  1. Install dependencies:
npm ci
  1. Deploy to Cloudflare Workers:
npx wrangler deploy

Use with Cloudflare AI Playground

alt text

Cloudflare playground AI is a great way to test MCP servers using LLM models available in Workers AI.

  • Navigate to https://playground.ai.cloudflare.com/
  • Ensure model is set to llama-3.3-70b-instruct-fp8-fast
  • In MCP Servers, set URL to https://[my-mcp-url].workers.dev/sse
  • Click Connect
  • Status should update to Connected and it should list 14 available tools

You can now start to interact with the model, and it will run necessary tools to accomplish what was requested.

[!TIP] For best results, give simple instructions consisting of one single action, e. g., "Create a new todo entry", "Go to cloudflare site", "Take a screenshot"

Example of a conversation:

Role Message
User Go to demo.playwright.dev/todomvc
Assistant runs browser_navigate tool The page has been navigated to https://demo.playwright.dev/todomvc/. The page title is "React • TodoMVC". The page snapshot shows the content of the page, including a heading, a textbox, and several links.
User Create some todo entry
Assistant runs browser_type tool A new todo entry "Buy groceries" has been created. The page snapshot shows the updated content of the page, including the new todo entry.
User Nice. Now create a todo in parrot style
Assistant runs browser_type tool A new todo entry "Polly wants a cracker" has been created in parrot style. The page snapshot shows the updated content of the page, including the new todo entry.
User And create another todo in yoda style
Assistant runs browser_type tool A new todo entry "A walk, I must take" has been created in Yoda style. The page snapshot shows the updated content of the page, including the new todo entry.
User Take a screenshot
Assistant runs browser_take_screenshot tool alt text A screenshot of the current page has been taken. The screenshot is in PNG format and is 56KB in size.
User Now click the checkbox of the parrot todo entry
Assistant runs browser_clickt tool The checkbox of the parrot todo entry "Polly wants a cracker" has been clicked. The page snapshot shows the updated content of the page, with the checkbox now checked.
User Take a screenshot
Assistant runs browser_take_screenshot tool alt text A screenshot of the current page has been taken. The screenshot is in PNG format and is 58KB in size.
User Remove completed todo entries
Assistant runs browser_clickt tool The "Clear completed" button has been clicked. The page snapshot shows the updated content of the page, with the completed todo entry "Polly wants a cracker" removed.
User Take a final screenshot
Assistant runs browser_take_screenshot tool alt text A final screenshot of the current page has been taken. The screenshot is in PNG format and is 50KB in size.

Use with Claude Desktop

As of now, Claude Desktop only supports local MCP servers. To use playground-mcp with Claude Desktop we make use of mcp-remote, a tool that proxies remote MCP servers and exposes them locally. Use the following configuration:

  1. Open the configuration file for Claude Desktop.
  2. Add the following JSON snippet under the mcpServers section:
{
  "mcpServers": {
    "cloudflare-playwright-mcp": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://[my-mcp-url]

Tools (4)

browser_navigateNavigate the browser to a specific URL.
browser_typeType text into a specific element or field on the page.
browser_clickClick on a specific element on the page.
browser_take_screenshotCapture a screenshot of the current page state.

Configuration

claude_desktop_config.json
{
  "mcpServers": {
    "cloudflare-playwright-mcp": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://[my-mcp-url].workers.dev/sse"
      ]
    }
  }
}

Try it

Go to demo.playwright.dev/todomvc
Create a new todo entry called 'Buy groceries'
Take a screenshot of the current page
Click the checkbox of the parrot todo entry
Remove completed todo entries

Frequently Asked Questions

What are the key features of Cloudflare Playwright MCP?

Web automation including navigation, typing, and clicking. Screenshot capture of current browser state. Deployment on Cloudflare Workers for remote execution. Support for SSE (Server-Sent Events) connectivity. Integration with Claude Desktop and GitHub Copilot.

What can I use Cloudflare Playwright MCP for?

Automated testing of web applications via natural language. Remote browser interaction through AI assistants. Visual verification of web pages using screenshots. Automating repetitive form-filling tasks. Interacting with web-based Todo applications.

How do I install Cloudflare Playwright MCP?

Install Cloudflare Playwright MCP by running: npm ci && npx wrangler deploy

What MCP clients work with Cloudflare Playwright MCP?

Cloudflare Playwright MCP works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Use Cloudflare Playwright MCP with Conare

Manage MCP servers visually, upload persistent context, and never start from zero with Claude Code & Codex.

Try Free