Skip to content

Commit 2e5016c

Browse files
committed
Reformat the long playwright CLI lines
Signed-off-by: Dan Barr <[email protected]>
1 parent 208e156 commit 2e5016c

File tree

1 file changed

+33
-16
lines changed

1 file changed

+33
-16
lines changed

docs/toolhive/guides-mcp/playwright.mdx

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,18 @@ in the **Storage volumes** section and add the `--output-dir <container-path>`
7878
command argument as shown in the screenshot below.
7979

8080
<ThemedImage
81-
alt='Filesystem MCP server UI'
81+
alt='Playwright MCP server UI'
8282
sources={{
8383
light: useBaseUrl('/img/toolhive/mcp-guides/playwright-mcp-ui-light.webp'),
8484
dark: useBaseUrl('/img/toolhive/mcp-guides/playwright-mcp-ui-dark.webp'),
8585
}}
86-
title='Filesystem MCP server UI'
86+
title='Playwright MCP server UI'
8787
/>
8888

8989
:::note[Important]
9090

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.
9393

9494
:::
9595

@@ -104,36 +104,46 @@ thv run playwright
104104

105105
Emulate a mobile device for responsive testing:
106106

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"
109110
```
110111

111112
Restrict access to specific domains:
112113

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"
115117
```
116118

117119
Mount a host directory (e.g., `~/playwright-output`) to save browser output
118120
files like screenshots and traces:
119121

120-
```bash
122+
```bash {3,5}
121123
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
123128
```
124129

125130
You can run multiple instances of the server with different configurations by
126131
giving each a unique name:
127132

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"
131141
```
132142

133143
:::note[Important]
134144

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.
137147

138148
:::
139149

@@ -163,6 +173,13 @@ spec:
163173
name: network
164174
```
165175
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+
166183
Apply the manifest to your Kubernetes cluster:
167184

168185
```bash
@@ -243,7 +260,7 @@ spec:
243260
Here are some sample prompts you can use to interact with the Playwright MCP
244261
server:
245262

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"
247264
- "Go to the login page, fill in the username field with 'testuser' and password
248265
field with 'password123', then click the login button"
249266
- "Open https://news.ycombinator.com and get the titles of the top 5 stories"

0 commit comments

Comments
 (0)