Skip to content

Conversation

@alexsorokoletov
Copy link

This change addresses high token consumption during navigation by making page snapshots optional. Previously, every navigation action would capture the full page state (DOM structure, console messages) which consumed many tokens.

Changes:

  • Add snapshotOnNavigation config option (defaults to false for minimal token usage)
  • Add PLAYWRIGHT_MCP_SNAPSHOT_ON_NAVIGATION environment variable
  • Add optional 'snapshot' parameter to browser_navigate and browser_navigate_back tools
  • Users can override default per-navigation via the snapshot parameter

Usage:

  • Default (minimal tokens): No configuration needed
  • Enable globally: export PLAYWRIGHT_MCP_SNAPSHOT_ON_NAVIGATION=true
  • Enable per-navigation: { url: "https://example.com", snapshot: true }

This change addresses high token consumption during navigation by making
page snapshots optional. Previously, every navigation action would capture
the full page state (DOM structure, console messages) which consumed many tokens.

Changes:
- Add snapshotOnNavigation config option (defaults to false for minimal token usage)
- Add PLAYWRIGHT_MCP_SNAPSHOT_ON_NAVIGATION environment variable
- Add optional 'snapshot' parameter to browser_navigate and browser_navigate_back tools
- Users can override default per-navigation via the snapshot parameter

Usage:
- Default (minimal tokens): No configuration needed
- Enable globally: export PLAYWRIGHT_MCP_SNAPSHOT_ON_NAVIGATION=true
- Enable per-navigation: { url: "https://example.com", snapshot: true }

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants