Skip to content

Commit 66d069a

Browse files
committed
Adds Playwright MCP documentation and changelog entry
1 parent b7d1186 commit 66d069a

File tree

6 files changed

+153
-4
lines changed

6 files changed

+153
-4
lines changed
130 KB
Loading
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
title: Playwright MCP server is now compatible with Browser Rendering
3+
description: You can now deploy Playwright MCP and use any MCP client to get AI models to interact with Browser Rendering
4+
products:
5+
- browser-rendering
6+
date: 2025-05-26T17:00:00Z
7+
---
8+
9+
We're excited to share that you can now use the [Playwright MCP](https://github.com/cloudflare/playwright-mcp) server with Browser Rendering.
10+
11+
Once you [deploy the server](/browser-rendering/platform/playwright-mcp/#deploying), you can use any MCP client with it to interact with Browser Rendering. This allows you to run AI models that can automate browser tasks, such as taking screenshots, filling out forms, or scraping data.
12+
13+
![Access Analytics](~/assets/images/browser-rendering/playground-ai-screenshot.png)
14+
15+
Playwright MCP is available as an npm package at [`@cloudflare/playwright-mcp`](https://www.npmjs.com/package/@cloudflare/playwright-mcp). To install it, type:
16+
17+
```bash
18+
npm install @cloudflare/playwright-mcp --save-dev
19+
```
20+
21+
Deploying the server is then as easy as:
22+
23+
```ts
24+
import { env } from 'cloudflare:workers';
25+
import { createMcpAgent } from '@cloudflare/playwright-mcp';
26+
27+
export const PlaywrightMCP = createMcpAgent(env.BROWSER);
28+
export default PlaywrightMCP.mount('/sse');
29+
```
30+
31+
Check out the full code at [GitHub](https://github.com/cloudflare/playwright-mcp).
32+
33+
Learn more about Playwright MCP in our [documentation](/browser-rendering/platform/playwright-mcp/).

src/content/changelog/cloudflare-one/access-analytics-v2.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ A new Access Analytics dashboard is now available to all Cloudflare One customer
1919

2020
![Access Analytics](~/assets/images/changelog/cloudflare-one/accessanalytics.png)
2121

22-
To access the new overview, log in to your Cloudflare [Zero Trust dashboard](https://one.dash.cloudflare.com/) and find Analytics in the side navigation bar.
22+
To access the new overview, log in to your Cloudflare [Zero Trust dashboard](https://one.dash.cloudflare.com/) and find Analytics in the side navigation bar.

src/content/docs/browser-rendering/changelog.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ description: Review recent changes to Worker Browser Rendering.
1111

1212
import { ProductReleaseNotes } from "~/components";
1313

14-
{/* <!-- Actual content lives in /src/content/release-notes/radar.yaml. Update the file there for new entries to appear here. For more details, refer to https://developers.cloudflare.com/style-guide/documentation-content-strategy/content-types/changelog/#yaml-file --> */}
14+
{/* <!-- Actual content lives in /src/content/release-notes/browser-rendering.yaml. Update the file there for new entries to appear here. For more details, refer to https://developers.cloudflare.com/style-guide/documentation-content-strategy/content-types/changelog/#yaml-file --> */}
1515

16-
<ProductReleaseNotes />
16+
<ProductReleaseNotes />
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
---
2+
pcx_content_type: concept
3+
title: Playwright MCP
4+
description: Deploy a Playwright MCP server that uses Browser Rendering to provide browser automation capabilities to your agents.
5+
sidebar:
6+
order: 6
7+
badge: Beta
8+
---
9+
10+
import {
11+
Render,
12+
WranglerConfig,
13+
TabItem,
14+
Tabs,
15+
PackageManagers,
16+
} from "~/components";
17+
18+
[`@cloudflare/playwright-mcp`](https://github.com/cloudflare/playwright-mcp) is a [Playwright MCP](https://github.com/microsoft/playwright-mcp) server fork that provides browser automation capabilities using Playwright and Browser Rendering.
19+
20+
This server enables LLMs to interact with web pages through structured accessibility snapshots, bypassing the need for screenshots or visually-tuned models. Its key features are:
21+
22+
* Fast and lightweight. Uses Playwright's accessibility tree, not pixel-based input.
23+
* LLM-friendly. No vision models needed, operates purely on structured data.
24+
* Deterministic tool application. Avoids ambiguity common with screenshot-based approaches.
25+
26+
## Deploying
27+
28+
Follow these steps to deploy `@cloudflare/playwright-mcp`:
29+
30+
1. Install the Playwright MCP [npm package](https://www.npmjs.com/package/@cloudflare/playwright-mcp).
31+
32+
<PackageManagers pkg="@cloudflare/playwright-mcp" dev />
33+
34+
2. Make sure you have the [browser rendering](https://developers.cloudflare.com/browser-rendering/) and [durable object](https://developers.cloudflare.com/durable-objects/) bindings and [migrations](https://developers.cloudflare.com/durable-objects/reference/durable-objects-migrations/) configured in your wrangler.toml file.
35+
36+
<WranglerConfig>
37+
38+
```toml
39+
name = "playwright-mcp-example"
40+
main = "src/index.ts"
41+
compatibility_date = "2025-03-10"
42+
compatibility_flags = ["nodejs_compat"]
43+
44+
[browser]
45+
binding = "BROWSER"
46+
47+
[[migrations]]
48+
tag = "v1"
49+
new_sqlite_classes = ["PlaywrightMCP"]
50+
51+
[[durable_objects.bindings]]
52+
name = "MCP_OBJECT"
53+
class_name = "PlaywrightMCP"
54+
```
55+
56+
</WranglerConfig>
57+
58+
3. Edit the code.
59+
60+
```ts title="src/index.ts"
61+
import { env } from 'cloudflare:workers';
62+
import { createMcpAgent } from '@cloudflare/playwright-mcp';
63+
64+
export const PlaywrightMCP = createMcpAgent(env.BROWSER);
65+
export default PlaywrightMCP.mount('/sse');
66+
```
67+
68+
4. Deploy the server.
69+
70+
```bash
71+
npx wrangler deploy
72+
```
73+
74+
The server is now available at `https://[my-mcp-url].workers.dev/sse` and you can use it with any MCP client.
75+
76+
Alternatively, use "[Deploy to Cloudflare](https://developers.cloudflare.com/workers/platform/deploy-buttons/)":
77+
78+
[![Deploy to Cloudflare](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/playwright-mcp/tree/main/cloudflare/example)
79+
80+
Check our [GitHub page](https://github.com/cloudflare/playwright-mcp) for more information on how to build and deploy Playwright MCP.
81+
82+
## Using Playwright MCP
83+
84+
![alt text](~/assets/images/browser-rendering/playground-ai-screenshot.png)
85+
86+
[Cloudflare playground AI](https://playground.ai.cloudflare.com/) is a great way to test MCP servers using LLM models available in Workers AI.
87+
88+
- Navigate to https://playground.ai.cloudflare.com/
89+
- Ensure model is set to `llama-3.3-70b-instruct-fp8-fast`
90+
- In **MCP Servers**, set **URL** to `https://[my-mcp-url].workers.dev/sse`
91+
- Click **Connect**
92+
- Status should update to **Connected** and it should list 14 available tools
93+
94+
You can now start to interact with the model, and it will run necessary tools to accomplish what was requested.
95+
96+
:::note
97+
98+
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"
99+
100+
:::
101+
102+
Try this sequence of instructions too see Playwright MCP in action:
103+
104+
* Go to demo.playwright.dev/todomvc
105+
* Create some todo entry
106+
* Nice. Now create a todo in parrot style
107+
* And create another todo in yoda style
108+
* Take a screenshot
109+
110+
You can also use other MCP clients like [Claude Desktop](https://github.com/cloudflare/playwright-mcp/blob/main/cloudflare/example/README.md#use-with-claude-desktop).
111+
112+
Check our [GitHub page](https://github.com/cloudflare/playwright-mcp) for more examples and MCP client configuration options.

src/content/release-notes/browser-rendering.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ productLink: "/browser-rendering/"
55
productArea: Developer platform
66
productAreaLink: /workers/platform/changelog/platform/
77
entries:
8+
- publish_date: "2025-05-26"
9+
title: Playwright MCP
10+
description: |-
11+
* You can now deploy [Playwright MCP](/browser-rendering/platform/playwright-mcp/) and use any MCP client to get AI models to interact with Browser Rendering.
812
- publish_date: "2025-04-30"
913
title: Automatic Request Headers
1014
description: |-
@@ -38,4 +42,4 @@ entries:
3842
- publish_date: "2023-05-19"
3943
title: Browser Rendering Beta
4044
description: |-
41-
* Beta Launch
45+
* Beta Launch

0 commit comments

Comments
 (0)