Skip to content

fix: bind server to 0.0.0.0 and add meaningful health check#6

Open
jimscard wants to merge 2 commits into
iuill:mainfrom
jimscard:fix/host-binding-and-healthcheck
Open

fix: bind server to 0.0.0.0 and add meaningful health check#6
jimscard wants to merge 2 commits into
iuill:mainfrom
jimscard:fix/host-binding-and-healthcheck

Conversation

@jimscard

Copy link
Copy Markdown

Problem

Two bugs affect all users running this as a Docker container.

1. ECONNRESET on all client connections

@playwright/mcp defaults to binding on localhost (127.0.0.1) inside the container. Docker's port forwarding routes traffic to the container's eth0 IP — not loopback — so every MCP client connection is immediately reset (ECONNRESET).

Fix: Pass --host 0.0.0.0 in entrypoint.sh so the server listens on all interfaces.

2. Health check reports false positives

The container had no HEALTHCHECK. Without one, Docker always reports the container as healthy even if the @playwright/mcp process crashes after startup.

Fix: Add a HEALTHCHECK using pgrep to verify the process is actually running.

Changes

  • entrypoint.sh: add --host 0.0.0.0 alongside --port
  • Dockerfile: add HEALTHCHECK that checks the process is alive

Verification

After the fix, curl http://localhost:8931/sse returns 200 OK with a live text/event-stream response. Before the fix it returned ECONNRESET.

jimscard and others added 2 commits March 29, 2026 19:47
The previous health check (npm list -g @playwright/mcp) only verified
the package was installed, not that the server was running. A crashed
MCP process would still report the container as healthy.

Replace with pgrep to verify the @playwright/mcp process is actually
running.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@playwright/mcp defaults to binding on localhost (127.0.0.1) inside
the container. Docker forwards traffic to the container's eth0 IP,
not loopback, so all client connections got ECONNRESET.

Pass --host 0.0.0.0 alongside --port so the server listens on all
interfaces and is reachable from outside the container.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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