Playwright MCP without burning your context window
Your AI tool can write a login form. It cannot normally tell you whether the form works, because it cannot see your site. It is reasoning from the code. Playwright MCP closes that gap. It gives your tool a real browser it can drive: open a page, click a button, fill a field, read what came back. When it says the checkout works, it has been through the checkout.
Worth it when you are debugging something you can only see in a browser, checking a change actually rendered, or filling in the same test form for the twentieth time. Not worth it for writing code, explaining an error, or anything where the answer is already in the files. It is a browser, not a brain, and every page it reads costs you context.
Install it in
One command, run in your terminal.
bash
claude mcp add playwright npx @playwright/mcp@latestWhat you should see
A line confirming the server was added. Restart Claude Code, then run /mcp to see playwright listed as connected.That adds it to this project only, and keeps it private to you. That is the default.
bash
claude mcp add --scope user playwright npx @playwright/mcp@latestWhat you should see
The same confirmation. Playwright MCP is now available in every project on your machine, still just for you.Or share it with your team through git, which writes a .mcp.json file in the project for you to commit:
bash
claude mcp add --scope project playwright npx @playwright/mcp@latestWhat you should see
The same confirmation, and a .mcp.json file in your project folder. Commit that file so your team gets the same setup.Open Cursor Settings, then MCP, then Add new MCP Server. Give it the name playwright and the command npx @playwright/mcp@latest. If you would rather edit the file directly, that panel is writing this:
json
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest"]
}
}
}What you should see
Playwright appears in Cursor's MCP list with a green dot once it connects.Put that in ~/.cursor/mcp.json for every project, or .cursor/mcp.json inside one project for just that one.
One command, run in your terminal.
bash
code --add-mcp '{"name":"playwright","command":"npx","args":["@playwright/mcp@latest"]}'What you should see
VS Code confirms the server was added. Reload the window and Playwright appears in the MCP servers list.Check it works. Ask your tool to do something small and verifiable:
Copy this into your AI tool
Using Playwright, open example.com and tell me exactly what the main heading says.
Open it in your AI tool. Clicking copies the prompt, and ChatGPT and Grok open with it already filled in.
- Claude(opens in a new tab)
- ChatGPT(opens in a new tab)
- Qwen(opens in a new tab)
- DeepSeek(opens in a new tab)
- Kimi(opens in a new tab)
- Grok(opens in a new tab)
More tools
App builders, in your browser:
Code editors on your computer. Open app only works once it is installed, so use Get it first if you do not have it.
- CursorOpen appGet it(opens in a new tab)
- VS CodeOpen appGet it(opens in a new tab)
- Antigravity IDEOpen appGet it(opens in a new tab)
- Antigravity 2.0Open appGet it(opens in a new tab)
Want the full list? Browse all app builders and coding editors (IDEs).
It should open a browser window, read the page and answer "Example Domain". If it answers without opening anything, it is working from memory and the server is not connected. Check the MCP list in your tool.
Four habits that fix it. 1. Ask for what you need, not for everything. "Find the submit button" uses a search that returns a few lines. "Look at the page" returns the whole thing. Say what you are after. 2. Skip screenshots unless you need to see it. An image costs far more than the text description, and for "did this button move" the text already answers you. Ask for a screenshot when the question is genuinely visual. 3. Close the tab when you are done. Tabs left open keep showing up in what your tool reads. 4. Start a fresh session after a long browser stretch. Once the context is full of stale page snapshots, clearing it is faster than fighting it.
If you are doing a lot of browser work, the server has flags for this. Turning image responses off stops screenshots eating the budget:
bash
claude mcp add playwright -- npx @playwright/mcp@latest --image-responses omitWhat you should see
The same confirmation. Your tool now works from text descriptions only, which is what you want for most debugging.Add --headless to stop a browser window popping up, and --isolated to throw away cookies and logins between runs rather than keeping a profile on disk. Both go after the -- as well, alongside --image-responses.
When it goes wrong, it is usually one of three things. Nothing happens and your tool answers from memory. The server is not connected. Check the MCP list in your tool, and restart it after installing. npx: command not found. Node.js is not installed, or not on your PATH. Install Node and open a new terminal. It opens the page but sees nothing useful. The page is probably still loading. Ask it to wait for a specific piece of text to appear before reading.