StepGleam logoStepGleam
Coding guide

Let the agent check its own UI with Playwright MCP

Stop pasting screenshots. Add the Playwright MCP server so the agent can open your dev server, read the page structure and compare it with what you asked for.

~20 minBeginner 76/100 5 steps Updated Oct 26, 2026
Playwright MCPClaude Code
Let the agent check its own UI with Playwright MCP — illustration for this Coding guide

Tools used

Step navigator0/5 done
0 of 5 steps done
What you'll get

An agent that opens your local app, inspects the result and reports evidence, instead of you taking screenshots.

Who this is for

Frontend developers using Claude Code, Cursor or another MCP client.

Read this first

Before you start

A developer on r/ClaudeAI said they were "losing brain cells" taking screenshots of their UI for Claude Code. The replies pointed to one fix: add a Playwright MCP server so the agent can look for itself. Anthropic's guide recommends giving the agent this kind of visual check.

Step-by-step instructions

Step 1 of 5 · Coding

Add the Playwright MCP server

In Claude Code: claude mcp add playwright npx @playwright/mcp@latest. In Cursor: Settings → MCP → Add new MCP Server with npx @playwright/mcp@latest. One user's summary: "Just add puppeteer or playwright MCP servers to your Claude config. It's a few lines of JSON."

Copy-ready promptClaude Code
claude mcp add playwright npx @playwright/mcp@latest
Let the agent check its own UI with Playwright MCP — guide thumbnail
Step 2 of 5 · Coding

Start your dev server yourself

Run the app locally (the poster's example is localhost:3000) so the agent has something to open.

Step 3 of 5 · Coding

Ask it to open the page and report what it finds

Playwright MCP works from the page's accessibility tree rather than pixels, returning roles and text the model can act on. The same user had Claude try both tools and "it preferred playwright due to ability to snapshot DOM"; others in the thread use it to read console errors.

Copy-ready promptPlaywright MCP
Open http://localhost:3000/settings, check the form matches the spec in SPEC.md, report any console errors, and list the differences.
Step 4 of 5 · Coding

Give it a visual target and let it iterate

Anthropic's example for UI work: "[paste screenshot] implement this design. take a screenshot of the result and compare it to the original. list differences and fix them."

Why this works

A check it can run closes the loop without you.

Step 5 of 5 · Coding

Review the evidence, then look yourself

Ask for evidence (snapshots, console output) rather than a claim that it looks right, then open the page yourself before shipping. Anthropic: "Have Claude show evidence rather than asserting success."

End of guide · Reviewed Oct 26, 2026

Pro tips2
  • Give stated acceptance criteria rather than "does it look right".
  • Screenshots fill the context quickly; use page snapshots for routine checks.
Common mistakes2
  • Letting the agent call a UI change done without opening the page.
  • Taking a screenshot after every tiny edit.
FAQ2
Does it need a vision model?
No. Playwright MCP uses structured accessibility snapshots.
Puppeteer or Playwright?
Both have MCP servers; users in the thread preferred Playwright.