Skip to content

Enable multi-tab debugger support for concurrent MCP clients#39

Open
elik-ru wants to merge 1 commit into
mainfrom
feature/multi-tab-debugger-support
Open

Enable multi-tab debugger support for concurrent MCP clients#39
elik-ru wants to merge 1 commit into
mainfrom
feature/multi-tab-debugger-support

Conversation

@elik-ru

@elik-ru elik-ru commented Dec 21, 2025

Copy link
Copy Markdown
Contributor

Summary

  • Replace single debugger tab tracking with Set of attached tabs
  • Keep debuggers attached to all used tabs instead of detaching when switching
  • Allow multiple MCP clients to use different tabs simultaneously

Problem

When two MCP clients tried to use different tabs in the same browser:

  1. Client A attaches to tab 1, debugger attached
  2. Client B attaches to tab 2, debugger detaches from tab 1 and attaches to tab 2
  3. Client A CDP commands timeout because debugger is no longer on tab 1

Solution

Instead of tracking a single debuggerAttached boolean and currentDebuggerTabId, we now use a Set of tabIds to track all tabs with debuggers attached. When switching tabs, we no longer detach from previous tabs - all debuggers stay active.

Test plan

  • Build Chrome extension
  • Run server tests (76 passed)
  • Manual test with two MCP clients on different tabs

Previously, when switching tabs, the debugger would detach from the previous tab
causing CDP commands to timeout. This was problematic when multiple MCP clients
tried to use different tabs in the same browser.

Changes:
- Replace single debuggerAttached/currentDebuggerTabId with Set of attached tabs
- Keep debuggers attached to all used tabs instead of detaching when switching
- Update event listener to accept events from any attached tab
- Track total attached tabs in log messages for debugging

This allows multiple MCP clients to work on different tabs simultaneously without
interfering with each other.
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.

1 participant