Skip to main content

Video Recording

Record browser sessions as WebM videos with chapter markers. Requires the devtools capability.

{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest", "--caps=devtools"]
}
}
}

browser_start_video

ParameterTypeRequiredDescription
filenamestringnoCustom filename
widthnumbernoVideo width in pixels
heightnumbernoVideo height in pixels

browser_stop_video

→ browser_stop_video
Video saved to: /output/login-flow.webm

browser_video_chapter

Add chapter markers for structured recordings.

ParameterTypeRequiredDescription
titlestringyesChapter title
descriptionstringnoChapter description
durationnumbernoDisplay duration in ms

Workflow: recording a bug reproduction

→ browser_start_video { filename: "cart-bug-repro.webm" }

→ browser_video_chapter { title: "Setup: add items to cart" }
→ browser_navigate { url: "https://store.example.com" }
→ browser_click { ref: "e8" } // Add item 1
→ browser_click { ref: "e12" } // Add item 2
→ browser_click { ref: "e20" } // Go to cart

→ browser_video_chapter {
title: "Verify items in cart",
description: "Both items should be visible"
}
→ browser_snapshot
- list "Cart items":
- listitem: "Headphones - $49.99"
- listitem: "Cable - $9.99"

→ browser_video_chapter {
title: "Bug: refresh clears cart",
description: "Cart should persist but items disappear"
}
→ browser_reload
→ browser_snapshot
- heading "Your cart is empty" [level=1]
→ browser_take_screenshot

→ browser_stop_video
// Attach cart-bug-repro.webm to the bug report

Automatic recording

Record all sessions automatically using the environment variable:

{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest", "--caps=devtools"],
"env": { "PLAYWRIGHT_MCP_SAVE_VIDEO": "800x600" }
}
}
}

Or via the config file:

{
"saveVideo": { "width": 800, "height": 600 }
}

Use cases

ScenarioApproach
Bug reproductionRecord steps, attach to issue
Test documentationRecord with chapter markers
Agent monitoringRecord agent sessions for review
Demo creationRecord polished walkthrough