home / mcp / cloudflare playwright mcp server
Runs Playwright controls in Cloudflare Workers to automate browser tasks via MCP clients.
Configuration
View docs{
"mcpServers": {
"berniecpa-playwright-mcp-example": {
"url": "https://[my-mcp-url].workers.dev/sse"
}
}
}You can control a browser via an MCP server that runs Playwright in Cloudflare Workers. This setup lets AI assistants perform web automation tasks such as navigating pages, typing, clicking elements, and taking screenshots, using familiar MCP clients and tooling.
To use this MCP server, connect an MCP client to the remote URL and start issuing browser actions through the provided tools. Typical workflows include navigating to a page, filling forms, clicking buttons, and capturing screenshots for verification. For best results, give concise instructions that perform one action at a time (for example, navigate to a page, then take a screenshot after a page loads). When you issue multiple steps, the system will execute the corresponding browser actions in sequence.
Prerequisites you need on your machine:
Install dependencies for the MCP project and prepare it for deployment:
npm ciDeploy the MCP server to Cloudflare Workers after dependencies are installed:
npx wrangler deployNavigate the browser to a specified URL or path.
Type text into the currently focused element on the page.
Click a target element identified by locator or text to interact with the page.
Capture a screenshot of the current browser page and return it as an image file.