feat(server): add host option to SSE server configuration (#261)
This commit is contained in:
22
README.md
22
README.md
@@ -74,6 +74,7 @@ The Playwright MCP server supports the following command-line options:
|
||||
- `--executable-path <path>`: Path to the browser executable
|
||||
- `--headless`: Run browser in headless mode (headed by default)
|
||||
- `--port <port>`: Port to listen on for SSE transport
|
||||
- `--host <host>`: Host to bind server to. Default is localhost. Use 0.0.0.0 to bind to all interfaces.
|
||||
- `--user-data-dir <path>`: Path to the user data directory
|
||||
- `--vision`: Run server that uses screenshots (Aria snapshots are used by default)
|
||||
|
||||
@@ -89,8 +90,7 @@ Playwright MCP will launch the browser with the new profile, located at
|
||||
|
||||
All the logged in information will be stored in that profile, you can delete it between sessions if you'd like to clear the offline state.
|
||||
|
||||
|
||||
### Running headless browser (Browser without GUI).
|
||||
### Running headless browser (Browser without GUI)
|
||||
|
||||
This mode is useful for background or batch operations.
|
||||
|
||||
@@ -129,6 +129,24 @@ And then in MCP client config, set the `url` to the SSE endpoint:
|
||||
}
|
||||
```
|
||||
|
||||
When running in a remote server, you can use the `--host` flag to bind the server to `0.0.0.0` to make it accessible from outside.
|
||||
|
||||
```bash
|
||||
npx @playwright/mcp@latest --port 8931 --host 0.0.0.0`
|
||||
```
|
||||
|
||||
In MCP client config, `$server-ip` is the IP address of the server:
|
||||
|
||||
```js
|
||||
{
|
||||
"mcpServers": {
|
||||
"playwright": {
|
||||
"url": "http://{$server-ip}:8931/sse"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Docker
|
||||
|
||||
**NOTE:** The Docker implementation only supports headless chromium at the moment.
|
||||
|
||||
Reference in New Issue
Block a user