Skip to content

Hub multi-client: pin MCP session to one Chrome profile/window; warn on --no-startup-window attach #131

Description

@Trace824

Summary

Multiple Chrome profiles can each load FSB and connect to the hub on :7225. An MCP session may attach to a profile started with --no-startup-window (no UI window) while the user’s visible session is another profile. Symptoms include No current window, empty list_tabs, and navigate failures until the headless/wrong profile is killed.

Repro

  • Context: Two+ Chrome user-data-dirs both running FSB; MCP hub on ws://localhost:7225.
  • Steps:
    1. Start profile A with a visible window and X signed in.
    2. Start profile B with --no-startup-window (or otherwise no usable window); both extensions connect to hub.
    3. From MCP, call list_tabs / navigate.
  • Observed: wrong extension wins attach; list_tabs empty or “no current window” class failures; recovery requires killing the wrong Chrome.

Code pointers (verified against /workspace/FSB)

  • mcp/src/bridge.ts — hub on port 7225, relay clients, multi-instance hub/relay (~L128+, ~L163+).
  • mcp/src/version.tsFSB_EXTENSION_BRIDGE_PORT = 7225.
  • mcp/README.md — multi-client hub/relay notes (~L589).
  • extension/utils/agent-tab-resolver.jsTAB_NOT_OWNED (~L106).
  • extension/ui/sidepanel.js — “no active tab in current window” (~L347).
  • Likely area: bridge session binding / extension registration metadata (profile or window id) — confirm before inventing new APIs.

Proposed fix

Pin each MCP client session to a single extension connection (Chrome profile/window). On attach, reject or warn if the connected Chrome has no normal window (e.g. --no-startup-window). Prefer explicit selection when multiple extensions are connected rather than silent last-writer-wins.

Acceptance / regression

  • With two profiles connected, MCP tools target only the pinned profile; wrong-profile attach surfaces a clear error.
  • --no-startup-window-only connection cannot become the silent default for interactive compose.
  • list_tabs non-empty for the pinned visible profile.

Owner

mcp-server (primary) + extension (window/profile metadata on connect)


Priority: P0 · Owner: mcp-server

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions