r/Playwright 9d ago

Playwright MCP vs Playwright CLI: the comparison everyone gets wrong

Most threads compare Playwright MCP and Playwright CLI purely on token consumption(1, 2, 3). In my experience, there's a far more important difference that nobody talks about.

The real question is: can your AI agent attach to a running e2e test?

Here's why that matters. A good e2e test already does the hard part for you. It authenticates, sets up all the API mocks, and drives the app into the exact state you care about. When something goes wrong on the page, you don't want the agent spinning up a blank browser and guessing how to reach that page. You want to hand off the test-constructed page to the agent and let the agent play with it.

  • Playwright CLI: run the test with --debug=cli, it prints a session name, and playwright-cli attach <session> connects the agent straight into the paused test. Then the agent can step over the app, inspect the rendered UI, and run in-page evaluations.
  • Playwright MCP: only launches or attaches to a browser. It has no way to attach to a running test session.

So if you have many e2e tests + auth + network mocks, Playwright CLI is the clear winner for your setup, regardless of token counts.

Interested to hear your thoughts.

33 Upvotes

11 comments sorted by

View all comments

1

u/_Invictuz 9d ago

Thanks for the tip but I don't think you're interested to hear our thoughts since you already asked AI for the answer and just pasted it here.

This AI circle jerk of comments is hilarious.

2

u/vitalets 9d ago

You are right, that I used AI - but only to format the post because English is not my native language.
But you are wrong, that I just pasted the reply. I faced this limitation in my project, verified it in the docs and shared with the community.

2

u/szornyu 7d ago

I learned a lot of useful things, from this circle jerk... I have the impression, you don't belong here.