[MCP]: page snapshots in .playwright-mcp/ are not git-ignored (.playwright-cli/ is, since #42318)

Abierto Apto para principiantes
#44,289 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
62/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
git, node.js, typescript
Área
tooling

Línea de trabajo

La carpeta de salida predeterminada proviene de outputDir() en packages/playwright-core/src/tools/backend/context.ts, y las instantáneas se escriben en un archivo desde packages/playwright-core/src/tools/backend/response.ts. Empieza leyendo cómo se crea la carpeta y luego revisa la corrección de la CLI en packages/playwright-core/src/tools/cli-daemon/program.ts, que añade .playwright-cli/ a .gitignore. Está terminado cuando una ejecución del servidor en un repositorio git nuevo deja git status --porcelain limpio, por ejemplo escribiendo .playwright-mcp/.gitignore con el contenido *.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

What's going on?

After browser_navigate, browser_click, browser_type and most other calls, the MCP server writes a snapshot of the page to .playwright-mcp/page-<time>.yml. When the page logs anything, its console messages go to console-<time>.log beside it. The folder is created in the workspace: the client's MCP root, or the server cwd when there is no root. For a coding agent that is the project, usually a git repository, and nothing ignores the folder:

$ git status --porcelain
?? .playwright-mcp/console-2026-11-22T00-13-19-546Z.log
?? .playwright-mcp/page-2026-11-22T00-13-19-601Z.yml

A snapshot is the text of the page. On a signed-in page that means names, e-mail addresses and account details, one git add -A away from a commit. I noticed it when the first snapshot of a session, taken on a Google account chooser, listed every signed-in address. On my own machine, 10 git repositories have this folder: 8 have a .playwright-mcp/ line added to their .gitignore, and in the other 2 it sat untracked (412 files) until I counted.

#42307 reported the same gap for the CLI, and #42318 fixed it: playwright-cli install now appends .playwright-cli/ to .gitignore, "since traces and storage state saved there can contain credentials". The MCP server has no install step, so nothing does this for .playwright-mcp/. (microsoft/playwright-mcp#1789 asked to move these files out of the workspace and was declined, with the advice to treat .playwright-mcp like .env. I am not asking to move them.)

Steps

  1. git init demo
  2. Start the server with demo as its cwd, or announce demo as the client's only MCP root.
  3. Call browser_navigate on a page that logs to the console.
  4. git -C demo status --porcelain prints the two lines above, and git check-ignore exits 1 for both files.

Expected: the default output folder stays out of git status. One way that leaves the user's .gitignore alone: when the server creates .playwright-mcp/, it also writes .playwright-mcp/.gitignore containing *, as Python's venv and pytest's cache directory do. With that file added by hand, git status in the steps above is clean.

The folder comes from outputDir(); every snapshot except an explicit browser_snapshot goes to a file.

Version

@playwright/mcp 0.0.86 (playwright-core 1.66.0-alpha-2026-11-18), and the same with playwright-core 1.66.0-alpha-2026-11-21. Windows 11, Node 24.21.0; the folder logic is not platform-specific.

Lenguaje dominante
TypeScript
Estrellas
100k
Forks
6.9k
Merge medio
16 h 8 min
PR fusionados (30 d)
281

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de microsoft/playwright

Todos los issues de microsoft/playwright

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.