Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
430 changes: 129 additions & 301 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ path = "src/main.rs"
[dependencies]
serde = { version = "1", features = ["derive"] }
serde_json = "1"
clap = { version = "4.4", features = ["derive"] }
clap = { version = "=4.4.18", features = ["derive"] }
anyhow = "1.0"
log = "0.4"
env_logger = "0.11"
Expand All @@ -29,5 +29,5 @@ name = "browser-connection"
path = "src/bin/browser-connection.rs"

[dev-dependencies]
tempfile = "3.0"
proptest = "1.4"
tempfile = "=3.10.1"
proptest = "=1.4.0"
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,25 @@ browser-connection --help
# automatically when /var/run/docker.sock is not mounted.
docker-git-browser-connection start --project dg-my-project --network container:dg-my-project

# Output:
# If dg-my-project does not exist yet, the MCP binary also works standalone:
# it falls back to Docker bridge mode, publishes deterministic project ports,
# and returns whichever CDP/noVNC URLs are actually reachable from the caller.
browser-connection --project dg-my-project

# Example output from the lifecycle CLI:
# Browser started for project: dg-my-project
# Container: dg-my-project-browser
# noVNC: http://127.0.0.1:6080/vnc.html?autoconnect=true&resize=remote&path=websockify
# CDP (for MCP Playwright / Hermes): http://127.0.0.1:9223
# noVNC: http://127.0.0.1:6450/vnc.html?autoconnect=true&resize=remote&path=websockify
# CDP (for MCP Playwright / Hermes): http://127.0.0.1:9593
```

Health check:

```bash
curl http://127.0.0.1:9223/json/version
open http://127.0.0.1:6080/vnc.html?autoconnect=true\&resize=remote\&path=websockify
# Use the CDP/noVNC URLs printed by `start`; in containerized Docker hosts the
# module may choose the browser container IP instead of 127.0.0.1 host ports.
curl -H 'Host: 127.0.0.1:9222' http://127.0.0.1:9593/json/version
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Port mismatch in Host header and URL.

The curl health check uses port 9222 in the Host header but port 9593 in the URL. Based on the example output at line 47, the CDP port for this project is 9593, so the Host header should match.

📝 Proposed fix
-curl -H 'Host: 127.0.0.1:9222' http://127.0.0.1:9593/json/version
+curl -H 'Host: 127.0.0.1:9593' http://127.0.0.1:9593/json/version
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
curl -H 'Host: 127.0.0.1:9222' http://127.0.0.1:9593/json/version
curl -H 'Host: 127.0.0.1:9593' http://127.0.0.1:9593/json/version
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` at line 55, The curl health-check example uses a Host header port
9222 that doesn't match the URL port 9593; update the example curl command (the
line starting with "curl -H 'Host: 127.0.0.1:9222'
http://127.0.0.1:9593/json/version") so the Host header port is 9593 (e.g.,
"Host: 127.0.0.1:9593") to match the CDP port shown earlier.

open 'http://127.0.0.1:6450/vnc.html?autoconnect=true&resize=remote&path=websockify'
```

## MCP config: use `browser-connection`, not `npx @playwright/mcp`
Expand Down Expand Up @@ -119,10 +126,10 @@ Expected output includes:
Codex/Hermes MCP client
↓ command = "browser-connection"
Rust MCP stdio server from this crate
↓ CDP http://127.0.0.1:9223
resolved CDP URL (127.0.0.1 host port, shared namespace, or Docker bridge IP)
Rust-managed Chromium container dg-*-browser
↓ same framebuffer
noVNC http://127.0.0.1:6080/vnc.html?autoconnect=true&resize=remote&path=websockify
resolved noVNC URL (same container/session)
```

## Supported MCP tools
Expand Down
1 change: 1 addition & 0 deletions changelog.d/20260524_141210_browser_connection_mcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ bump: minor

### Changed
- Documented `command = "browser-connection"` as the supported product path and made the old external Playwright MCP command shape a forbidden runtime configuration.
- Pinned CLI/test dependency ranges and regenerated `Cargo.lock` with lockfile format v3 so `cargo install --locked` also works on Cargo 1.75 environments.
Loading
Loading