[MCP] browser_tabs list/select indices diverge across HTTP sessions with --shared-browser-context

Abierto
#44,279 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
22/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
devtools, playwright, typescript

Línea de trabajo

The report is about per-MCP-session tab registry and current-tab state in the browser_tabs tool under --shared-browser-context, so start in the MCP server's session handling and tab-index bookkeeping. Reproduce with two HTTP sessions: create a tab, list it, then select the same index from a new session. Done means indices resolve consistently across sessions or the scoping is documented; the issue has no comments or decision yet, so confirm with maintainers before changing behavior.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Environment
  • @playwright/[email protected]
  • macOS (Apple Silicon), Chrome Stable, Playwright Chrome extension
  • Server flags: --extension --shared-browser-context --background --host 127.0.0.1 --port 8931
  • MCP client reaches the HTTP endpoint through an authenticated tunnel; successive tool calls can establish new HTTP MCP sessions.
Observed behavior

With the same extension-backed Chrome browser:

  1. Tool call: browser_tabs({action:"new", url:"about:blank"}) reports the new tab (e.g. index 1).
  2. Subsequent tool call: browser_tabs({action:"list"}) displays index 1.
  3. Subsequent tool call, under another MCP session ID: browser_tabs({action:"select", index:1}).
  4. Actual: Error: Tab 1 not found.

In our test environment the tab exists in Chrome and shows in the returned listing. --shared-browser-context appears to share the underlying browser context without making the tool's per-MCP-session tab registry and current-tab state stable across new sessions.

Control / workaround

Using one persistent upstream MCP session, keeping the same Mcp-Session-Id across calls, the sequence new -> list -> select -> close passes on the same installation. A small single-operator local intermediary that holds one upstream session resolved the symptom.

The intermediary is not safe multi-tenant isolation: unrelated clients should not share unrestricted browser control. We are not asking to grant cross-client tab access implicitly.

Request

Could the behavior be clarified in documentation and/or improved with stable/selectable tab identifiers across reconnects where explicitly authorized? If list results are MCP-session-local, it would help to document the need for a persistent Mcp-Session-Id and avoid giving the impression that positional indices are usable across independently created client sessions.

Related issues

We can share a minimal HTTP harness if additional reproduction details would help.

Lenguaje dominante
TypeScript
Estrellas
100k
Forks
6.9k
Merge medio
16 h 8 min
PR fusionados (30 d)
281

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de microsoft/playwright

Todos los issues de microsoft/playwright

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.