Skip to content

Conversation

@kgprs
Copy link

@kgprs kgprs commented Nov 19, 2025

This PR adds a Dockerfile to enable the chrome-devtools-mcp server to be used with Docker-based MCP registries.

Changes

  • Added Dockerfile based on Node.js 22 LTS with Chrome dependencies
  • Installs Chrome Stable for Puppeteer support
  • Builds the TypeScript project during image creation
  • Runs as non-root user for security
  • Exposes the MCP server via stdio

Testing

The Dockerfile can be tested by building and running:

docker build -t chrome-devtools-mcp .
docker run -i chrome-devtools-mcp

This will enable the server to be added to Docker-based MCP registries like the one at https://github.com/docker/mcp-registry.

@google-cla
Copy link

google-cla bot commented Nov 19, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@kgprs kgprs force-pushed the add-dockerfile branch 4 times, most recently from 49cb645 to a69b8cb Compare November 19, 2025 03:33
This Dockerfile enables the chrome-devtools-mcp server to be used
with Docker-based MCP registries. It:
- Uses Node.js 22 LTS with Chrome dependencies
- Installs Chrome Stable for Puppeteer
- Builds the TypeScript project
- Runs as non-root user for security
- Exposes the MCP server via stdio
The entrypoint script checks if BROWSER_URL environment variable is set
and only passes --browserUrl flag if it's provided. This allows the MCP
registry to support optional browser connection without template issues.

Default behavior (no BROWSER_URL): Launches Chrome in headless mode
With BROWSER_URL: Connects to existing Chrome instance
Extended entrypoint script to support all configuration options via
environment variables:

Connection Options:
- BROWSER_URL: Connect to existing Chrome via HTTP
- WS_ENDPOINT: Connect via WebSocket
- WS_HEADERS: Custom headers for WebSocket (JSON)

Browser Launch Options:
- HEADLESS: true/false (default: true)
- VIEWPORT: WIDTHxHEIGHT (default: 1280x720)
- ISOLATED: true/false for temporary profile
- CHANNEL: stable/canary/beta/dev
- EXECUTABLE_PATH: Custom Chrome path
- PROXY_SERVER: Proxy configuration
- ACCEPT_INSECURE_CERTS: true/false

Feature Toggles:
- CATEGORY_EMULATION: true/false (default: true)
- CATEGORY_PERFORMANCE: true/false (default: true)
- CATEGORY_NETWORK: true/false (default: true)

Debugging:
- LOG_FILE: Path for debug logs
@kgprs kgprs changed the title Add Dockerfile for MCP registry support feat: Add Dockerfile for MCP registry support Nov 19, 2025
Removed the custom entrypoint script since the MCP registry doesn't
support conditional command-line argument passing. The server will
auto-launch Chrome with default settings (headless, 1280x720).

Users who need custom Chrome configurations can build and run the
server outside the registry using the standard npx approach with
command-line flags.
Simple entrypoint script that converts environment variables to
command-line flags only when set:
- BROWSER_URL → --browserUrl
- WS_ENDPOINT → --wsEndpoint
- WS_HEADERS → --wsHeaders

This allows the server.yaml to pass these as env vars without
causing build errors when they're empty.
@OrKoN
Copy link
Collaborator

OrKoN commented Nov 19, 2025

Thanks for the PR but we are not ready to ship a Docker image at this point. Could you please file a feature request instead? cc @natorion

@OrKoN OrKoN closed this Nov 19, 2025
@kgprs kgprs mentioned this pull request Nov 19, 2025
@kgprs
Copy link
Author

kgprs commented Nov 19, 2025

Thanks for the PR but we are not ready to ship a Docker image at this point. Could you please file a feature request instead? cc @natorion

I see, thanks for the reply. Filed the FR here: #584

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.

2 participants