ChromeDevTools / ChromeDevTools/chrome-devtools-mcp

Accessibility tree/snapshot for a specific DOM element, including whole hierarchy below it (custom "root" element)

Open
#716 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

collecting-feedback feature
Dominant language
TypeScript
Stars
52.3k
Forks
4.3k
Avg merge
2d 7h
Merged PRs (30d)
83

Description

Is your feature request related to a problem? Please describe.

With #363, we have the possibility to extract the whole structure and whole structure alone.

This is great, but can also cause context "overflows" or extreme token usage for complex pages where we perhaps just wanted to check a specific element or a sub-tree of specific elements.

Describe the solution you'd like

As discussed in https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/363#issuecomment-3456531920

To make things flexible and effective, I suggest to have the possibility to "extract" only a sub-tree, based on a specific root element that I can define.

For example - if I want to just get the navigation and not the whole page, I could use the nav#main-nav or just #main-nav as a root and the MCP would return nav all elements under it.

That would help me to isolate the results when needed and saved on time, tokens and other resources.

Describe alternatives you've considered

Surely, we can post-process the whole tree after it is extracted. But that means that we always use a lot of time and tokens and can sometimes get to the limits of context window etc. Especially for smaller LLMs.

Additional context

In my experience, as a developer, I often work on components in isolation and less in the context of a full page. This means that getting whole tree all of the time is wasting time and resources and making me less effective.

I guess that most of developers work more on single components than on whole pages, so I think that having the isolated results for a specific component is way more effective. Especially on larg(er) sites with lots of components.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading issue #363 and the linked discussion to understand the existing full accessibility-tree extraction. Define how a selector such as nav#main-nav or #main-nav should establish the root, then verify that the result contains that element and its complete descendant hierarchy without extracting unrelated page content.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
accessibility
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.