mirror of
https://github.com/microsoft/playwright-mcp.git
synced 2025-07-28 01:32:27 +08:00
Migrate to /mcp streamable transport by default
Co-authored-by: pavelfeldman <883973+pavelfeldman@users.noreply.github.com>
This commit is contained in:
parent
3b9397dc80
commit
9ca9e82006
@ -297,24 +297,26 @@ npx @playwright/mcp@latest --config path/to/config.json
|
|||||||
### Standalone MCP server
|
### Standalone MCP server
|
||||||
|
|
||||||
When running headed browser on system w/o display or from worker processes of the IDEs,
|
When running headed browser on system w/o display or from worker processes of the IDEs,
|
||||||
run the MCP server from environment with the DISPLAY and pass the `--port` flag to enable SSE transport.
|
run the MCP server from environment with the DISPLAY and pass the `--port` flag to enable HTTP transport.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npx @playwright/mcp@latest --port 8931
|
npx @playwright/mcp@latest --port 8931
|
||||||
```
|
```
|
||||||
|
|
||||||
And then in MCP client config, set the `url` to the SSE endpoint:
|
And then in MCP client config, set the `url` to the MCP endpoint:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
"mcpServers": {
|
"mcpServers": {
|
||||||
"playwright": {
|
"playwright": {
|
||||||
"url": "http://localhost:8931/sse"
|
"url": "http://localhost:8931/mcp"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
For legacy SSE transport support, you can use `/sse` instead of `/mcp` in the URL.
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary><b>Docker</b></summary>
|
<summary><b>Docker</b></summary>
|
||||||
|
|
||||||
|
@ -127,11 +127,11 @@ export function startHttpTransport(httpServer: http.Server, mcpServer: Server) {
|
|||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
'mcpServers': {
|
'mcpServers': {
|
||||||
'playwright': {
|
'playwright': {
|
||||||
'url': `${url}/sse`
|
'url': `${url}/mcp`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, undefined, 2),
|
}, undefined, 2),
|
||||||
'If your client supports streamable HTTP, you can use the /mcp endpoint instead.',
|
'For legacy SSE transport support, you can use the /sse endpoint instead.',
|
||||||
].join('\n');
|
].join('\n');
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.error(message);
|
console.error(message);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user