Playwright MCP Configuration
This repository contains everything needed to launch and connect to a working Playwright MCP (Model Context Protocol) server.
β Overview
This setup allows you to automate and inspect web pages using structured data instead of screenshots β ideal for LLM-powered tools like Claude, Cursor, and VS Code AI agents.
π οΈ Prerequisites
Node.js v18 or newer
One of the following MCP-compatible clients:
VS Code or VS Code Insiders
Cursor
Claude Desktop
π Repository Contents
.vscode/settings.jsonβ VS Code configuration to launch Playwright MCPpackage.jsonβ Includes required MCP dependenciesREADME.mdβ This file.gitignoreβ Basic Node project ignore rules
π Getting Started
1. Clone the Repository
2. Install Dependencies
This installs all required packages, including @playwright/mcp.
3. Start the MCP Server
You should see output like:
You can change the port if needed, e.g.
--port=4000
4. VS Code MCP Client Configuration
Add this to your .vscode/settings.json:
This tells VS Code (or Cursor) how to launch and connect to the MCP server.
5. Optional: Use Persistent or Isolated Sessions
Persistent (default)
The browser state is preserved across sessions.
Isolated Example
6. Additional Flags
You can enhance your MCP server using optional flags:
Flag | Description |
| Custom port (default is random/OS-assigned) |
| Run without browser UI |
| Emulate a device (e.g., "iPhone 15") |
| Enable screenshot-based vision (if supported) |
Check available flags with:
π Note About Browsers
You do not need to install playwright or run npx playwright install separately. The MCP package handles everything required for browser automation.
π .gitignore
π€ Contributing
Pull requests and suggestions are welcome!