home / mcp / cloudflare playwright mcp example mcp server
Provides a Cloudflare-based Playwright MCP Server to control a browser for web automation tasks via MCP clients.
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.
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.
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 deployConfigure 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.
{
"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"]
}Navigate the active browser to a specified URL and render the resulting page.
Type text into the focused element, supporting simple keystrokes and input.
Click a target element, such as a button or checkbox, identified by its label or selector.
Capture a screenshot of the current browser view and return or save it for review.