Cloudflare Browser Rendering (Playwright) MCP server

Enables browser automation through structured accessibility snapshots for web navigation, form-filling, element interaction, and data extraction without requiring vision models.
Back to servers
Setup instructions
Provider
Cloudflare
Release date
Apr 18, 2025
Language
TypeScript
Stats
193 stars

The Cloudflare Playwright MCP is a server that leverages Playwright for automated browser testing and integrates with Cloudflare Workers and Browser Rendering. It allows AI assistants and other tools to control a browser remotely through a standardized Model Context Protocol (MCP) interface.

Installation and Deployment

Prerequisites

Before you begin, make sure you have Node.js and npm installed on your system.

Setup and Deployment

  1. Install dependencies:
npm ci
  1. Build the project:
cd cloudflare
npm run build
  1. Deploy to Cloudflare Workers:
cd cloudflare/example
npm ci
npx wrangler deploy

After deployment, you'll have a URL like https://[my-mcp-url].workers.dev/sse that will serve as your MCP server endpoint.

Usage Options

Using with Cloudflare AI Playground

Cloudflare AI Playground provides an easy way to test your MCP server:

  1. Navigate to Cloudflare playground AI
  2. Set the model to llama-3.3-70b-instruct-fp8-fast
  3. In the MCP Servers section, enter your server URL: https://[my-mcp-url].workers.dev/sse
  4. Click Connect
  5. The status should update to Connected and show 14 available tools

You can now interact with the model by giving simple instructions like "Create a new todo entry", "Go to cloudflare site", or "Take a screenshot".

Using with Claude Desktop

To use with Claude Desktop:

  1. Install mcp-remote to proxy your remote MCP server
  2. Open the configuration file for Claude Desktop
  3. Add this 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

Using in VS Code

To configure the MCP server in Visual Studio Code:

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

Or for VS Code Insiders:

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

Available Tool Modes

The MCP server offers tools in two operating modes:

Snapshot Mode (Default)

Uses accessibility snapshots for better performance and reliability

Vision Mode

Uses screenshots for visual-based interactions, ideal for computer vision models that can interact with elements using X-Y coordinates

Key Tool Categories

The MCP server provides various tool categories for browser automation:

Interaction Tools

  • Page snapshots
  • Click, drag, hover, and type operations
  • Form interactions (select options, file uploads)
  • Keyboard and dialog handling

Navigation Tools

  • URL navigation
  • Browser history controls (back, forward)

Resource Tools

  • Taking screenshots
  • Saving pages as PDF
  • Listing network requests and console messages

Tab Management

  • Listing, opening, selecting, and closing tabs

Testing

  • Generating Playwright tests

Each tool accepts specific parameters that allow precise control of the browser through text prompts.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

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

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

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

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

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

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later