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
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM node:22-bookworm-slim

# Set the working directory
WORKDIR /app

# Copy package.json and package-lock.json at this stage to leverage the build cache
COPY package*.json ./

# Install dependencies
RUN npm ci

# Install chromium and its dependencies, but only for headless mode
RUN npx -y playwright install --with-deps --only-shell chromium

# Copy the rest of the app
COPY . .

# Build the app
RUN npm run build

# Run in headless and only with chromium (other browsers need more dependencies not included in this image)
ENTRYPOINT ["node", "cli.js", "--headless", "--browser", "chromium"]
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ A Model Context Protocol (MCP) server that provides browser automation capabilit

### Example config

#### NPX

```js
{
"mcpServers": {
Expand All @@ -30,6 +32,19 @@ A Model Context Protocol (MCP) server that provides browser automation capabilit
}
```

#### Docker

**NOTE:** The Docker implementation only supports headless chromium at the moment.
```js
{
"mcpServers": {
"playwright": {
"command": "docker",
"args": ["run", "-i", "--rm", "--init", "mcp/playwright"]
}
}
}
```

#### Installation in VS Code

Expand Down Expand Up @@ -154,6 +169,13 @@ To use Vision Mode, add the `--vision` flag when starting the server:
Vision Mode works best with the computer use models that are able to interact with elements using
X Y coordinate space, based on the provided screenshot.

### Build with Docker

You can build the Docker image yourself.
```
docker build -t mcp/playwright .
```

### Programmatic usage with custom transports

```js
Expand Down