bikashdehury919

Playwright MCP VS CLI — Testing skill for Claude Code

Testing community

Measuring Playwright MCP vs Playwright CLI for agentic test automation in Claude Code: 3 scenarios, real token numbers.

How to install Playwright MCP VS CLI

This entry records only its repository, not the path inside it, so there is no exact command to give. Open bikashdehury919/playwright-mcp-vs-cli and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Playwright MCP VS CLI does

Measuring Playwright MCP vs Playwright CLI for agentic test automation in Claude Code: 3 scenarios, real token numbers.

Alternatives in Testing

  • Playwright — claude-plugins-official Browser automation, E2E testing, screenshots 29.4k ★
  • Playwright Automation — git clone Browser automation skill for end-to-end testing and web interaction 2.3k ★
  • RocketSimApp — RocketSim — 30+ tools for Xcode's iOS Simulator 791 ★

README

Playwright MCP vs Playwright CLI in Claude Code

**Author:** Bikash Dehury · Test Automation Specialist · [LinkedIn](https://www.linkedin.com/in/bikash-dehury-90a10577/)

Every week someone on my feed says Playwright MCP is the way to give an AI agent a browser, and the next day someone else says the new Playwright CLI makes MCP obsolete because it uses a fraction of the tokens. Most of those posts quote the same two README paragraphs.

I wanted numbers from my own machine. So I set up two identical Playwright projects, gave one of them Playwright MCP and the other Playwright CLI, and ran the same three test automation tasks in Claude Code in both. Same app, same prompts, same model. The only difference is how the agent talks to the browser.

TL;DR

Scenario What the agent had to do Cost MCP Cost CLI Quality Winner
S1 Self-heal Fix 2 broken locators after a UI change $0.30 $0.33 MCP: 2/2 green, fixed only the 2 broken locators. CLI: 2 MCP (small margin)
S2 Exploratory Find bugs as problem_user $0.99 $0.91 MCP 8 findings, CLI 14 (all 8 of MCP's plus 6 more) CLI
S3 Suite generation Write a 5-test page-object suite $0.74 $0.62 Both 15/15 over 3 repeats, same structure CLI

What surprised me:

  1. The token gap is 8 to 22%, not the ~4x you see quoted. Claude Code loads MCP tools on demand. The Playwright MCP tool list cost 1.2k tokens in context, not the ~4.4k the full schema would take. On top of that, 95 to 98% of input tokens came from the prompt cache in every run.
  2. My S2 hypothesis was wrong. I expected MCP to win exploratory testing because the page is the subject. The CLI found more bugs for less money.
  3. Same model, same result shape. In S3 both agents produced the same 3 spec files and the same 7 page objects. The interface changed how many steps it took to get there (18 requests for MCP, 12 for CLI), not what got built.

Setup

| | | |-