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

オープン 初心者向け
#44,289 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
62/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
git, node.js, typescript
領域
tooling

調査の方向性

デフォルトの出力フォルダは packages/playwright-core/src/tools/backend/context.ts の outputDir() から取得され、スナップショットは packages/playwright-core/src/tools/backend/response.ts からファイルに書き込まれます。まずフォルダがどのように作成されるかを読み、次に packages/playwright-core/src/tools/cli-daemon/program.ts にある、.gitignore に .playwright-cli/ を追加する CLI の修正を確認してください。新しい git リポジトリでサーバーを実行した後も git status --porcelain がクリーンな状態のままであれば完了です。たとえば、内容が * の .playwright-mcp/.gitignore を書き込むことで実現できます。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
100k
フォーク
6.9k
平均マージ
16時間 8分
マージ済み PR(30日)
281

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/playwright のほかの issue

microsoft/playwright の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。