Connections & Capabilities
Connects To
Capabilities
Quickstart
Install
npx @playwright/mcp@latest --config path/to/config.jsonConfig
{
"mcpServers": {
"playwright": {
"type": "stdio",
"command": "npx",
"timeout": 30,
"args": [
"-y",
"@playwright/mcp@latest"
],
"disabled": false
}
}
}Exposed MCP Tools (5)
navigateNavigates the browser to a specified URL.
Navigating to untrusted URLs can expose the agent to malicious content.
clickClicks on a specified element on the web page.
Clicking on the wrong element can trigger unintended actions.
fillFills a specified input field with a given value.
Filling input fields with incorrect data can lead to errors or security vulnerabilities.
textContentRetrieves the text content of a specified element.
Read-only operation, no side effects.
accessibilitySnapshotRetrieves the accessibility tree of the current web page.
Read-only operation, no side effects.
Safety Assessment
Playwright MCP is relatively safe when used with carefully defined allowed origins and restricted file access. Risks increase if unrestricted access is granted, potentially leading to unintended actions on web pages or unauthorized file access. Ensure proper configuration to mitigate these risks.
- Operates on accessibility tree, avoiding pixel-based input.
- Deterministic tool application reduces ambiguity.
- Allows configuration of allowed/blocked origins to control browser requests.
- File access can be restricted to workspace roots.
- Can perform actions on web pages, potentially leading to unintended consequences.
- If allowed-origins is set to '*', it can make requests to any origin.
- If allow-unrestricted-file-access is enabled, it can access files outside workspace roots.
- Improperly configured blocked-origins may not provide adequate protection.
