[Feature]: Let an MCP client label its own extension tab group

Aperta
#43,823 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@microsoft-playwright-automation ci sta già lavorando.

Dal 31/10/2026.

  • #43827 di @microsoft-playwright-automation — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
15/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
testing, tooling

Direzione di ricerca

The request adds an MCP tool, browser_set_group_label, available only in --extension mode, which relays a session-level extension.setGroupLabel command to the browser extension. Start with the existing open pull request #43827, which already implements this behavior, and the multi-connection tab group code it builds on. Done means the group title becomes Playwright · <label>, duplicates get a (2)/(3) suffix, an empty label resets the default, and a test with two connections sharing a clientName shows neither affects the other. Coordinate with the author before starting, since the work is already under way.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

milestone needs-triage

Follow-up to #41840 (closed in #43813), re-filed against v1.64.1 with a concrete use case as requested.

What I'm trying to do

I run several AI agent sessions in parallel (Claude Code in a few terminals plus Claude desktop), all driving my everyday Chromium-based browser through the Playwright MCP Bridge extension (--extension). Each session works on a different task, e.g. one checks an order flow, one reads docs, one fills a form.

Since multi-connection support (#42259), each connection gets its own tab group titled Playwright · <clientName> with its own color. That keeps tabs apart, but it doesn't tell me which group belongs to which task:

  • All sessions come from the same client, so every group gets the same title (Playwright · claude-code, Playwright · claude-code, ...).
  • Colors are assigned in connection order, so they don't map to anything I can remember.
  • When a session asks me to finish something by hand (a login, a payment step, a captcha), I have to open each group to find the right tab.
Why existing options don't cover it

clientName comes from the MCP client and is the same for every session of that client. There's no way for the server or the agent to set a more specific group title. Only the agent knows what it's working on, so the label has to be settable at runtime.

Proposal

An MCP tool, available only in --extension mode, that lets a connection label its own tab group:

browser_set_group_label({ label: "checkout flow bug" })

→ the group becomes Playwright · checkout flow bug.

This was already implemented in #42360 (green CI, closed as part of the archiving). The behavior there, plus answers to the open questions from #41840:

  • Ownership: a connection can only rename its own group. There's no group/connection id parameter.
  • Duplicates: if another active connection uses the same label, a (2), (3) suffix is added.
  • Constraints: label is trimmed and capped at a reasonable length. Chrome may still truncate the title in the tab strip, and that's fine.
  • Reset: an empty label restores the default Playwright · <clientName>.
  • Disconnect: nothing to clean up. The label lives with the connection's group and goes away with it.
  • Compatibility: a new session-level extension.setGroupLabel relay command, no protocol bump. An older extension returns a clear "update the extension" error.
  • Tests: two connections with the same clientName, each sets a label. Check the titles and that neither can affect the other.
Smaller alternative

If a new tool is too much, a startup option would cover most of my case: --tab-group-label <label> (or an env var) on the MCP server, used instead of clientName in the group title. I'd set it per session when I launch the agent. It's less flexible than the tool, since the label can't follow the task, but it needs no protocol change.

cc @dosxnjos (author of #41840)

Lingua principale
TypeScript
Stelle
99.1k
Fork
6.8k
Merge medio
16h 3m
PR unite (30g)
315

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/playwright

Tutte le issue di microsoft/playwright

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.