Open-source MCP tool for browser automation

Give your AI testing agent the page context it was missing

Treegress MCP upgrades the default Playwright MCP flow by exposing the full DOM context your agent needs — not just the ARIA snapshot.

For engineers using Playwright MCP to automate testing.

⚠️ Your agent either gets confused or loses context completely

If you've used Playwright MCP beyond simple demos, you've likely seen it: the agent skips elements, misses available actions, or produces incomplete test flows.

The root cause is simple: standard Playwright MCP gives the LLM an ARIA snapshot, not the full set of interactable DOM elements.

That snapshot is only an abstraction of the UI. Even when elements are visible, the agent receives limited and simplified context, which leads to inconsistent decisions and execution errors. Even when accessibility is implemented well, the agent still lacks enough context to understand what elements do and how to use them correctly within the flow.

Why this happens

A side-by-side look at what the agent receives from each approach for the same snapshot
Default Playwright MCP
Sends ARIA snapshot
Incomplete visibility of the website context
May hide real interactable elements from the agent
Agent struggles to complete the task
# SVG Icon Buttons — anonymous clickable images
- img [ref=e29] [cursor=pointer]
- img [ref=e43] [cursor=pointer]
# Toggle Switch — element absent from tree
- generic [ref=e59]: ❌ Inaccessible — div toggle, no ARIA
# Contenteditable — element absent from tree
- generic [ref=e93]: ❌ Inaccessible — contenteditable div, no role
# Custom Dropdown — no children visible
- generic [ref=e51] [cursor=pointer]: Select...
# CSS Toggle — element absent from tree
- generic [ref=e190]: ❌ Single semantic class
vs
Treegress MCP
Serializes the full DOM tree
Returns all interactable elements
Enriches page context so the agent can interpret elements correctly
Gives the agent a fuller, actionable page model to complete tasks on the first attempt
# SVG Icon Buttons — onclick reveals purpose
- generic [ref=e19] [onclick="alert('edit clicked')"] [cursor=pointer]:
    - img [tag=svg]
- generic [ref=e26] [onclick="alert('add clicked')"] [cursor=pointer]:
    - img [tag=svg]
# Toggle Switch — preserved with handler
- generic [ref=e42] [onclick="this.classList.toggle('on')"] [cursor=pointer]:
    - generic
# Contenteditable — attribute surfaced
- generic [ref=e63] [contenteditable]
# Custom Dropdown — hidden children exposed
- generic \"Select...\" [ref=e34] [onclick=\"...dropdown-list...\"] [cursor=pointer]:
    - generic [class=dropdown-list] [hidden]:
        - generic [ref=e35] [onclick=\"event.stopPropagation()\"] [cursor=pointer]: Item 1
        - generic [ref=e36] [onclick=\"event.stopPropagation()\"] [cursor=pointer]: Item 2
        - generic [ref=e37] [onclick=\"event.stopPropagation()\"] [cursor=pointer]: Item 3
# CSS Toggle — class and handler revealed
- generic [ref=e126] [class=toggle-switch] [onclick=\"this.classList.toggle('on')\"] [cursor=pointer]:
    - generic

What we changed

Full DOM serialization
Expose the actual page structure instead of relying only on ARIA snapshot.
All interactable elements
Return the elements your agent can meaningfully act on — including the ones often missed in incomplete accessibility trees.
Enriched website context
We give the agent actionable context — not just the element, but the information needed to understand its purpose and how to use it correctly.

What your agent gets

More useful output for AI-powered browser automation
Treegress MCP Browser gives your AI agent the full DOM, all interactable elements, and context for action — so it can work from a much more actionable representation of the page than a standard ARIA snapshot provides.
Works with your existing setup
You don’t need to change your workflow. Just replace Playwright MCP with Treegress MCP. Please follow the installation steps in README.md file.

Go to GitHub
Better visibility into the real page
Fewer missed UI actions, better reliability
Broader and more seamless test scenario generation

Try it in a few minutes

Built for engineers, who are using Playwright MCP with Claude Code, Cursor, and other AI agents:

  1. Open the GitHub repo
  2. Follow the README
  3. Install Treegress MCP
  4. Run your agent on a real page and compare the difference

Use it on its own, or explore Treegress platform for a broader approach to autonomous testing.