ChromeDevTools / ChromeDevTools/chrome-devtools-mcp
Allow switching execution context to Dedicated Workers
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 52.3k
- Forks
- 4.3k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 83
Description
Hi there,
First off, thank you for the mcp-server project. It's a fantastic tool and a great starting point for programmatic browser interaction.
We are integrating mcp-server into the Neo.mjs framework workflow to give our AI development agent, Gemini 2.5 Pro, the ability to 'see' and interact with the UI. While working on this integration, the agent itself identified this limitation and helped draft this feature request.
Our framework is built on an "Off the Main Thread" (OMT) architecture, where nearly all application logic runs inside workers. This creates a challenge for debugging that we believe mcp-server is uniquely positioned to solve.
The Problem:
The standard Chrome DevTools UI provides a dropdown that allows developers to switch the console's execution context between the main thread and any active workers. This is essential for debugging, as it allows for direct interaction with the global scope of each thread.
Currently, the mcp-server appears to be bound to the main thread's execution context. While some error messages from dedicated workers might bubble up, it's impossible to interact with the worker's scope. For example, we can't run a command like Neo.get('my-component-id') to inspect a live object that exists only within the worker.
Proposed Feature:
Could a mechanism be introduced to replicate the context-switching functionality of the real DevTools?
Ideally, this would involve:
- An API to list all available execution contexts (e.g., main thread, dedicated worker 1, dedicated worker 2).
- An API to set the active execution context for the
mcp-serverconnection.
Once the context is switched to a specific worker, all subsequent Runtime.evaluate calls would execute within that worker's global scope. This would provide the powerful, interactive debugging experience needed for modern, multi-threaded web applications.
We believe this feature would unlock a new level of debugging and automation for any project that leverages dedicated workers.
We'd be happy to provide more details on our use case or assist in testing. Thanks for considering this!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the Runtime.evaluate entry point and how the mcp-server currently selects the main-thread execution context. Define how available main-thread and dedicated-worker contexts are listed and selected, then verify that subsequent Runtime.evaluate calls run in the selected worker scope.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100