arrow-left Back to topicQuizPlaywright MCPCheck yourself1.Why does Playwright MCP use an accessibility tree instead of screenshots to let the model interact with the page?Screenshots are too large to transmit over MCPThe accessibility tree is structured text — the model can read element refs and act on them without needing a vision model to parse pixel positionsPlaywright can't take screenshots in MCP mode2.What is the minimum config change needed to add Playwright MCP to a supported AI client?Install @playwright/mcp globally with npm and restart the client — no config change neededAdd a 'playwright' entry under 'mcpServers' in the client's config file pointing to 'npx @playwright/mcp@latest'Set the PLAYWRIGHT_MCP=true environment variable and restart the AI clientInstall the Playwright VS Code extension — it automatically registers MCP for all clients3.After connecting Playwright MCP, what kinds of browser automation tools become available to the AI assistant?Only navigation and screenshot — no interaction tools are exposedNavigation, clicking, form filling, snapshot, screenshot, API mocking, and console log reading — the full browser automation toolkitOnly read-only tools — MCP cannot interact with the page, only observe itThe same tools as the Playwright test runner — including test assertions and fixtures4.What does adding '--headless' to the Playwright MCP args array change?The MCP server itself runs without a head process — it uses less CPUThe browser runs without a visible window — useful for CI or when you don't need to watch the sessionScreenshots are disabled — only accessibility snapshots are availableThe AI model receives only text, not any visual output5.What does the '--isolated' flag do in the Playwright MCP configuration?It prevents the MCP server from accessing the file systemEach session starts with a clean browser state — no cookies or localStorage carried over from previous sessionsIt runs the browser in a Docker container for security isolationIt disables network access so the browser can only load local files6.In a browser_snapshot output, what are 'ref' values like 'ref=e8' used for?They are CSS class names that can be used as selectors in test codeThey are stable element identifiers the model uses to target specific elements in browser_click, browser_fill, and other interaction toolsThey are internal Playwright IDs used only for debugging — you cannot use them in commandsThey reference line numbers in the page's source code7.Which AI clients and editors are compatible with Playwright MCP?Only Claude — MCP is an Anthropic-specific protocolAny MCP-compatible client: VS Code, Claude (desktop and Claude Code), Cursor, and others that support the Model Context ProtocolOnly editors with a built-in browser extension — standalone AI assistants are not supportedOnly CLI-based tools — graphical AI clients cannot connect to MCP servers8.You want Playwright MCP to use Firefox instead of the default Chromium. How do you configure this?Set PLAYWRIGHT_BROWSER=firefox as an environment variable before starting the AI clientAdd '--browser=firefox' to the args array in the mcpServers configInstall the Firefox MCP package separately: npx @playwright/mcp-firefox@latestBrowser selection is not configurable in Playwright MCP — it always uses ChromiumSubmit answersarrow-left PreviousCoding agents