Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
aeb4cf6
Fixed typo in README.md (#88)
yyoshiki41 Mar 31, 2025
d316441
chore: sanitize file path when saving (#99)
pavelfeldman Mar 31, 2025
9042c03
chore: support channel and executable path params (#90)
pavelfeldman Mar 31, 2025
4f16786
chore: merge browser and channel settings (#100)
pavelfeldman Apr 1, 2025
0a5518b
chore: stitch together iframes into one tree (#71)
Skn0tt Apr 1, 2025
0de7c0d
chore: follow up with iframe stitch (#110)
pavelfeldman Apr 1, 2025
2366dbf
chore: mark v0.0.8 (#111)
pavelfeldman Apr 1, 2025
128e75b
devops: fix npm publishing due to proverance (#112)
mxschmitt Apr 1, 2025
23f392d
chore: mark v0.0.9 (#114)
pavelfeldman Apr 1, 2025
89627fd
chore: extract page snapshot, prep for multipage (#120)
pavelfeldman Apr 2, 2025
2291011
feat: add slowly option for typing one character at a time (#121)
yury-s Apr 2, 2025
38f038a
chore: typo in description (#127)
yury-s Apr 3, 2025
b358e47
chore: prep for multiple pages in context (#124)
pavelfeldman Apr 3, 2025
e36d4ea
chore: allow multiple tabs (#129)
pavelfeldman Apr 4, 2025
fc0cccf
chore: reuse the first tab when navigating (#131)
pavelfeldman Apr 4, 2025
707ebbf
chore: group tools, prepare for capabilities (#134)
pavelfeldman Apr 4, 2025
abd56f5
chore: introduce capabilities argument (#135)
pavelfeldman Apr 5, 2025
6b15c7e
chore: mark v0.0.10 (#138)
pavelfeldman Apr 6, 2025
4216787
chore: Update README.md (#140)
yyoshiki41 Apr 7, 2025
b8ff009
chore: add back stable vscode install button (#145)
paulirish Apr 7, 2025
31ac1ed
fix: exit watchdog should listen for SIGINT/SIGTERM (#144)
Skn0tt Apr 7, 2025
77080e8
Restore `package-lock.json` module hashes (#151)
cameronfyfe Apr 10, 2025
e729494
feat: browser_resize (#92)
Skn0tt Apr 14, 2025
606b898
chore: allow reusing tab over cdp (#170)
pavelfeldman Apr 14, 2025
0c5a104
chore: default to headless when DISPLAY is missing (#172)
pavelfeldman Apr 14, 2025
71e51ea
chore: mark v0.0.11 (#173)
pavelfeldman Apr 14, 2025
de08c24
fix: consider DISPLAY only on linux (#175)
yury-s Apr 15, 2025
0f7fd13
chore: mark 0.0.12 (#176)
yury-s Apr 15, 2025
6891a52
chore: add npx install step to the publish workflow (#178)
pavelfeldman Apr 15, 2025
4d59e06
test: fix flaky test (#180)
Skn0tt Apr 15, 2025
4a19e18
feat: respond with action and generated locator (#181)
Skn0tt Apr 15, 2025
795a9d5
chore: generalize status & action as code (#188)
pavelfeldman Apr 15, 2025
0d6bb2f
devops: add bots for other browsers/platforms (#174)
yury-s Apr 15, 2025
bc48600
chore: mark v0.0.13 (#190)
pavelfeldman Apr 15, 2025
e433131
chore: update exported types (#192)
pavelfeldman Apr 15, 2025
5c2e110
chore: convert console resource to tool (#193)
pavelfeldman Apr 16, 2025
e7c7709
chore: include "playwright" keyword, add examples (#196)
Skn0tt Apr 16, 2025
6d4adfe
feat: add element screenshot action for snapshots (#182)
AndrewBarzu Apr 16, 2025
6054290
chore: follow up to the element screenshot change (#199)
pavelfeldman Apr 16, 2025
cea347d
chore: introduce modal states (#204)
pavelfeldman Apr 16, 2025
7e4a964
chore: flatten tool calling, prep for timeout handling (#205)
pavelfeldman Apr 17, 2025
4b26128
chore: test list tabs (#208)
pavelfeldman Apr 17, 2025
6481100
feat(dialog): handle dialogs (#212)
pavelfeldman Apr 17, 2025
6a070a0
chore: restore page-side timeout (#213)
pavelfeldman Apr 17, 2025
7695717
docs: provide missing docs (#214)
pavelfeldman Apr 17, 2025
0c3792d
chore: auto update tools in README (#219)
mxschmitt Apr 21, 2025
d4f8f87
docs: fix "programmatic usage with custom transports" code snippet (#…
ruifigueira Apr 21, 2025
dc955c7
Add Docker support (#220)
cmrigney Apr 22, 2025
cd5aa34
docs: push docker doc down the readme (#236)
pavelfeldman Apr 22, 2025
9578a5b
chore: mark v0.0.14 (#237)
pavelfeldman Apr 22, 2025
c80f7cf
chore: infer tool params (#241)
Skn0tt Apr 22, 2025
1bc3c76
feat(network): implement listing network requests (#247)
pavelfeldman Apr 22, 2025
f7e9bae
chore: roll playwright to 1745357020000 (#249)
pavelfeldman Apr 22, 2025
586492a
chore: mark v0.0.15 (#250)
pavelfeldman Apr 22, 2025
b9dc323
chore: enable @typescript-eslint/no-floating-promises rule (#260)
mxschmitt Apr 23, 2025
4d95761
chore(gitignore): Add .idea and .DS_Store to .gitignore (#262)
zzxwill Apr 24, 2025
0ed0bcd
feat(server): add host option to SSE server configuration (#261)
zzxwill Apr 24, 2025
7256ee3
docs(readme): Fix syntax error and improve formatting (#263)
zzxwill Apr 24, 2025
bf7dbab
feat: support streamable http transport (#243)
Skn0tt Apr 28, 2025
b02370d
chore: roll playwright to latest (#269)
pavelfeldman Apr 28, 2025
23704ac
chore: update docs on lint (#283)
pavelfeldman Apr 28, 2025
26779ce
chore: allow passing config file (#281)
pavelfeldman Apr 28, 2025
6e76d5e
chore: split context.ts into files (#284)
pavelfeldman Apr 28, 2025
697a69a
chore: allow specifying output dir (#285)
pavelfeldman Apr 28, 2025
12e72a9
chore: allow configuring screenshot tool (#286)
pavelfeldman Apr 29, 2025
80c9b93
chore: allow configuring raw Playwright options (#287)
pavelfeldman Apr 29, 2025
4147e21
chore: fix update-readme TS linting (#296)
mxschmitt Apr 29, 2025
69703cc
chore: follow up to exposing playwright config options (#289)
pavelfeldman Apr 29, 2025
ad4147d
docs: Fix the default path to User data directory (#290)
zwmmm Apr 29, 2025
6efdc90
fix: show custom error for modal state (#240)
Skn0tt Apr 29, 2025
21d2f80
chore: store channel profiles separately (#297)
pavelfeldman Apr 29, 2025
40d125f
docs: document configuration file (#299)
pavelfeldman Apr 29, 2025
3f72fe5
chore: add support for device (#300)
pavelfeldman Apr 30, 2025
9efaea6
chore: mark v0.0.16 (#298)
pavelfeldman Apr 30, 2025
1c760b3
fix: default to headful (#305)
Skn0tt Apr 30, 2025
1b60870
chore: bump to 0.0.17 (#306)
Skn0tt Apr 30, 2025
fd22def
chore: fix test harness, close the client (#312)
pavelfeldman Apr 30, 2025
6d6b1a3
chore: fix merge config (#311)
pavelfeldman Apr 30, 2025
878be97
chore: mark v0.0.18 (#315)
pavelfeldman Apr 30, 2025
685dea9
chore: migrate to ESM (#303)
mxschmitt Apr 30, 2025
23ce973
lint: ban console output (#317)
pavelfeldman Apr 30, 2025
a15f0f3
chore: save downloads to outputDir (#310)
Skn0tt May 2, 2025
a713300
test: use TestOptions type in config (#326)
mxschmitt May 2, 2025
062cdd0
fix: sticky launch errors (#324)
mxschmitt May 2, 2025
2c9376e
chore: don't sanitize file extension away (#327)
Skn0tt May 2, 2025
292e75d
chore: roll Playwright to remove empty generic nodes (#330)
pavelfeldman May 2, 2025
927a128
chore: allow generating tests for script (#331)
pavelfeldman May 3, 2025
7e087af
chore: slightly adjust gen test prompt (#333)
pavelfeldman May 3, 2025
43aa400
chore: mark v0.0.19 (#332)
pavelfeldman May 3, 2025
4997964
fix: require is not defined (#334)
riywo May 3, 2025
21533d9
chore: installation test added (#335)
pavelfeldman May 3, 2025
d8a59e0
chore: mark v0.0.20 (#336)
pavelfeldman May 3, 2025
200cf73
chore: use import.meta.resolve to lookup Playwright (#337)
pavelfeldman May 3, 2025
5df011a
feat(cli): set `outputDir` via cli options (#338)
ogadra May 4, 2025
7dc689e
fix: installation tool on Windows (#345)
mxschmitt May 4, 2025
4694d60
fix(config): allow specifying user data dir in config (#342)
pavelfeldman May 5, 2025
42faa3c
feat: add --(allowed|blocked)-origins (#319)
rwoll May 5, 2025
8cd7d5a
chore(docker): optimize Dockerfile by excluding unnecessary files and…
KanchiShimono May 5, 2025
d01aa19
chore: annotate tools (#351)
pavelfeldman May 6, 2025
23a2e5f
devops: add Docker publishing (#356)
mxschmitt May 6, 2025
e95b5b1
chore: get rid of connection factory (#362)
pavelfeldman May 6, 2025
35e6c49
devops: publish Docker image to :latest as well (#365)
mxschmitt May 7, 2025
91ae93c
chore: change import assert to readFile (#368)
mxschmitt May 7, 2025
cdeba45
chore: mark v0.0.21 (#364)
mxschmitt May 7, 2025
950d0d1
devops: fix Docker publishing (#369)
mxschmitt May 7, 2025
c225524
fix: don't error on navigating to a download link (#328)
Skn0tt May 7, 2025
b5be37e
chore: mark v0.0.22 (#370)
mxschmitt May 7, 2025
a115c31
chore: rename console to consoleMessages (#372)
mxschmitt May 7, 2025
09ba798
test: run tests on MCP server inside Docker (#361)
mxschmitt May 7, 2025
85c85bd
chore: support custom filename in screenshot function (#349)
ogadra May 8, 2025
57b3c14
chore: only reset network log upon explicit navigation (#377)
pavelfeldman May 9, 2025
053c2f3
test: fix SSE MCP SDK imports (#383)
mxschmitt May 9, 2025
95ca08f
fix: use of wrong launchOptions type in public API (#385)
mxschmitt May 9, 2025
ef41c62
chore: unset skipLibCheck in tsconfig.json (#386)
mxschmitt May 9, 2025
75f74a5
docs: reference to new Docker image (#380)
mxschmitt May 9, 2025
65716b6
fix: createConnection() via public API (#384)
mxschmitt May 9, 2025
c28b480
feat(wait): allow waiting for given text (#390)
pavelfeldman May 9, 2025
445170a
chore: roll playwright 5/9 (#394)
pavelfeldman May 10, 2025
84664d4
test: unflake 'should throw connection error and allow re-connecting'…
mxschmitt May 12, 2025
65a229c
Fix import in README from createServer to createConnection (#396)
ta1m1kam May 12, 2025
05dc5d9
chore: mark v0.0.23 (#399)
pavelfeldman May 12, 2025
dd5b41f
chore: account for undefined arguments (#400)
pavelfeldman May 12, 2025
fea3f26
chore: mark v0.0.24 (#401)
pavelfeldman May 12, 2025
a1eee83
chore: collapse readme (#404)
pavelfeldman May 12, 2025
949f956
feat(ephemeral): allow for non-persistent context operation (#405)
pavelfeldman May 13, 2025
ce72367
feat(storage): allow passing storage state for isolated contexts (#409)
pavelfeldman May 13, 2025
7be0c88
feat(args): allow configuring proxy, UA, viewport, https errors (#410)
pavelfeldman May 13, 2025
c506027
chore: run w/ sandbox by default (#412)
pavelfeldman May 13, 2025
ab20175
chore: generate readme options (#411)
pavelfeldman May 13, 2025
ee33097
chore: normalize --no- options (#413)
pavelfeldman May 13, 2025
746c9fc
chore: mark v0.0.25 (#414)
pavelfeldman May 13, 2025
fea50e6
chore: introduce resolved config (#425)
pavelfeldman May 14, 2025
aa6ac51
feat(trace): allow saving trajectory as trace (#426)
pavelfeldman May 15, 2025
c2b7fb2
chore: start trace server (#427)
pavelfeldman May 15, 2025
1318e39
chore: fix operation over cdp (#440)
pavelfeldman May 17, 2025
c318f13
chore: mark v0.0.26 (#441)
pavelfeldman May 17, 2025
13cd1b4
fix: respect browserName in config (#461)
Skn0tt May 23, 2025
f20ae22
chore: roll Playwright, remove localOutputDir (#471)
pavelfeldman May 24, 2025
1051ea8
fix: import from cjs (#476)
Skn0tt May 26, 2025
9e5ffd2
fix(cursor): allow enforcing images for cursor --image-responses=allo…
pavelfeldman May 27, 2025
45f493d
chore: make library test run under older Node versions (#479)
Skn0tt May 27, 2025
9429463
chore: roll Playwright to 5/27 (#485)
pavelfeldman May 27, 2025
177b008
chore: mark v0.0.27 (#470)
pavelfeldman May 27, 2025
3cd74a8
docs: fixed typo in README.md (#487)
nabepa May 28, 2025
54ed7c3
chore: refactor server, prepare for browser reuse (#490)
pavelfeldman May 28, 2025
eec177d
chore: reuse browser in server mode (#495)
pavelfeldman May 30, 2025
6567795
chore: respect server settings from config (#502)
pavelfeldman May 31, 2025
f31ef59
test: verify the log in close/navigate test (#505)
pavelfeldman Jun 1, 2025
0b74cda
chore: sort out signal handling (#506)
pavelfeldman Jun 1, 2025
675b083
chore: mark v0.0.28 (#503)
pavelfeldman Jun 1, 2025
9728527
chore: typo (#513)
Skn0tt Jun 3, 2025
0fb9646
chore: experimental agent mode (#516)
pavelfeldman Jun 4, 2025
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
70 changes: 60 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,79 @@ on:
branches: [ main ]

jobs:
build-and-test:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run linting
- run: npm run build
- name: Run ESLint
run: npm run lint
- name: Ensure no changes
run: git diff --exit-code

test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18
uses: actions/setup-node@v4
with:
# https://github.com/microsoft/playwright-mcp/issues/344
node-version: '18.19'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Playwright install
run: npx playwright install --with-deps
- name: Install MS Edge
# MS Edge is not preinstalled on macOS runners.
if: ${{ matrix.os == 'macos-latest' }}
run: npx playwright install msedge
- name: Build
run: npm run build

- name: Install Playwright browsers
run: npx playwright install --with-deps

- name: Run tests
run: npm test

test_docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Playwright install
run: npx playwright install --with-deps chromium
- name: Build
run: npm run build
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v6
with:
tags: playwright-mcp-dev:latest
cache-from: type=gha
cache-to: type=gha,mode=max
load: true
- name: Run tests
shell: bash
run: |
# Used for the Docker tests to share the test-results folder with the container.
umask 0000
npm run test -- --project=chromium-docker
env:
MCP_IN_DOCKER: 1
39 changes: 37 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,51 @@ on:
jobs:
publish-npm:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # Needed for npm provenance
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npx playwright install --with-deps
- run: npm run build
- run: npm run lint
- run: npm run test
- run: npm run ctest
- run: npm publish --provenance
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

publish-docker:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # Needed for OIDC login to Azure
environment: allow-publishing-docker-to-acr
steps:
- uses: actions/checkout@v4
- name: Set up QEMU # Needed for multi-platform builds (e.g., arm64 on amd64 runner)
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx # Needed for multi-platform builds
uses: docker/setup-buildx-action@v3
- name: Azure Login via OIDC
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_DOCKER_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_DOCKER_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_DOCKER_SUBSCRIPTION_ID }}
- name: Login to ACR
run: az acr login --name playwright
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile # Adjust path if your Dockerfile is elsewhere
platforms: linux/amd64,linux/arm64
push: true
tags: |
playwright.azurecr.io/public/playwright/mcp:${{ github.event.release.tag_name }}
playwright.azurecr.io/public/playwright/mcp:latest
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
lib/
node_modules/
test-results/
playwright-report/
.vscode/mcp.json

.idea
.DS_Store
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ LICENSE
!lib/**/*.js
!cli.js
!index.*
!config.d.ts
69 changes: 69 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
ARG PLAYWRIGHT_BROWSERS_PATH=/ms-playwright

# ------------------------------
# Base
# ------------------------------
# Base stage: Contains only the minimal dependencies required for runtime
# (node_modules and Playwright system dependencies)
FROM node:22-bookworm-slim AS base

ARG PLAYWRIGHT_BROWSERS_PATH
ENV PLAYWRIGHT_BROWSERS_PATH=${PLAYWRIGHT_BROWSERS_PATH}

# Set the working directory
WORKDIR /app

RUN --mount=type=cache,target=/root/.npm,sharing=locked,id=npm-cache \
--mount=type=bind,source=package.json,target=package.json \
--mount=type=bind,source=package-lock.json,target=package-lock.json \
npm ci --omit=dev && \
# Install system dependencies for playwright
npx -y playwright-core install-deps chromium

# ------------------------------
# Builder
# ------------------------------
FROM base AS builder

RUN --mount=type=cache,target=/root/.npm,sharing=locked,id=npm-cache \
--mount=type=bind,source=package.json,target=package.json \
--mount=type=bind,source=package-lock.json,target=package-lock.json \
npm ci

# Copy the rest of the app
COPY *.json *.js *.ts .
COPY src src/

# Build the app
RUN npm run build

# ------------------------------
# Browser
# ------------------------------
# Cache optimization:
# - Browser is downloaded only when node_modules or Playwright system dependencies change
# - Cache is reused when only source code changes
FROM base AS browser

RUN npx -y playwright-core install --no-shell chromium

# ------------------------------
# Runtime
# ------------------------------
FROM base

ARG PLAYWRIGHT_BROWSERS_PATH
ARG USERNAME=node
ENV NODE_ENV=production

# Set the correct ownership for the runtime user on production `node_modules`
RUN chown -R ${USERNAME}:${USERNAME} node_modules

USER ${USERNAME}

COPY --from=browser --chown=${USERNAME}:${USERNAME} ${PLAYWRIGHT_BROWSERS_PATH} ${PLAYWRIGHT_BROWSERS_PATH}
COPY --chown=${USERNAME}:${USERNAME} cli.js package.json ./
COPY --from=builder --chown=${USERNAME}:${USERNAME} /app/lib /app/lib

# Run in headless and only with chromium (other browsers need more dependencies not included in this image)
ENTRYPOINT ["node", "cli.js", "--headless", "--browser", "chromium", "--no-sandbox"]
Loading