{"_id":"@atc-group/playwright-mcp","name":"@atc-group/playwright-mcp","dist-tags":{"latest":"0.0.13-alpha.0"},"versions":{"0.0.13-alpha.0":{"name":"@atc-group/playwright-mcp","version":"0.0.13-alpha.0","description":"Playwright Tools for MCP [Forked]","repository":{"type":"git","url":"git+https://github.com/microsoft/playwright-mcp.git"},"homepage":"https://playwright.dev","engines":{"node":">=18"},"author":{"name":"Microsoft Corporation"},"license":"Apache-2.0","scripts":{"build":"tsc","lint":"eslint .","watch":"tsc --watch","test":"playwright test","ctest":"playwright test --project=chrome","ftest":"playwright test --project=firefox","wtest":"playwright test --project=webkit","clean":"rm -rf lib","npm-publish":"npm run clean && npm run build && npm run test && npm publish"},"exports":{"./package.json":"./package.json",".":{"types":"./index.d.ts","default":"./index.js"}},"dependencies":{"@modelcontextprotocol/sdk":"^1.6.1","commander":"^13.1.0","playwright":"^1.52.0-alpha-1743163434000","yaml":"^2.7.1","zod-to-json-schema":"^3.24.4"},"devDependencies":{"@eslint/eslintrc":"^3.2.0","@eslint/js":"^9.19.0","@playwright/test":"^1.52.0-alpha-1743163434000","@stylistic/eslint-plugin":"^3.0.1","@types/node":"^22.13.10","@typescript-eslint/eslint-plugin":"^8.26.1","@typescript-eslint/parser":"^8.26.1","@typescript-eslint/utils":"^8.26.1","eslint":"^9.19.0","eslint-plugin-import":"^2.31.0","eslint-plugin-notice":"^1.0.0","typescript":"^5.8.2"},"bin":{"mcp-server-playwright":"cli.js"},"_id":"@atc-group/playwright-mcp@0.0.13-alpha.0","gitHead":"c72ec1feb0ffde9788337fda2331c0baacb41e20","types":"./index.d.ts","bugs":{"url":"https://github.com/microsoft/playwright-mcp/issues"},"_nodeVersion":"23.10.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-EnhlVKCpFa/etv2SGnr0OrCfnnraZBvsm2uyAwTXVcvrJ11gXOVvDZhzU79tkhE3iN2uX9ypHCXqgqiiNR+ULg==","shasum":"45fc1eee1babc1a24974fcb820fda51eabd145ff","tarball":"https://registry.npmjs.org/@atc-group/playwright-mcp/-/playwright-mcp-0.0.13-alpha.0.tgz","fileCount":26,"unpackedSize":113566,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBFqzBFrqxfLtpHoQ+NvYXiAY7szSBJdKFswbdcgmoqBAiEAj0KUaokcmwcs8dFf/FvgGtKcKQvp3gYOIu+cVdaTQ40="}]},"_npmUser":{"name":"toanzzz","email":"me@toan.io"},"directories":{},"maintainers":[{"name":"atcgroupdev","email":"atcgroupdev@gmail.com"},{"name":"toanzzz","email":"me@toan.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/playwright-mcp_0.0.13-alpha.0_1744972882444_0.16872109212623498"},"_hasShrinkwrap":false}},"time":{"created":"2025-04-18T10:41:22.348Z","0.0.13-alpha.0":"2025-04-18T10:41:22.634Z","modified":"2025-04-18T10:41:22.939Z"},"maintainers":[{"name":"atcgroupdev","email":"atcgroupdev@gmail.com"},{"name":"toanzzz","email":"me@toan.io"}],"description":"Playwright Tools for MCP [Forked]","homepage":"https://playwright.dev","repository":{"type":"git","url":"git+https://github.com/microsoft/playwright-mcp.git"},"author":{"name":"Microsoft Corporation"},"bugs":{"url":"https://github.com/microsoft/playwright-mcp/issues"},"license":"Apache-2.0","readme":"## Playwright MCP\n\nA Model Context Protocol (MCP) server that provides browser automation capabilities using [Playwright](https://playwright.dev). This server enables LLMs to interact with web pages through structured accessibility snapshots, bypassing the need for screenshots or visually-tuned models.\n\n### Key Features\n\n- **Fast and lightweight**: Uses Playwright's accessibility tree, not pixel-based input.\n- **LLM-friendly**: No vision models needed, operates purely on structured data.\n- **Deterministic tool application**: Avoids ambiguity common with screenshot-based approaches.\n\n### Use Cases\n\n- Web navigation and form-filling\n- Data extraction from structured content\n- Automated testing driven by LLMs\n- General-purpose browser interaction for agents\n\n### Example config\n\n```js\n{\n  \"mcpServers\": {\n    \"playwright\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"@playwright/mcp@latest\"\n      ]\n    }\n  }\n}\n```\n\n\n#### Installation in VS Code\n\nInstall the Playwright MCP server in VS Code using one of these buttons:\n\n<!--\n// Generate using?:\nconst config = JSON.stringify({ name: 'playwright', command: 'npx', args: [\"-y\", \"@playwright/mcp@latest\"] });\nconst urlForWebsites = `vscode:mcp/install?${encodeURIComponent(config)}`;\n// Github markdown does not allow linking to `vscode:` directly, so you can use our redirect:\nconst urlForGithub = `https://insiders.vscode.dev/redirect?url=${encodeURIComponent(urlForWebsites)}`;\n-->\n\n[<img src=\"https://img.shields.io/badge/VS_Code-VS_Code?style=flat-square&label=Install%20Server&color=0098FF\" alt=\"Install in VS Code\">](https://insiders.vscode.dev/redirect?url=vscode%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522playwright%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522-y%2522%252C%2522%2540playwright%252Fmcp%2540latest%2522%255D%257D)  [<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\">](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522playwright%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522-y%2522%252C%2522%2540playwright%252Fmcp%2540latest%2522%255D%257D)\n\nAlternatively, you can install the Playwright MCP server using the VS Code CLI:\n\n```bash\n# For VS Code\ncode --add-mcp '{\"name\":\"playwright\",\"command\":\"npx\",\"args\":[\"@playwright/mcp@latest\"]}'\n```\n\n```bash\n# For VS Code Insiders\ncode-insiders --add-mcp '{\"name\":\"playwright\",\"command\":\"npx\",\"args\":[\"@playwright/mcp@latest\"]}'\n```\n\nAfter installation, the Playwright MCP server will be available for use with your GitHub Copilot agent in VS Code.\n\n### CLI Options\n\nThe Playwright MCP server supports the following command-line options:\n\n- `--browser <browser>`: Browser or chrome channel to use. Possible values:\n  - `chrome`, `firefox`, `webkit`, `msedge`\n  - Chrome channels: `chrome-beta`, `chrome-canary`, `chrome-dev`\n  - Edge channels: `msedge-beta`, `msedge-canary`, `msedge-dev`\n  - Default: `chrome`\n- `--caps <caps>`: Comma-separated list of capabilities to enable, possible values: tabs, pdf, history, wait, files, install. Default is all.\n- `--cdp-endpoint <endpoint>`: CDP endpoint to connect to\n- `--executable-path <path>`: Path to the browser executable\n- `--headless`: Run browser in headless mode (headed by default)\n- `--port <port>`: Port to listen on for SSE transport\n- `--user-data-dir <path>`: Path to the user data directory\n- `--vision`: Run server that uses screenshots (Aria snapshots are used by default)\n\n### User data directory\n\nPlaywright MCP will launch the browser with the new profile, located at\n\n```\n- `%USERPROFILE%\\AppData\\Local\\ms-playwright\\mcp-chrome-profile` on Windows\n- `~/Library/Caches/ms-playwright/mcp-chrome-profile` on macOS\n- `~/.cache/ms-playwright/mcp-chrome-profile` on Linux\n```\n\nAll the logged in information will be stored in that profile, you can delete it between sessions if you'd like to clear the offline state.\n\n\n### Running headless browser (Browser without GUI).\n\nThis mode is useful for background or batch operations.\n\n```js\n{\n  \"mcpServers\": {\n    \"playwright\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"@playwright/mcp@latest\",\n        \"--headless\"\n      ]\n    }\n  }\n}\n```\n\n### Running headed browser on Linux w/o DISPLAY\n\nWhen running headed browser on system w/o display or from worker processes of the IDEs,\nrun the MCP server from environment with the DISPLAY and pass the `--port` flag to enable SSE transport.\n\n```bash\nnpx @playwright/mcp@latest --port 8931\n```\n\nAnd then in MCP client config, set the `url` to the SSE endpoint:\n\n```js\n{\n  \"mcpServers\": {\n    \"playwright\": {\n      \"url\": \"http://localhost:8931/sse\"\n    }\n  }\n}\n```\n\n### Tool Modes\n\nThe tools are available in two modes:\n\n1. **Snapshot Mode** (default): Uses accessibility snapshots for better performance and reliability\n2. **Vision Mode**: Uses screenshots for visual-based interactions\n\nTo use Vision Mode, add the `--vision` flag when starting the server:\n\n```js\n{\n  \"mcpServers\": {\n    \"playwright\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"@playwright/mcp@latest\",\n        \"--vision\"\n      ]\n    }\n  }\n}\n```\n\nVision Mode works best with the computer use models that are able to interact with elements using\nX Y coordinate space, based on the provided screenshot.\n\n### Programmatic usage with custom transports\n\n```js\nimport { createServer } from '@playwright/mcp';\n\n// ...\n\nconst server = createServer({\n  launchOptions: { headless: true }\n});\ntransport = new SSEServerTransport(\"/messages\", res);\nserver.connect(transport);\n```\n\n### Snapshot-based Interactions\n\n- **browser_click**\n  - Description: Perform click on a web page\n  - Parameters:\n    - `element` (string): Human-readable element description used to obtain permission to interact with the element\n    - `ref` (string): Exact target element reference from the page snapshot\n\n- **browser_hover**\n  - Description: Hover over element on page\n  - Parameters:\n    - `element` (string): Human-readable element description used to obtain permission to interact with the element\n    - `ref` (string): Exact target element reference from the page snapshot\n\n- **browser_drag**\n  - Description: Perform drag and drop between two elements\n  - Parameters:\n    - `startElement` (string): Human-readable source element description used to obtain permission to interact with the element\n    - `startRef` (string): Exact source element reference from the page snapshot\n    - `endElement` (string): Human-readable target element description used to obtain permission to interact with the element\n    - `endRef` (string): Exact target element reference from the page snapshot\n\n- **browser_type**\n  - Description: Type text into editable element\n  - Parameters:\n    - `element` (string): Human-readable element description used to obtain permission to interact with the element\n    - `ref` (string): Exact target element reference from the page snapshot\n    - `text` (string): Text to type into the element\n    - `submit` (boolean, optional): Whether to submit entered text (press Enter after)\n    - `slowly` (boolean, optional): Whether to type one character at a time. Useful for triggering key handlers in the page. By default entire text is filled in at once.\n\n- **browser_select_option**\n  - Description: Select an option in a dropdown\n  - Parameters:\n    - `element` (string): Human-readable element description used to obtain permission to interact with the element\n    - `ref` (string): Exact target element reference from the page snapshot\n    - `values` (array): Array of values to select in the dropdown. This can be a single value or multiple values.\n\n- **browser_snapshot**\n  - Description: Capture accessibility snapshot of the current page, this is better than screenshot\n  - Parameters: None\n\n- **browser_take_screenshot**\n  - Description: Take a screenshot of the current page. You can't perform actions based on the screenshot, use browser_snapshot for actions.\n  - Parameters:\n    - `raw` (boolean, optional): Whether to return without compression (in PNG format). Default is false, which returns a JPEG image.\n\n### Vision-based Interactions\n\n- **browser_screen_move_mouse**\n  - Description: Move mouse to a given position\n  - Parameters:\n    - `element` (string): Human-readable element description used to obtain permission to interact with the element\n    - `x` (number): X coordinate\n    - `y` (number): Y coordinate\n\n- **browser_screen_capture**\n  - Description: Take a screenshot of the current page\n  - Parameters: None\n\n- **browser_screen_click**\n  - Description: Click left mouse button\n  - Parameters:\n    - `element` (string): Human-readable element description used to obtain permission to interact with the element\n    - `x` (number): X coordinate\n    - `y` (number): Y coordinate\n\n- **browser_screen_drag**\n  - Description: Drag left mouse button\n  - Parameters:\n    - `element` (string): Human-readable element description used to obtain permission to interact with the element\n    - `startX` (number): Start X coordinate\n    - `startY` (number): Start Y coordinate\n    - `endX` (number): End X coordinate\n    - `endY` (number): End Y coordinate\n\n- **browser_screen_type**\n  - Description: Type text\n  - Parameters:\n    - `text` (string): Text to type\n    - `submit` (boolean, optional): Whether to submit entered text (press Enter after)\n\n- **browser_press_key**\n  - Description: Press a key on the keyboard\n  - Parameters:\n    - `key` (string): Name of the key to press or a character to generate, such as `ArrowLeft` or `a`\n\n### Tab Management\n\n- **browser_tab_list**\n  - Description: List browser tabs\n  - Parameters: None\n\n- **browser_tab_new**\n  - Description: Open a new tab\n  - Parameters:\n    - `url` (string, optional): The URL to navigate to in the new tab. If not provided, the new tab will be blank.\n\n- **browser_tab_select**\n  - Description: Select a tab by index\n  - Parameters:\n    - `index` (number): The index of the tab to select\n\n- **browser_tab_close**\n  - Description: Close a tab\n  - Parameters:\n    - `index` (number, optional): The index of the tab to close. Closes current tab if not provided.\n\n### Navigation\n\n- **browser_navigate**\n  - Description: Navigate to a URL\n  - Parameters:\n    - `url` (string): The URL to navigate to\n\n- **browser_navigate_back**\n  - Description: Go back to the previous page\n  - Parameters: None\n\n- **browser_navigate_forward**\n  - Description: Go forward to the next page\n  - Parameters: None\n\n### Keyboard\n\n- **browser_press_key**\n  - Description: Press a key on the keyboard\n  - Parameters:\n    - `key` (string): Name of the key to press or a character to generate, such as `ArrowLeft` or `a`\n\n### Console\n\n- **browser_console_messages**\n  - Description: Returns all console messages\n  - Parameters: None\n\n### Files and Media\n\n- **browser_file_upload**\n  - Description: Choose one or multiple files to upload\n  - Parameters:\n    - `paths` (array): The absolute paths to the files to upload. Can be a single file or multiple files.\n\n- **browser_pdf_save**\n  - Description: Save page as PDF\n  - Parameters: None\n\n### Utilities\n\n- **browser_wait**\n  - Description: Wait for a specified time in seconds\n  - Parameters:\n    - `time` (number): The time to wait in seconds (capped at 10 seconds)\n\n- **browser_resize**\n  - Description: Resize the browser window\n  - Parameters:\n    - `width` (number): The desired width of the browser window\n    - `height` (number): The desired height of the browser window\n\n- **browser_handle_dialog**\n  - Description: Handle browser dialogs (alert, confirm, prompt)\n  - Parameters:\n    - `accept` (boolean): Whether to accept or dismiss the dialog\n    - `promptText` (string, optional): Text to enter in case of prompt dialogs\n\n- **browser_close**\n  - Description: Close the page\n  - Parameters: None\n\n- **browser_install**\n  - Description: Install the browser specified in the config. Call this if you get an error about the browser not being installed.\n  - Parameters: None\n","readmeFilename":"README.md","_rev":"1-ddc55d9ba72559e5ccab880328099931"}