@@ -78,18 +78,18 @@ in the **Storage volumes** section and add the `--output-dir <container-path>`
78
78
command argument as shown in the screenshot below.
79
79
80
80
<ThemedImage
81
- alt = ' Filesystem MCP server UI'
81
+ alt = ' Playwright MCP server UI'
82
82
sources = { {
83
83
light: useBaseUrl (' /img/toolhive/mcp-guides/playwright-mcp-ui-light.webp' ),
84
84
dark: useBaseUrl (' /img/toolhive/mcp-guides/playwright-mcp-ui-dark.webp' ),
85
85
}}
86
- title = ' Filesystem MCP server UI'
86
+ title = ' Playwright MCP server UI'
87
87
/>
88
88
89
89
:::note[ Important]
90
90
91
- Don't remove the ` --port 8931 ` argument, as the server requires it to function
92
- correctly in ToolHive.
91
+ Don't remove the ` --port 8931 ` or ` --allowed-hosts "*" ` arguments. They are
92
+ required for the server to function correctly in ToolHive.
93
93
94
94
:::
95
95
@@ -104,36 +104,46 @@ thv run playwright
104
104
105
105
Emulate a mobile device for responsive testing:
106
106
107
- ``` bash
108
- thv run playwright -- --port 8931 --allowed-hosts " *" --device " iPhone 15"
107
+ ``` bash {2}
108
+ thv run playwright -- --port 8931 --allowed-hosts " *" \
109
+ --device " iPhone 15"
109
110
```
110
111
111
112
Restrict access to specific domains:
112
113
113
- ``` bash
114
- thv run playwright -- --port 8931 --allowed-hosts " *" --allowed-origins " example.com;trusted-site.com"
114
+ ``` bash {2}
115
+ thv run playwright -- --port 8931 --allowed-hosts " *" \
116
+ --allowed-origins " example.com;trusted-site.com"
115
117
```
116
118
117
119
Mount a host directory (e.g., ` ~/playwright-output ` ) to save browser output
118
120
files like screenshots and traces:
119
121
120
- ``` bash
122
+ ``` bash {3,5}
121
123
mkdir ~ /playwright-output
122
- thv run --volume ~ /playwright-output:/browser-output playwright -- --port 8931 --allowed-hosts " *" --output-dir /browser-output --save-trace --save-session
124
+ thv run \
125
+ --volume ~ /playwright-output:/browser-output playwright \
126
+ -- --port 8931 --allowed-hosts " *" \
127
+ --output-dir /browser-output --save-trace --save-session
123
128
```
124
129
125
130
You can run multiple instances of the server with different configurations by
126
131
giving each a unique name:
127
132
128
- ``` bash
129
- thv run --name playwright-desktop playwright -- --port 8931 --allowed-hosts " *" --device " Desktop Chrome" --viewport-size 1920,1080
130
- thv run --name playwright-iphone playwright -- --port 8931 --allowed-hosts " *" --device " iPhone 15"
133
+ ``` bash {1,5}
134
+ thv run --name playwright-desktop playwright \
135
+ -- --port 8931 --allowed-hosts " *" \
136
+ --device " Desktop Chrome" --viewport-size 1920,1080
137
+
138
+ thv run --name playwright-iphone playwright \
139
+ -- --port 8931 --allowed-hosts " *" \
140
+ --device " iPhone 15"
131
141
```
132
142
133
143
:::note[ Important]
134
144
135
- Don't remove the ` --port 8931 ` or ` --allowed-hosts "*"` arguments, as the
136
- server requires it to function correctly in ToolHive.
145
+ Don't remove the ` --port 8931 ` or ` --allowed-hosts "*" ` arguments. They are
146
+ required for the server to function correctly in ToolHive.
137
147
138
148
:::
139
149
@@ -163,6 +173,13 @@ spec:
163
173
name : network
164
174
` ` `
165
175
176
+ :::note[Important]
177
+
178
+ Don't remove the ` --port 8931` or `--allowed-hosts "*"` arguments. They are
179
+ required for the server to function correctly in ToolHive.
180
+
181
+ :: :
182
+
166
183
Apply the manifest to your Kubernetes cluster :
167
184
168
185
` ` ` bash
@@ -243,7 +260,7 @@ spec:
243
260
Here are some sample prompts you can use to interact with the Playwright MCP
244
261
server :
245
262
246
- - "Navigate to https://example.com and take a screenshot of the homepage"
263
+ - " Navigate to https://toolhive.dev and take a screenshot of the homepage"
247
264
- " Go to the login page, fill in the username field with 'testuser' and password
248
265
field with 'password123', then click the login button"
249
266
- " Open https://news.ycombinator.com and get the titles of the top 5 stories"
0 commit comments