X No. 3769 words
If you're doing any frontend dev in Claude Code, you should also be using the Playwright MCP to test

I’ve seen a lot of people dive into Claude Code over the last few weeks, and in so many cases, they’re building pretty rad frontend apps. I started using Claude Code in February of last year, and I also, started by building frontend apps, but I was testing them the old fashioned way for months…until I learned about Playwright.
Now, I can’t unsee what I’ve seen, and I can also build and iterate much faster by taking out what I thought for a while was something I needed to do as a human.
Here’s what your workflow probably looks like right now, especially if you’re just jumping into Claude Code.
-
You build something with Claude Code
-
Then you go into the browser to check if Claude Code actually built things the way you wanted
-
Looking at what it built you realize, eh - not quite
-
You then go back into Claude Code and tell it what it missed
-
Now you go back into the browser to check if Claude Code got it this time, close - but not quite
-
Back into Claude Code you go
And you might think, hey - this is pretty neat, I’m essentially working with an agentic engineer that’s building everything for me. All I need to do is check their work and keep giving feedback until it’s right!
While this might feel like the future, if you’re going between Claude Code, and the browser, as a human, manually, you are doing things the old way.
Enter the Playwright MCP Server.
Before the Playwright MCP Server, if you wanted an AI to navigate a website, it often had to “guess” based on images (screenshots). The Playwright MCP server changed this by giving the AI a structured, deterministic map of the website’s code (the DOM and Accessibility Tree), making AI-driven web automation much faster and more reliable.
But wait, what’s MCP?
Okay, so I’m sure many people reading this already know what MCP is, so you can skip this section if you do. But, if you’re just diving into Claude Code, and you don’t know what MCP is, let me break it down in two sentences so you can get it, and get rocking.
Model Context Protocol aka MCP is an open-source standard designed to give AI models a universal way to connect with external data, tools, and local files. Created by Anthropic, it acts like a “USB-C port for AI,” allowing developers to build a single integration that works across many different AI applications and services.
Setting up the Playwright MCP Server
With the Playwright MCP server running on your computer, you don’t have to go between Claude Code and the browser, using your human brain to interpret what you see and feed it back to Claude Code. Yes, you can remove, you, the human, from that loop now.
Setting up the Playwright MCP server is easy, and no - you don’t need any coding knowledge, and you don’t need to be a UNIX/Linux wiz, or even know anything about the Terminal.
All you need to know how to do is open the Terminal, if you can do that, you’re groovy. Ready? As Mario says - here we gooooo:
-
Open the terminal and copy and paste this: claude mcp add playwright — npx -y @playwright/mcp@latest
-
Claude will ask you about scope - I’d pick User (Global) since this will make Playwright tools available in every terminal session where you run Claude Code.
-
Done! To verify it’s working, type: claude and then /mcp once Claude Code loads. You should see playwright listed as an active server with tools like browser_navigate, browser_click, and browser_screenshot. If you do - congrats, you did it.
Best Practices for Using Playwright in the CLI
-
Be Explicit Early: The first time you want Claude to use the browser, say: “Use playwright mcp to go to [URL]…” This prevents it from trying to write a raw bash script instead of using the protocol.
-
Visible Browser: By default, Playwright via MCP often opens a headed browser window. This is helpful because if the site has a login or a CAPTCHA, you can manually interact with the window and then tell Claude, “I’ve logged in, please continue.”
-
Snapshotting: If Claude seems “stuck,” you can prompt it: “Take a screenshot and tell me what you see.” This helps it recalibrate its understanding of the page layout.
Fin
And that’s it. If you followed along, you now have a super power that you didn’t have before. Rather than having Claude Code build your frontend, and then you, a simply puny human, going manually to the browser and checking it’s work, you can let Playwright jam.