Cloudflare Playwright MCP

Cloudflare Playwright MCP

A server that leverages Playwright for automated browser testing and integrates with Cloudflare Workers, enabling AI assistants to control web browsers for navigation, interaction, and screenshots.

Category
Visit Server

README

Cloudflare Playwright MCP

Overview

This project leverages Playwright for automated browser testing and integrates with Cloudflare Workers, Browser Rendering and @cloudflare/playwright for deployment.

Build and 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<br> 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<br> 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<br> 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<br> 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<br> 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<br> 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<br> 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<br> 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<br> 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].workers.dev/sse"
      ]
    }
  }
}
  1. Save the configuration file and restart Claude Desktop to apply the changes.

This setup ensures that Claude Desktop can communicate with the Cloudflare Playwright MCP server.

Here's an example of a session opening the TODO demo app, adding "buy lemons" and doing a screenshot, taking advantage of playwright-mcp tools and Browser Rendering:

alt text

Configure in VSCode

You can install the Playwright MCP server using the 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"}'

After installation, the Playwright MCP server will be available for use with your GitHub Copilot agent in VS Code.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured