Reading the repo
Reading the repo
Saved setup from 1 h ago
Will it work on my device?
CONTRIBUTING.mdTo maintain project quality and focus, Playwright requires a corresponding issue for every contribution, with the exception of minor documentation fixes.
If you would like to address a bug or feature that isn't currently listed, please file a new issue first. This allows the community and maintainers to provide early feedback and facilitates a discussion before you invest time in developing a pull request.
When submitting an issue, please state clearly if you intend to work on it. Once triaged and approved, the maintainers will determine the best path forward—whether the task should be handled by the core team, an automated agent, or a community contributor. If the issue is assigned to you, you may then proceed with your changes and submit a PR.
To ensure the maintainability of the project, please note the following:
[!WARNING] The core of the Playwright MCP was moved to the Playwright monorepo.
Clone the Playwright repository. If you plan to send a pull request, it might be better to fork the repository first.
git clone https://github.com/microsoft/playwright
cd playwright
Install dependencies and run the build in watch mode.
# install deps and run watch
npm ci
npm run watch
npx playwright install
Source code for Playwright MCP is located in the Playwright monorepo:
# list source files
ls -la packages/playwright-core/src/tools/mcp
ls -la packages/playwright-core/src/tools/backend
Coding style is fully defined in eslint.config.mjs. Before creating a pull request, or at any moment during development, run linter to check all kinds of things:
# lint the source base before sending PR
npm run flint
Comments should have an explicit purpose and should improve readability rather than hinder it. If the code would not be understood without comments, consider re-writing the code to make it self-explanatory.
Playwright requires a test for the new or modified functionality. An exception would be a pure refactoring, but chances are you are doing more than that.
There are multiple test suites in Playwright that will be executed on the CI. Tests for Playwright MCP are located at tests/mcp.
# list test files
ls -la tests/mcp
To run the mcp tests, use
# fast path runs all MCP tests in Chromium
npm run ctest-mcp
# slow path runs all tests in three browsers
npm run test-mcp
Since Playwright tests are using Playwright under the hood, everything from our documentation applies, for example this guide on running and debugging tests.
Note that tests should be hermetic, and not depend on external services. Tests should work on all three platforms: macOS, Linux and Windows.
Commit messages should follow the Semantic Commit Messages format:
label(namespace): title
description
footer
fix - bug fixesfeat - new featuresdocs - documentation-only changestest - test-only changesdevops - changes to the CI or buildchore - everything that doesn't fall under previous categoriesExample:
feat(trace viewer): network panel filtering
This patch adds a filtering toolbar to the network panel.
<link to a screenshot>
Fixes #123, references #234.
All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. Make sure to keep your PR (diff) small and readable. If necessary, split your contribution into multiple PRs. Consult GitHub Help for more information on using pull requests.
After a successful code review, one of the maintainers will merge your pull request. Congratulations!
No new dependencies
There is a very high bar for new dependencies, including updating to a new version of an existing dependency. We recommend to explicitly discuss this in an issue and get a green light from a maintainer, before creating a pull request that updates dependencies.
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
Then run bash setup.sh. It stops at the first error and is safe to run again. Servers and tests aren't started; it lists them at the end. Read it first.
Needs Git: xcode-select --install
git clone https://github.com/microsoft/playwright-mcp.git cd playwright-mcp
Node.js >=18
# needs nvm: brew install nvm (or https://github.com/nvm-sh/nvm) nvm install --lts
npm ci
npm test
First, install the Playwright MCP server with your client.
Standard config works in most of the tools:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": [
"@playwright/mcp@latest"
]
}
}
}
<img src="https://img.shields.io/badge/VS_Code-VS_Code?style=flat-square&label=Install%20Server&color=0098FF" alt="Install in VS Code"> <img alt="Install in VS Code Insiders" src="https://img.shields.io/badge/VS_Code_Insiders-VS_Code_Insiders?style=flat-square&label=Install%20Server&color=24bfa5">
<details> <summary>Amp</summary>Add via the Amp VS Code extension settings screen or by updating your settings.json file:
"amp.mcpServers": {
"playwright": {
"command": "npx",
"args": [
"@playwright/mcp@latest"
]
}
}
Amp CLI Setup:
Add via the amp mcp add command below
amp mcp add playwright -- npx @playwright/mcp@latest
</details>
<details>
<summary>Antigravity</summary>
Add via the Antigravity settings or by updating your configuration file:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": [
"@playwright/mcp@latest"
]
}
}
}
</details>
<details>
<summary>Claude Code</summary>
Use the Claude Code CLI to add the Playwright MCP server:
claude mcp add playwright npx @playwright/mcp@latest
</details>
<details>
<summary>Claude Desktop</summary>
Follow the MCP install guide, use the standard config above.
</details> <details> <summary>Cline</summary>Follow the instruction in the section Configuring MCP Servers
Example: Local Setup
Add the following to your cline_mcp_settings.json file:
{
"mcpServers": {
"playwright": {
"type": "stdio",
"command": "npx",
"timeout": 30,
"args": [
"-y",
"@playwright/mcp@latest"
],
"disabled": false
}
}
}
</details>
<details>
<summary>Codex</summary>
Use the Codex CLI to add the Playwright MCP server:
codex mcp add playwright npx "@playwright/mcp@latest"
Alternatively, create or edit the configuration file ~/.codex/config.toml and add:
[mcp_servers.playwright]
command = "npx"
args = ["@playwright/mcp@latest"]
For more information, see the Codex MCP documentation.
</details> <details> <summary>Copilot</summary>Use the Copilot CLI to interactively add the Playwright MCP server:
/mcp add
Alternatively, create or edit the configuration file ~/.copilot/mcp-config.json and add:
{
"mcpServers": {
"playwright": {
"type": "local",
"command": "npx",
"tools": [
"*"
],
"args": [
"@playwright/mcp@latest"
]
}
}
}
For more information, see the Copilot CLI documentation.
</details> <details> <summary>Cursor</summary><img src="https://cursor.com/deeplink/mcp-install-dark.svg" alt="Install in Cursor">
Go to Cursor Settings -> MCP -> Add new MCP Server. Name to your liking, use command type with the command npx @playwright/mcp@latest. You can also verify config or add command like arguments via clicking Edit.
Use the Factory CLI to add the Playwright MCP server:
droid mcp add playwright "npx @playwright/mcp@latest"
Alternatively, type /mcp within Factory droid to open an interactive UI for managing MCP servers.
For more information, see the Factory MCP documentation.
</details> <details> <summary>Gemini CLI</summary>Follow the MCP install guide, use the standard config above.
</details> <details> <summary>Goose</summary>[](https://block.github.io/goose
…
No reports for macOS yet.
Claude reads the 11 key files and writes a step-by-step guide for macOS. Once written, it's saved for everyone.