25 Commits

Author SHA1 Message Date
Pavel Feldman
da8a244f33
chore: one tool experiment (#746) 2025-07-24 10:09:01 -07:00
Yury Semikhatsky
bc120baa78
chore: do not double close connection (#744) 2025-07-23 17:41:15 -07:00
Pavel Feldman
b1a0f775cf
chore: save session log (#740) 2025-07-22 20:06:03 -07:00
Yury Semikhatsky
e3df209b96
chore(extension): support running in http mode (#717) 2025-07-19 08:30:29 -07:00
Yury Semikhatsky
96e234012d
chore(extension): start relay before creating MCP server (#548)
* HTTPS server launched and the relay server is created before MCP
server. This way we can pass CDP endpoint to its constructor.
* MCP HTTP transport is added to precreated HTTP server.
* A bunch of renames to fix style issues.
2025-06-13 16:13:40 -07:00
Max Schmitt
6c3f3b6576
feat: add MCP Chrome extension (#325)
Instructions:

1. `git clone https://github.com/mxschmitt/playwright-mcp && git
checkout extension-drafft`
2. `npm ci && npm run build`
3. `chrome://extensions` in your normal Chrome, "load unpacked" and
select the extension folder.
4. `node cli.js --port=4242 --extension` - The URL it prints at the end
you can put into the extension popup.
5. 
Put either this into Claude Desktop (it does not support SSE yet hence
wrapping it or just put the URL into Cursor/VSCode)

```json
{
  "mcpServers": {
    "playwright": {
      "command": "bash",
      "args": [
        "-c",
        "source $HOME/.nvm/nvm.sh && nvm use --silent 22 && npx supergateway --streamableHttp http://127.0.0.1:4242/mcp"
      ]
    }
  }
}
```

Things like `Take a snapshot of my browser.` should now work in your
Prompt Chat.

----

- SSE only for now, since we already have a http server with a port
there
- Upstream "page tests" can be executed over this CDP relay via
https://github.com/microsoft/playwright/pull/36286
- Limitations for now are everything what happens outside of the tab its
session is shared with -> `window.open` / `target=_blank`.

---------

Co-authored-by: Yury Semikhatsky <yurys@chromium.org>
2025-06-13 13:15:17 -07:00
Pavel Feldman
0b74cdaaf8
chore: sort out signal handling (#506) 2025-06-01 14:11:42 -07:00
Pavel Feldman
eec177d3ac
chore: reuse browser in server mode (#495) 2025-05-30 15:15:37 -07:00
Pavel Feldman
54ed7c3200
chore: refactor server, prepare for browser reuse (#490) 2025-05-28 16:55:47 -07:00
Pavel Feldman
e95b5b1dd6
chore: get rid of connection factory (#362)
Drive-by User-Agent sniffing and disabling of image type in Cursor.
2025-05-06 14:27:28 -07:00
Pavel Feldman
d01aa19ffa
chore: annotate tools (#351)
Fixes https://github.com/microsoft/playwright-mcp/issues/215
2025-05-05 17:38:22 -07:00
Max Schmitt
685dea9e19
chore: migrate to ESM (#303)
- [Why do I need `.js`
extension?](https://stackoverflow.com/a/77150985/6512681)
- [Why setting `rootDir` in the
`tsconfig.json`?](https://stackoverflow.com/a/58941798/6512681)
- [How to ensure that we add the `.js` extension via
ESLint](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/extensions.md#importextensions)

Fixes https://github.com/microsoft/playwright-mcp/issues/302
2025-04-30 23:06:56 +02:00
Simon Knott
6efdc90078
fix: show custom error for modal state (#240)
Calling a tool that resolves modal state, when there's no such modal
state visible, currently shows this misleading message:

```md
Tool "browser_file_upload" does not handle the modal state.
### Modal state
```

Instead, we should show the error message from the tool implementation.
2025-04-29 18:48:52 +02:00
Pavel Feldman
6e76d5e550
chore: split context.ts into files (#284) 2025-04-28 16:14:16 -07:00
Simon Knott
c80f7cf222
chore: infer tool params (#241)
Moves the `schema.parse` call to the calling side of the handler, so we
don't have to duplicate it everywhere.
2025-04-22 13:24:38 +02:00
Pavel Feldman
7e4a964b0a
chore: flatten tool calling, prep for timeout handling (#205) 2025-04-16 19:36:48 -07:00
Pavel Feldman
cea347d067
chore: introduce modal states (#204) 2025-04-16 15:21:45 -07:00
Pavel Feldman
e4331313f9
chore: update exported types (#192)
Fixes https://github.com/microsoft/playwright-mcp/issues/186
2025-04-15 16:39:52 -07:00
Pavel Feldman
a7392fc266
chore: allow passing cdp endpoint (#86)
Fixes https://github.com/microsoft/playwright-mcp/issues/84
2025-03-30 09:05:58 -07:00
Pavel Feldman
7bda082a4e
chore: isolate SSE client browsers (#76) 2025-03-28 13:24:45 -07:00
Pavel Feldman
3b0e4c3b27 chore: refactor tests for real 2025-03-27 16:50:43 -07:00
Pavel Feldman
6ff4500211
chore: use persistent profile by default (#41)
Fixes https://github.com/microsoft/playwright-mcp/issues/29
2025-03-26 15:02:45 -07:00
Pavel Feldman
8f3214a06a
chore: export server for custom transports (#20)
Fixes https://github.com/microsoft/playwright-mcp/issues/11
2025-03-25 14:46:39 -07:00
Pavel Feldman
a392ba2f41
chore: restart browser if page closed manually (#19)
Fixes https://github.com/microsoft/playwright-mcp/issues/18
2025-03-25 13:05:28 -07:00
Pavel Feldman
852709c026 chore: initial code commit 2025-03-21 11:13:24 -07:00