Skip to content

Connection drops when opening multiple browser pages - no graceful degradation #978

@ljch2018

Description

@ljch2018

Description of the bug

When using chrome-devtools-mcp for multi-page operations, opening too many browser tabs (6+) causes the WebSocket connection to drop with error:

MCP error -32000: Connection closed

Root Cause Analysis

After investigation into the source code (v0.17.1), I identified three contributing factors:

1. CDP Session Multiplexing Overhead

Each browser page creates a separate CDP session via Target.attachToTarget. With 6+ pages, the event volume can overwhelm the single WebSocket channel.

2. No Connection Health Monitoring

The WebSocket transport has no heartbeat/keepalive mechanism. When Chrome becomes unresponsive, the connection silently dies.

3. No Auto-Recovery

In browser.js, the code only checks connected state but provides no reconnection logic.

Reproduction

No response

Expectation

No response

MCP configuration

No response

Chrome DevTools MCP version

0.17.1

Chrome version

Latest stable

Coding agent version

Claude Code

Model version

Claude Opus 4.5

Chat log

No response

Node version

v22.x

Operating system

macOS

Extra checklist

  • I want to provide a PR to fix this bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions