Skip to content

Commit ed622b0

Browse files
committed
feat: add Docker image for MCP server
1 parent 0a6aaa5 commit ed622b0

3 files changed

Lines changed: 58 additions & 0 deletions

File tree

.dockerignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.git
2+
.github
3+
.agent
4+
.claude-plugin
5+
build
6+
node_modules
7+
npm-debug.log
8+
coverage
9+
*.tsbuildinfo

Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
FROM node:24-bookworm-slim AS build
2+
3+
WORKDIR /app
4+
5+
COPY package.json package-lock.json ./
6+
RUN npm ci
7+
8+
COPY . .
9+
RUN npm run bundle
10+
11+
FROM node:24-bookworm-slim
12+
13+
ENV PUPPETEER_SKIP_DOWNLOAD=true
14+
ENV CHROME_PATH=/usr/bin/google-chrome
15+
16+
WORKDIR /app
17+
18+
RUN apt-get update \
19+
&& apt-get install -y --no-install-recommends ca-certificates gnupg wget \
20+
&& mkdir -p /etc/apt/keyrings \
21+
&& wget -qO- https://dl.google.com/linux/linux_signing_key.pub | gpg --dearmor -o /etc/apt/keyrings/google-linux.gpg \
22+
&& echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/google-linux.gpg] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list \
23+
&& apt-get update \
24+
&& apt-get install -y --no-install-recommends google-chrome-stable \
25+
&& rm -rf /var/lib/apt/lists/*
26+
27+
COPY --from=build /app/build ./build
28+
COPY --from=build /app/LICENSE ./LICENSE
29+
30+
ENTRYPOINT ["node", "build/src/bin/chrome-devtools-mcp.js"]
31+
CMD ["--headless", "--chrome-arg=--no-sandbox", "--chrome-arg=--disable-dev-shm-usage"]

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,24 @@ If you are interested in doing only basic browser tasks, use the `--slim` mode:
9898

9999
See [Slim tool reference](./docs/slim-tool-reference.md).
100100

101+
### Docker
102+
103+
Build and run the MCP server in a container:
104+
105+
```bash
106+
docker build -t chrome-devtools-mcp .
107+
docker run --rm -i chrome-devtools-mcp
108+
```
109+
110+
The container image installs Google Chrome and starts the MCP server in headless
111+
mode by default. The bundled command also includes `--no-sandbox` and
112+
`--disable-dev-shm-usage`, which are commonly needed in containerized
113+
environments. Extra CLI flags can be appended to `docker run`, for example:
114+
115+
```bash
116+
docker run --rm -i chrome-devtools-mcp --log-file=/tmp/chrome-devtools.log
117+
```
118+
101119
### MCP Client configuration
102120

103121
<details>

0 commit comments

Comments
 (0)