> For the complete documentation index, see [llms.txt](https://docs.currents.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.currents.dev/ai/agent-evidence/bug-and-fix/playwright-mcp.md).

# With Playwright MCP

Record what an agent did with Playwright MCP, with a trace, screenshots and page snapshots, and share it as a Currents session

[Playwright MCP](https://github.com/microsoft/playwright-mcp) is an MCP server that lets an agent drive a browser. When the agent also records a trace, screenshots and page snapshots, you can check what it did in the browser instead of trusting its summary. Save the recording to Currents as a [session](/ai/agent-evidence.md), and you get one link to all of it.

## What you need

* Playwright MCP with its tracing tools turned on, so the agent can record a trace. The `--caps=devtools` option turns them on. For Claude Code:

  ```bash
  claude mcp add playwright -- npx @playwright/mcp@latest --caps=devtools
  ```
* The Currents CLI and a key. See [Install the Currents CLI and set a key](/ai/agent-evidence.md#install-the-currents-cli-and-set-a-key).

## Ask the agent

```
Reproduce the checkout total bug at http://localhost:3000 with Playwright MCP.
Record it as a Currents session, fix the code, record it again, and post both
links on the pull request.
```

With a Currents [skill](/ai/agent-skills.md), the agent records and shares the session without more instructions. Claude Code recording the bug, sped up:

<figure><img src="https://3745692499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqmFDEiUa9mr11LUlxDnt%2Fuploads%2Fgit-blob-34cdb79843797c3474fd74ac02afa6022a211313%2Fterminal-playwright-mcp.gif?alt=media" alt="A terminal: Claude Code empties the traces folder, starts a failed session, starts tracing, fills the discount code and clicks Apply with Playwright MCP, saves a screenshot and a page snapshot, stops tracing, attaches the files captioned before, and shares the session"><figcaption></figcaption></figure>

## What you get

A session with the before and after, in the Gallery view:

<figure><img src="https://3745692499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqmFDEiUa9mr11LUlxDnt%2Fuploads%2Fgit-blob-e2bf1fdec7840dbdf109dbfc9a98a76a364ca3ba%2Fsession-gallery.png?alt=media" alt="A session gallery with the before and after screenshots, the before and after traces, the console log and the two page snapshots"><figcaption></figcaption></figure>

The trace opens in a trace player on the session page. A page snapshot is the page's accessibility tree, with its text. Two page snapshots show what changed, even when two screenshots look the same.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.currents.dev/ai/agent-evidence/bug-and-fix/playwright-mcp.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
