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:
- Install dependencies:
- Deploy to Cloudflare Workers:
Use with Cloudflare AI Playground
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 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 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 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 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 ![]() |
User | Now click the checkbox of the parrot todo entry |
Assistant | runs browser_clickt tool 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 ![]() |
User | Remove completed todo entries |
Assistant | runs browser_clickt tool 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 ![]() |
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:
- Open the configuration file for Claude Desktop.
- Add the following JSON snippet under the
mcpServers
section:
- 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:
Configure in VSCode
You can install the Playwright MCP server using the VS Code CLI:
After installation, the Playwright MCP server will be available for use with your GitHub Copilot agent in VS Code.
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A server that integrates Playwright with Cloudflare Workers to enable browser automation tasks through LLM models in AI platforms like Claude and Copilot.
Related MCP Servers
- AsecurityFlicenseAqualityA server that enables browser automation using Playwright, allowing interaction with web pages, capturing screenshots, and executing JavaScript in a browser environment through LLMs.Last updated -129,4571TypeScript
- -securityFlicense-qualityProvides a server utilizing Model Context Protocol to enable human-like browser automation with Playwright, allowing control over browser actions such as navigation, element interaction, and scrolling.Last updated -2TypeScript
- AsecurityFlicenseAqualityEnables LLMs to perform browser automation through the Playwright framework with Chrome DevTools Protocol support, connecting to existing Chrome instances for advanced web interactions and JavaScript execution.Last updated -129TypeScript
- -security-license-qualityPlaywright wrapper for MCP that enables LLM-powered clients to control a browser for automation tasks.Last updated -Python