home / mcp / cloudflare playwright mcp example mcp server

Cloudflare Playwright MCP Example MCP Server

Provides a Cloudflare-based Playwright MCP Server to control a browser for web automation tasks via MCP clients.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "kathayl-playwright-mcp-example": {
      "url": "https://[my-mcp-url].workers.dev/sse"
    }
  }
}

You can run a Cloudflare-based Playwright browser controller as an MCP server so AI assistants can navigate web pages, type, click, and capture screenshots. This server exposes a remote HTTP endpoint for MCP clients and can be proxied locally for desktop tools, enabling seamless browser automation across platforms.

How to use

Connect to the server from your MCP client using the remote URL path exposed by the worker. This enables you to run browser automation tasks through standard MCP tool calls, such as navigating to pages, typing text, clicking elements, and taking screenshots.

You can also integrate with desktop tooling by proxying the remote MCP server locally. For Claude Desktop, you can route requests through a local proxy so the desktop app can communicate with this MCP server.

How to install

Prerequisites: ensure you have Node.js and npm installed on your machine. You also need the Cloudflare Wrangler tool to deploy Workers.

Install dependencies and deploy the MCP server to Cloudflare Workers.

# Install dependencies
npm ci

# Deploy to Cloudflare Workers
npx wrangler deploy

MCP connection configurations

Configure how you connect to this MCP server in your client or tooling. You have two explicit connection methods: a remote HTTP endpoint and a local stdio proxy for desktop tooling.

HTTP (remote) endpoint example URL pattern you will connect to from MCP clients.

MCP connections (explicit configurations)

{
  "type": "http",
  "name": "cloudflare_playwright_mcp",
  "url": "https://[my-mcp-url].workers.dev/sse",
  "args": []
}
{
  "type": "stdio",
  "name": "cloudflare_playwright_mcp",
  "command": "npx",
  "args": ["mcp-remote", "https://[my-mcp-url].workers.dev/sse"]
}

Available tools

browser_navigate

Navigate the active browser to a specified URL and render the resulting page.

browser_type

Type text into the focused element, supporting simple keystrokes and input.

browser_clickt

Click a target element, such as a button or checkbox, identified by its label or selector.

browser_take_screenshot

Capture a screenshot of the current browser view and return or save it for review.