Skip to main content
Glama
palimpsest-labs

playwright-archive-mcp

README.md
# playwright-archive-mcp

MCP server that drives a headless or interactive Playwright browser and records every HTTP request/response into the shared web-archive store (entry type `request`), making captured traffic searchable via [`unified-history-mcp`](https://github.com/palimpsest-labs/unified-history-mcp).

Part of the [Palimpsest](https://github.com/palimpsest-labs/palimpsest) investigative toolkit. The archive write-path and SSRF URL validation come from the shared [`web-archive-store`](https://github.com/palimpsest-labs/web-archive-store).

## Tools

| Tool | Description |
|---|---|
| `playwright_record(urls, wait, timeout, ...)` | Batch: drive a headless browser against URL(s), record all HTTP traffic |
| `playwright_start` | Start a persistent interactive session with always-on recording |
| `playwright_navigate` / `playwright_click` / `playwright_fill` | Drive the interactive session |
| `playwright_text` / `playwright_html` / `playwright_screenshot` | Read page content / save a screenshot |
| `playwright_back` / `playwright_forward` / `playwright_stats` / `playwright_close` | Session control |

Auth headers are redacted by default; binary/streaming bodies are skipped. Recorded entries become searchable once the web-archive `rebuild` tool runs.

## Install

`playwright-archive-mcp` depends on `web-archive-store` — install it first:

```bash
git clone https://github.com/palimpsest-labs/web-archive-store
cd web-archive-store
python3 -m venv .venv
source .venv/bin/activate
pip install -e .

cd ..
git clone https://github.com/palimpsest-labs/playwright-archive-mcp
cd playwright-archive-mcp
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
playwright install chromium   # downloads the browser binary
```

Once `web-archive-store` is published to PyPI this becomes a single `pip install -e .`.

## CLI

A standalone recorder CLI is available both as a console script and a direct-run script (the latter works from a fresh clone if the sibling `web-archive-store` checkout is present):

```bash
playwright-archive https://example.com https://example.org
# or
python playwright_archive.py https://example.com
```

## Tests

```bash
pip install -e ".[dev]"
pytest
```

The suite is browser-free (pure logic + validation paths), so it runs without `playwright install chromium`.