Skip to content

Fix for Playwright MCP context-window bloat (your HN thread #45764043) #19

Description

@zyphonOS

Saw your HN thread about �rowser_snapshot returning the full accessibility tree on every call:
https://news.ycombinator.com/item?id=45764043

Built a delta snapshot filter that solves it — caches the accessibility tree on the first call and only returns changed nodes on subsequent calls. Typical reduction from ~800+ lines to ~20-50 lines.

Open source solution:
https://github.com/zyphonOS/AOSI/blob/main/tools/playwright-mcp-fix/pwmcp_delta.py

Includes three strategies:

  • A) Agent prompt to minimize �rowser_snapshot calls
  • B) Delta proxy (caches tree + diffs each call)
  • C) Shell filter via jq on the raw snapshot

Happy to discuss or help integrate.

— Greg / AOSI

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions