Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 8 additions & 26 deletions docs/toolhive/guides-mcp/playwright.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,6 @@ command argument as shown in the screenshot below.
title='Playwright MCP server UI'
/>

:::note[Important]

Don't remove the `--port 8931` or `--allowed-hosts "*"` arguments. They are
required for the server to function correctly in ToolHive.

:::

</TabItem>
<TabItem value='cli' label='CLI'>

Expand All @@ -105,15 +98,13 @@ thv run playwright
Emulate a mobile device for responsive testing:

```bash {2}
thv run playwright -- --port 8931 --allowed-hosts "*" \
--device "iPhone 15"
thv run playwright -- --device "iPhone 15"
```

Restrict access to specific domains:

```bash {2}
thv run playwright -- --port 8931 --allowed-hosts "*" \
--allowed-origins "example.com;trusted-site.com"
thv run playwright -- --allowed-origins "example.com;trusted-site.com"
```

Mount a host directory (e.g., `~/playwright-output`) to save browser output
Expand All @@ -123,34 +114,25 @@ files like screenshots and traces:
mkdir ~/playwright-output
thv run \
--volume ~/playwright-output:/browser-output playwright \
-- --port 8931 --allowed-hosts "*" \
--output-dir /browser-output --save-trace --save-session
-- --output-dir /browser-output --save-trace --save-session
```

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

```bash {1,5}
thv run --name playwright-desktop playwright \
-- --port 8931 --allowed-hosts "*" \
--device "Desktop Chrome" --viewport-size 1920,1080
-- --device "Desktop Chrome" --viewport-size 1920,1080

thv run --name playwright-iphone playwright \
-- --port 8931 --allowed-hosts "*" \
--device "iPhone 15"
-- --device "iPhone 15"
```

:::note[Important]

Don't remove the `--port 8931` or `--allowed-hosts "*"` arguments. They are
required for the server to function correctly in ToolHive.

:::

</TabItem>
<TabItem value='k8s' label='Kubernetes'>

Create a basic Kubernetes manifest to deploy the Playwright MCP server:
Create a basic Kubernetes manifest to deploy the Playwright MCP server using the
Streamable HTTP transport:

```yaml title="playwright.yaml"
apiVersion: toolhive.stacklok.dev/v1alpha1
Expand All @@ -173,7 +155,7 @@ spec:
:::note[Important]

Don't remove the `--port 8931` or `--allowed-hosts "*"` arguments. They are
required for the server to function correctly in ToolHive.
required to run the server using Streamable HTTP.

:::

Expand Down
Binary file modified static/img/toolhive/mcp-guides/playwright-mcp-ui-dark.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified static/img/toolhive/mcp-guides/playwright-mcp-ui-light.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.