Skip to content

Using MCP agent to observe Playwright debug browser session #1382

@mrrinatino

Description

@mrrinatino

I have an idea for how I could use your MCP server.
I’d like the agent to observe the browser that is opened in debug mode when running Playwright tests. For example, when I run npx playwright test --debug, the browser launches and I step through the scenario interactively.

I want the agent to analyze each step — DOM tree, console output, network activity — and then adjust or improve the generated test code accordingly (e.g., suggest a better locator or detect errors).

This would be part of an automated workflow where an agent helps create an end-to-end test from scratch.

Is it possible to make the agent and Playwright use or observe the same browser instance/session for this purpose?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions