docs: add authentication token instructions to extension README #1207
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Add authentication token documentation to extension README
Summary
This PR adds documentation to the extension README explaining how users can use the
PLAYWRIGHT_MCP_EXTENSION_TOKENenvironment variable to bypass the connection approval dialog.Motivation
Currently, users need to manually approve each connection when the MCP server tries to connect to the browser extension. While the authentication token feature already exists in the codebase, it's not documented in the extension README, making it difficult for users to discover this time-saving feature.
Changes
extension/README.md): Added a new section "Bypassing the Connection Approval Dialog" that explains:Usage
After this documentation is available, users can configure their MCP client like this:
{ "mcpServers": { "playwright-extension": { "command": "npx", "args": [ "@playwright/mcp@latest", "--extension" ], "env": { "PLAYWRIGHT_MCP_EXTENSION_TOKEN": "their-unique-token-here" } } } }Benefits
Testing
Related
This documents the existing authentication token feature that's implemented in:
extension/src/ui/authToken.tsx- Token generation and displayextension/src/ui/connect.tsx- Token validation logic