Connect Playwright MCP to VS Code
Browser automation over MCP from the Playwright team. Agents use it to open the built UI, take screenshots and check layouts against the design.
MCP serverOfficialChecked 2026-11-16
Before you start
- VS Code installed (see its MCP documentation (opens in a new tab)).
- Playwright MCP is available on macOS, Windows and Linux.
Step 1: Add Playwright MCP to VS Code
Add it from the terminal
Adds the server to your VS Code profile, so it works in every workspace.
Terminal code --add-mcp '{"name":"playwright","type":"stdio","command":"npx","args":["-y","@playwright/mcp@latest"]}'Or add it to the workspace
Add this to
.vscode/mcp.jsonand commit it to share it with your team..vscode/mcp.json { "servers": { "playwright": { "type": "stdio", "command": "npx", "args": [ "-y", "@playwright/mcp@latest" ] } } }Step 2: Check it's connected
Run MCP: List Servers from the Command Palette, then open Copilot Chat in Agent mode and check the tools picker.
Step 3: Try a first request
Ask VS Code something that only works with Playwright MCP connected:
Say to VS Code Open http://localhost:3000, take a screenshot at 375 px wide and tell me what looks broken.
If it doesn't work
- VS Code asks you to trust a server the first time it starts. Accept it, or the tools stay hidden.
code --add-mcpwrites to your user profile, so the server works in every workspace.- Use MCP: List Servers → Show Output to see startup errors.





