Skip to main content

In-Process Mode

Run the BAP Playwright server in the same process as the MCP server, bypassing WebSocket entirely. Uses DirectTransport for zero-overhead communication.

Enable In-Process Mode

How It Works

Default Mode (WebSocket)

The MCP server spawns a separate Playwright server process and communicates over WebSocket with JSON-RPC 2.0.

In-Process Mode (DirectTransport)

The Playwright server runs in the same Node.js process. DirectTransport passes messages directly in memory — no serialization, no network, no child process.

Trade-offs

Advantages

  • Lower latency (no WebSocket overhead) - No child process management - Simpler deployment (single process) - Slightly lower memory usage

Limitations

  • Server-push notifications are not supported - No event streaming (console errors, network failures) - Cannot share the server with other clients - If the server crashes, the MCP server crashes too
In-process mode does not support server-push notifications. This means browser console errors and network failure events will not be forwarded to the MCP client. If you need event streaming, use the default WebSocket mode.

When to Use

Combining with Other Flags

In-process mode works with other MCP flags:
The --url flag is incompatible with --in-process. You cannot connect to an external server in in-process mode — the whole point is running everything in one process.