Skip to content

Add Windows support: Named Pipe bridge, devcontainer helper, updated docs - #2

Open
DavidSchmidt00 wants to merge 1 commit into
vaclavpavek:mainfrom
DavidSchmidt00:windows-named-pipe-support-v2
Open

Add Windows support: Named Pipe bridge, devcontainer helper, updated docs#2
DavidSchmidt00 wants to merge 1 commit into
vaclavpavek:mainfrom
DavidSchmidt00:windows-named-pipe-support-v2

Conversation

@DavidSchmidt00

Copy link
Copy Markdown

Summary

On Windows, Claude Code uses a Named Pipe (\\.\pipe\claude-mcp-browser-bridge-<user>) instead of a Unix socket for Chrome IPC. The existing bridge-host.js looks for .sock files and connects via AF_UNIX, so it silently fails on Windows with no error — the pipe simply never gets found.

This PR adds full Windows / VS Code Dev Containers support with two new files and updated docs.

Changes

bridge-host.ps1 (new)

  • Drop-in replacement for bridge-host.js on Windows — no Node.js required
  • Connects to \\.\pipe\claude-mcp-browser-bridge-<user> via System.IO.Pipes.NamedPipeClientStream
  • Uses a RunspacePool for concurrent connection handling (equivalent to Node's event loop)
  • Bidirectional byte forwarding via CopyToAsync
  • Polls listener.Pending() instead of blocking on AcceptTcpClient() so Ctrl+C works cleanly
  • Requires PowerShell 7+ (winget install Microsoft.PowerShell)

bridge-devcontainer.sh (new)

  • Self-contained helper script for the container side — no Docker/Makefile workflow needed
  • Installs socat if missing, creates the required chrome-native-host stub, cleans stale sockets, verifies host reachability, and starts the socat bridge
  • Works in any devcontainer (VS Code Dev Containers, Codespaces, etc.)

README.md (updated)

  • Adds a Windows / VS Code Dev Containers setup section
  • Documents the Named Pipe vs Unix socket platform difference
  • Documents the -BridgeHost '::' requirement for WSL2 (Dev Containers resolve host.docker.internal as IPv6)
  • Documents startup order: claude --chrome on Windows must run first to keep the Named Pipe alive
  • Simplifies container-side setup to a single bash bridge-devcontainer.sh command

How it was discovered

Tested on Windows 11 with a VS Code Dev Container (WSL2 backend). Inspecting [System.IO.Directory]::GetFiles('\\.\pipe\') revealed the pipe at \\.\pipe\claude-mcp-browser-bridge-<user> — no .sock files exist anywhere on the Windows filesystem when Claude Code is running.

Test plan

  • Run claude --chrome on Windows to create the Named Pipe
  • Start bridge-host.ps1 -BridgeHost '::' — should log Pipe found -- ready
  • Run bash bridge-devcontainer.sh inside Dev Container — should complete without errors
  • Run claude --chrome inside Dev Container — extension should be detected and browser tools should work
  • Ctrl+C stops bridge-host.ps1 cleanly

…docs

On Windows, Claude Code uses a Named Pipe instead of a Unix socket for
Chrome IPC. This PR adds a PowerShell 7 bridge and a self-contained
devcontainer helper script so the feature works from VS Code Dev Containers
on Windows without Node.js.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant