能力标签
playwright-mcp MCP工具
🔌
MCP工具

playwright-mcp MCP工具

基于 TypeScript · 让 AI 助手直接操作你的系统与工具
英文名:playwright-mcp
⭐ 32.5k Stars 🍴 2.7k Forks 💻 TypeScript 📄 Apache-2.0 🏷 AI 8.5分
8.5AI 综合评分
浏览器自动化Web测试数据采集MCP协议TypeScript
✦ AI Skill Hub 推荐

playwright-mcp MCP工具 是 AI Skill Hub 本期精选MCP工具之一。在 GitHub 上收获超过 32.5k 颗 Star,综合评分 8.5 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。

📚 深度解析
playwright-mcp MCP工具 是一款基于 MCP(Model Context Protocol)标准协议的 AI 工具扩展。MCP 协议由 Anthropic 开发并开源,旨在建立 AI 模型与外部工具之间的标准化通信接口,目前已被 Claude Desktop、Claude Code、Cursor 等主流 AI 工具采纳。

通过安装 playwright-mcp MCP工具,你的 AI 助手将获得额外的工具调用能力,可以用自然语言直接操控该工具的功能,无需学习复杂的命令行语法。MCP 工具的核心价值在于"一次配置,永久增强"——配置完成后,每次与 AI 对话时都可以无缝调用这些工具。

在技术实现上,MCP 工具通过标准的 JSON-RPC 协议与 AI 客户端通信,工具的功能以"工具列表"的形式暴露给 AI 模型,AI 可以按需调用。playwright-mcp MCP工具 提供了结构化的工具调用接口,使 AI 模型能够精确地理解和使用每个功能点,显著降低 AI 在工具使用上的错误率。

与传统的 API 集成相比,MCP 工具的优势在于无需编写代码——用户只需在配置文件中添加几行 JSON,即可让 AI 获得全新能力。AI Skill Hub 将 playwright-mcp MCP工具 评为 AI 评分 8.5 分,属于同类工具中的优质选择。
📋 工具概览

基于Playwright的MCP协议服务器实现,提供浏览器自动化能力。支持网页交互、截图、数据采集等功能,适合开发者集成到AI应用中进行Web自动化任务处理。

playwright-mcp MCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。

GitHub Stars
⭐ 32.5k
开发语言
TypeScript
支持平台
Windows / macOS / Linux
维护状态
活跃维护,更新频繁
开源协议
Apache-2.0
AI 综合评分
8.5 分
工具类型
MCP工具
Forks
2.7k
📖 中文文档
以下内容由 AI Skill Hub 根据项目信息自动整理,如需查看完整原始文档请访问底部「原始来源」。

基于Playwright的MCP协议服务器实现,提供浏览器自动化能力。支持网页交互、截图、数据采集等功能,适合开发者集成到AI应用中进行Web自动化任务处理。

playwright-mcp MCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。

📌 核心特色
  • 通过标准 MCP 协议与 Claude、Cursor 等主流 AI 客户端深度集成
  • 提供结构化工具调用接口,显著降低 AI 集成复杂度
  • 支持 Claude Desktop 和 Claude Code 无缝接入,开箱即用
  • 可与其他 MCP 工具组合叠加,构建完整 AI 工作站
  • 轻量无侵入设计,不影响现有系统架构
🎯 主要使用场景
  • 在 Claude Desktop 对话中直接调用本地工具,实现 AI 与系统的深度联动
  • 通过自然语言驱动复杂的多步骤自动化任务,代替繁琐手动操作
  • 将多个 MCP 工具组合使用,构建个人专属 AI 工作站
以下安装命令基于项目开发语言和类型自动生成,实际以官方 README 为准。
安装命令
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/microsoft/playwright-mcp

# 方式二:手动配置 claude_desktop_config.json
{
  "mcpServers": {
    "playwright-mcp-mcp--": {
      "command": "npx",
      "args": ["-y", "playwright-mcp"]
    }
  }
}

# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
📋 安装步骤说明
  1. 确认已安装 Node.js(v18 或以上版本)
  2. 打开 Claude Desktop 或 Claude Code 的 MCP 配置文件
  3. 按「交给 Agent 安装 → Claude Desktop」标签中的 JSON 配置填入 mcpServers 字段
  4. 保存配置文件并重启 Claude 客户端
  5. 重启后,在对话中即可使用本工具
以下用法示例由 AI Skill Hub 整理,涵盖最常见的使用场景。
常用命令 / 代码示例
# 安装后在 Claude 对话中直接使用
# 示例:
用户: 请帮我用 playwright-mcp MCP工具 执行以下任务...
Claude: [自动调用 playwright-mcp MCP工具 MCP 工具处理请求]

# 查看可用工具列表
# 在 Claude 中输入:"列出所有可用的 MCP 工具"
以下配置示例基于典型使用场景生成,具体参数请参照官方文档调整。
配置示例
// claude_desktop_config.json 配置示例
{
  "mcpServers": {
    "playwright-mcp_mcp__": {
      "command": "npx",
      "args": ["-y", "playwright-mcp"],
      "env": {
        // "API_KEY": "your-api-key-here"
      }
    }
  }
}

// 保存后重启 Claude Desktop 生效
📑 README 深度解析 真实文档 完整度 47/100 查看 GitHub 原文 →
以下内容由系统直接从 GitHub README 解析整理,保留代码块、表格与列表结构。

Key Features

  • Fast and lightweight. Uses Playwright's accessibility tree, not pixel-based input.
  • LLM-friendly. No vision models needed, operates purely on structured data.
  • Deterministic tool application. Avoids ambiguity common with screenshot-based approaches.

Requirements

  • Node.js 18 or newer
  • VS Code, Cursor, Windsurf, Claude Desktop, Goose, Junie or any other MCP client

Getting started

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 addcommand 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>

Click the button to install:

<img src="https://cursor.com/deeplink/mcp-install-dark.svg" alt="Install in Cursor">

Or install manually:

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.

</details>

<details> <summary>Factory</summary>

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>

Click the button to install:

Install in Goose

Or install manually:

Go to Advanced settings -> Extensions -> Add custom extension. Name to your liking, use type STDIO, and set the command to npx @playwright/mcp. Click "Add Extension". </details>

<details> <summary>Junie</summary>

To add the Playwright MCP server in Junie CLI:

  1. Type /mcp
  2. Press Ctrl+A to add a new MCP server
  3. Select Playwright from the list

Alternatively, add to .junie/mcp/mcp.json:

{
  "mcpServers": {
    "Playwright": {
      "command": "npx",
      "args": [
        "-y",
        "@playwright/mcp@latest"
      ]
    }
  }
}

For more information, see the Junie MCP configuration documentation.

</details>

<details> <summary>Kiro</summary>

Add to Kiro

Follow the MCP Servers documentation. For example in .kiro/settings/mcp.json:

{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": [
        "@playwright/mcp@latest"
      ]
    }
  }
}
</details>

<details> <summary>LM Studio</summary>

Click the button to install:

Add MCP Server playwright to LM Studio

Or install manually:

Go to Program in the right sidebar -> Install -> Edit mcp.json. Use the standard config above. </details>

<details> <summary>opencode</summary>

Follow the MCP Servers documentation. For example in ~/.config/opencode/opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "playwright": {
      "type": "local",
      "command": [
        "npx",
        "@playwright/mcp@latest"
      ],
      "enabled": true
    }
  }
}
</details>

<details> <summary>Qodo Gen</summary>

Open Qodo Gen chat panel in VSCode or IntelliJ → Connect more tools → + Add new MCP → Paste the standard config above.

Click <code>Save</code>. </details>

<details> <summary>VS Code</summary>

Click the button to install:

<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">

Or install manually:

Follow the MCP install guide, use the standard config above. You can also install the Playwright MCP server using the VS Code CLI:

```bash

Configuration

Playwright MCP server supports following arguments. They can be provided in the JSON configuration above, as a part of the "args" list:

OptionDescription
--allowed-hosts <hosts...>comma-separated list of hosts this server is allowed to serve from. Defaults to the host the server is bound to. Pass '*' to disable the host check.<br>*env* PLAYWRIGHT_MCP_ALLOWED_HOSTS
--allowed-origins <origins>semicolon-separated list of TRUSTED origins to allow the browser to request. Default is to allow all. Important: *does not* serve as a security boundary and *does not* affect redirects.<br>*env* PLAYWRIGHT_MCP_ALLOWED_ORIGINS
--allow-unrestricted-file-accessallow access to files outside of the workspace roots. Also allows unrestricted access to file:// URLs. By default access to file system is restricted to workspace root directories (or cwd if no roots are configured) only, and navigation to file:// URLs is blocked.<br>*env* PLAYWRIGHT_MCP_ALLOW_UNRESTRICTED_FILE_ACCESS
--blocked-origins <origins>semicolon-separated list of origins to block the browser from requesting. Blocklist is evaluated before allowlist. If used without the allowlist, requests not matching the blocklist are still allowed. Important: *does not* serve as a security boundary and *does not* affect redirects.<br>*env* PLAYWRIGHT_MCP_BLOCKED_ORIGINS
--block-service-workersblock service workers<br>*env* PLAYWRIGHT_MCP_BLOCK_SERVICE_WORKERS
--browser <browser>browser or chrome channel to use, possible values: chrome, firefox, webkit, msedge.<br>*env* PLAYWRIGHT_MCP_BROWSER
--caps <caps>comma-separated list of additional capabilities to enable, possible values: vision, pdf, devtools.<br>*env* PLAYWRIGHT_MCP_CAPS
--cdp-endpoint <endpoint>CDP endpoint to connect to.<br>*env* PLAYWRIGHT_MCP_CDP_ENDPOINT
--cdp-header <headers...>CDP headers to send with the connect request, multiple can be specified.<br>*env* PLAYWRIGHT_MCP_CDP_HEADER
--cdp-timeout <timeout>timeout in milliseconds for connecting to CDP endpoint, defaults to 30000ms<br>*env* PLAYWRIGHT_MCP_CDP_TIMEOUT
--codegen <lang>specify the language to use for code generation, possible values: "typescript", "none". Default is "typescript".<br>*env* PLAYWRIGHT_MCP_CODEGEN
--config <path>path to the configuration file.<br>*env* PLAYWRIGHT_MCP_CONFIG
--console-level <level>level of console messages to return: "error", "warning", "info", "debug". Each level includes the messages of more severe levels.<br>*env* PLAYWRIGHT_MCP_CONSOLE_LEVEL
--device <device>device to emulate, for example: "iPhone 15"<br>*env* PLAYWRIGHT_MCP_DEVICE
--executable-path <path>path to the browser executable.<br>*env* PLAYWRIGHT_MCP_EXECUTABLE_PATH
--extensionConnect to a running browser instance (Edge/Chrome only). Requires the "Playwright Extension" to be installed.<br>*env* PLAYWRIGHT_MCP_EXTENSION
--endpoint <endpoint>Bound browser endpoint to connect to.<br>*env* PLAYWRIGHT_MCP_ENDPOINT
--grant-permissions <permissions...>List of permissions to grant to the browser context, for example "geolocation", "clipboard-read", "clipboard-write".<br>*env* PLAYWRIGHT_MCP_GRANT_PERMISSIONS
--headlessrun browser in headless mode, headed by default<br>*env* PLAYWRIGHT_MCP_HEADLESS
--host <host>host to bind server to. Default is localhost. Use 0.0.0.0 to bind to all interfaces.<br>*env* PLAYWRIGHT_MCP_HOST
--ignore-https-errorsignore https errors<br>*env* PLAYWRIGHT_MCP_IGNORE_HTTPS_ERRORS
--init-page <path...>path to TypeScript file to evaluate on Playwright page object<br>*env* PLAYWRIGHT_MCP_INIT_PAGE
--init-script <path...>path to JavaScript file to add as an initialization script. The script will be evaluated in every page before any of the page's scripts. Can be specified multiple times.<br>*env* PLAYWRIGHT_MCP_INIT_SCRIPT
--isolatedkeep the browser profile in memory, do not save it to disk.<br>*env* PLAYWRIGHT_MCP_ISOLATED
--image-responses <mode>whether to send image responses to the client. Can be "allow" or "omit", Defaults to "allow".<br>*env* PLAYWRIGHT_MCP_IMAGE_RESPONSES
--no-sandboxdisable the sandbox for all process types that are normally sandboxed.<br>*env* PLAYWRIGHT_MCP_NO_SANDBOX
--output-dir <path>path to the directory for output files.<br>*env* PLAYWRIGHT_MCP_OUTPUT_DIR
--output-mode <mode>whether to save snapshots, console messages, network logs to a file or to the standard output. Can be "file" or "stdout". Default is "stdout".<br>*env* PLAYWRIGHT_MCP_OUTPUT_MODE
--port <port>port to listen on for SSE transport.<br>*env* PLAYWRIGHT_MCP_PORT
--proxy-bypass <bypass>comma-separated domains to bypass proxy, for example ".com,chromium.org,.domain.com"<br>*env* PLAYWRIGHT_MCP_PROXY_BYPASS
--proxy-server <proxy>specify proxy server, for example "http://myproxy:3128" or "socks5://myproxy:8080"<br>*env* PLAYWRIGHT_MCP_PROXY_SERVER
--sandboxenable the sandbox for all process types that are normally not sandboxed.<br>*env* PLAYWRIGHT_MCP_SANDBOX
--save-sessionWhether to save the Playwright MCP session into the output directory.<br>*env* PLAYWRIGHT_MCP_SAVE_SESSION
--secrets <path>path to a file containing secrets in the dotenv format<br>*env* PLAYWRIGHT_MCP_SECRETS_FILE
--shared-browser-contextreuse the same browser context between all connected HTTP clients.<br>*env* PLAYWRIGHT_MCP_SHARED_BROWSER_CONTEXT
--snapshot-mode <mode>when taking snapshots for responses, specifies the mode to use. Can be "full" or "none". Default is "full".<br>*env* PLAYWRIGHT_MCP_SNAPSHOT_MODE
--storage-state <path>path to the storage state file for isolated sessions.<br>*env* PLAYWRIGHT_MCP_STORAGE_STATE
--test-id-attribute <attribute>specify the attribute to use for test ids, defaults to "data-testid"<br>*env* PLAYWRIGHT_MCP_TEST_ID_ATTRIBUTE
--timeout-action <timeout>specify action timeout in milliseconds, defaults to 5000ms<br>*env* PLAYWRIGHT_MCP_TIMEOUT_ACTION
--timeout-navigation <timeout>specify navigation timeout in milliseconds, defaults to 60000ms<br>*env* PLAYWRIGHT_MCP_TIMEOUT_NAVIGATION
--user-agent <ua string>specify user agent string<br>*env* PLAYWRIGHT_MCP_USER_AGENT
--user-data-dir <path>path to the user data directory. If not specified, a temporary directory will be created.<br>*env* PLAYWRIGHT_MCP_USER_DATA_DIR
--viewport-size <size>specify browser viewport size in pixels, for example "1280x720"<br>*env* PLAYWRIGHT_MCP_VIEWPORT_SIZE

Configuration file

The Playwright MCP server can be configured using a JSON configuration file. You can specify the configuration file using the --config command line option:

npx @playwright/mcp@latest --config path/to/config.json

<details> <summary>Configuration file schema</summary>

{
  /**
   * The browser to use.
   */
  browser?: {
    /**
     * The type of browser to use.
     */
    browserName?: 'chromium' | 'firefox' | 'webkit';

    /**
     * Keep the browser profile in memory, do not save it to disk.
     */
    isolated?: boolean;

    /**
     * Path to a user data directory for browser profile persistence.
     * Temporary directory is created by default.
     */
    userDataDir?: string;

    /**
     * Launch options passed to
     * @see https://playwright.dev/docs/api/class-browsertype#browser-type-launch-persistent-context
     *
     * This is useful for settings options like `channel`, `headless`, `executablePath`, etc.
     */
    launchOptions?: playwright.LaunchOptions;

    /**
     * Context options for the browser context.
     *
     * This is useful for settings options like `viewport`.
     */
    contextOptions?: playwright.BrowserContextOptions;

    /**
     * Chrome DevTools Protocol endpoint to connect to an existing browser instance in case of Chromium family browsers.
     */
    cdpEndpoint?: string;

    /**
     * CDP headers to send with the connect request.
     */
    cdpHeaders?: Record<string, string>;

    /**
     * Timeout in milliseconds for connecting to CDP endpoint. Defaults to 30000 (30 seconds). Pass 0 to disable timeout.
     */
    cdpTimeout?: number;

    /**
     * Remote endpoint to connect to an existing Playwright server.
     */
    remoteEndpoint?: string;

    /**
     * Paths to TypeScript files to add as initialization scripts for Playwright page.
     */
    initPage?: string[];

    /**
     * Paths to JavaScript files to add as initialization scripts.
     * The scripts will be evaluated in every page before any of the page's scripts.
     */
    initScript?: string[];
  },

  /**
   * Connect to a running browser instance (Edge/Chrome only). If specified, `browser`
   * config is ignored.
   * Requires the "Playwright Extension" to be installed.
   */
  extension?: boolean;

  server?: {
    /**
     * The port to listen on for SSE or MCP transport.
     */
    port?: number;

    /**
     * The host to bind the server to. Default is localhost. Use 0.0.0.0 to bind to all interfaces.
     */
    host?: string;

    /**
     * The hosts this server is allowed to serve from. Defaults to the host server is bound to.
     * This is not for CORS, but rather for the DNS rebinding protection.
     */
    allowedHosts?: string[];
  },

  /**
   * List of enabled tool capabilities. Possible values:
   *   - 'core': Core browser automation features.
   *   - 'pdf': PDF generation and manipulation.
   *   - 'vision': Coordinate-based interactions.
   *   - 'devtools': Developer tools features.
   */
  capabilities?: ToolCapability[];

  /**
   * Whether to save the Playwright session into the output directory.
   */
  saveSession?: boolean;

  /**
   * Reuse the same browser context between all connected HTTP clients.
   */
  sharedBrowserContext?: boolean;

  /**
   * Secrets are used to replace matching plain text in the tool responses to prevent the LLM
   * from accidentally getting sensitive data. It is a convenience and not a security feature,
   * make sure to always examine information coming in and from the tool on the client.
   */
  secrets?: Record<string, string>;

  /**
   * The directory to save output files.
   */
  outputDir?: string;

  console?: {
    /**
     * The level of console messages to return. Each level includes the messages of more severe levels. Defaults to "info".
     */
    level?: 'error' | 'warning' | 'info' | 'debug';
  },

  network?: {
    /**
     * List of origins to allow the browser to request. Default is to allow all. Origins matching both `allowedOrigins` and `blockedOrigins` will be blocked.
     *
     * Supported formats:
     * - Full origin: `https://example.com:8080` - matches only that origin
     * - Wildcard port: `http://localhost:*` - matches any port on localhost with http protocol
     */
    allowedOrigins?: string[];

    /**
     * List of origins to block the browser to request. Origins matching both `allowedOrigins` and `blockedOrigins` will be blocked.
     *
     * Supported formats:
     * - Full origin: `https://example.com:8080` - matches only that origin
     * - Wildcard port: `http://localhost:*` - matches any port on localhost with http protocol
     */
    blockedOrigins?: string[];
  };

  /**
   * Specify the attribute to use for test ids, defaults to "data-testid".
   */
  testIdAttribute?: string;

  timeouts?: {
    /*
     * Configures default action timeout: https://playwright.dev/docs/api/class-page#page-set-default-timeout. Defaults to 5000ms.
     */
    action?: number;

    /*
     * Configures default navigation timeout: https://playwright.dev/docs/api/class-page#page-set-default-navigation-timeout. Defaults to 60000ms.
     */
    navigation?: number;

    /**
     * Configures default expect timeout: https://playwright.dev/docs/test-timeouts#expect-timeout. Defaults to 5000ms.
     */
    expect?: number;
  };

  /**
   * Whether to send image responses to the client. Can be "allow", "omit", or "auto". Defaults to "auto", which sends images if the client can display them.
   */
  imageResponses?: 'allow' | 'omit';

  snapshot?: {
    /**
     * When taking snapshots for responses, specifies the mode to use.
     */
    mode?: 'full' | 'none';
  };

  /**
   * allowUnrestrictedFileAccess acts as a guardrail to prevent the LLM from accidentally
   * wandering outside its intended workspace. It is a convenience defense to catch unintended
   * file access, not a secure boundary; a deliberate attempt to reach other directories can be
   * easily worked around, so always rely on client-level permissions for true security.
   */
  allowUnrestrictedFileAccess?: boolean;

  /**
   * Specify the language to use for code generation.
   */
  codegen?: 'typescript' | 'none';
}

</details>

Playwright MCP vs Playwright CLI

This package provides MCP interface into Playwright. If you are using a coding agent, you might benefit from using the CLI+SKILLS instead.

  • CLI: Modern coding agents increasingly favor CLI–based workflows exposed as SKILLs over MCP because CLI invocations are more token-efficient: they avoid loading large tool schemas and verbose accessibility trees into the model context, allowing agents to act through concise, purpose-built commands. This makes CLI + SKILLs better suited for high-throughput coding agents that must balance browser automation with large codebases, tests, and reasoning within limited context windows.<br>Learn more about Playwright CLI with SKILLS.
  • MCP: MCP remains relevant for specialized agentic loops that benefit from persistent state, rich introspection, and iterative reasoning over page structure, such as exploratory automation, self-healing tests, or long-running autonomous workflows where maintaining continuous browser context outweighs token cost concerns.

For VS Code

code --add-mcp '{"name":"playwright","command":"npx","args":["@playwright/mcp@latest"]}'


After installation, the Playwright MCP server will be available for use with your GitHub Copilot agent in VS Code.
</details>

<details>
<summary>Warp</summary>

Go to `Settings` -> `AI` -> `Manage MCP Servers` -> `+ Add` to [add an MCP Server](https://docs.warp.dev/knowledge-and-collaboration/mcp#adding-an-mcp-server). Use the standard config above.

Alternatively, use the slash command `/add-mcp` in the Warp prompt and paste the standard config from above:
js { "mcpServers": { "playwright": { "command": "npx", "args": [ "@playwright/mcp@latest" ] } } } ```

</details>

<details> <summary>Windsurf</summary>

Follow Windsurf MCP documentation. Use the standard config above.

</details>

🎯 aiskill88 AI 点评 A 级 2026-05-20

高质量开源项目,3.2万Stars证明生态认可度高。MCP协议实现规范,Playwright成熟稳定,适合Web自动化场景集成。

📚 实用指南(长尾问题)
适合谁
  • 需要让 Claude / Cursor 操作本地工具的 AI 工程师
最佳实践
  • 配置 MCP 服务器时建议使用 stdio 传输 + JSON-RPC,避免暴露公网
常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • MCP 配置路径拼错或权限不足,重启 Claude Desktop 才生效
部署方案
  • 云端托管:可放在 Vercel / Railway / Fly.io 等 PaaS 平台
相关搜索
playwright-mcp 中文教程playwright-mcp 安装报错怎么办playwright-mcp MCP 配置playwright-mcp 与同类工具对比playwright-mcp 最佳实践playwright-mcp 适合谁用
⚡ 核心功能
👥 适合谁
  • 需要让 Claude / Cursor 操作本地工具的 AI 工程师
⭐ 最佳实践
  • 配置 MCP 服务器时建议使用 stdio 传输 + JSON-RPC,避免暴露公网
⚠️ 常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • MCP 配置路径拼错或权限不足,重启 Claude Desktop 才生效
👥 适合人群
Claude Desktop / Claude Code 用户AI 工具开发者需要扩展 AI 能力的专业人士自动化工程师
🎯 使用场景
  • 在 Claude Desktop 对话中直接调用本地工具,实现 AI 与系统的深度联动
  • 通过自然语言驱动复杂的多步骤自动化任务,代替繁琐手动操作
  • 将多个 MCP 工具组合使用,构建个人专属 AI 工作站
⚖️ 优点与不足
✅ 优点
  • +GitHub 32.5k Star,社区高度认可
  • +Apache-2.0 协议,可免费商用
  • +标准化 MCP 协议,生态互联性强
  • +与 Claude 官方生态无缝对接
  • +即插即用,配置简单快捷
⚠️ 不足
  • 依赖 Claude 客户端,非 Claude 用户无法使用
  • MCP 协议仍在持续演进,接口可能变更
  • 需要一定的配置步骤
⚠️ 使用须知

AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。

建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。

📄 License 说明

✅ Apache 2.0 — 宽松开源协议,可商用,需保留版权声明和 NOTICE 文件,含专利授权条款。

🔗 相关工具推荐
📚 相关教程推荐
🧩 你可能还需要
基于当前 Skill 的能力图谱,自动补全的工具组合
❓ 常见问题 FAQ
支持Chromium、Firefox、WebKit三种浏览器引擎。
💡 AI Skill Hub 点评

经综合评估,playwright-mcp MCP工具 在MCP工具赛道中表现稳健,质量优秀。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。

⬇️ 获取与下载
⬇ 下载源码 ZIP

✅ Apache-2.0 协议 · 可免费商用 · 直接从 aiskill88 服务器下载,无需跳转 GitHub

📚 深入学习 playwright-mcp MCP工具
查看分步骤安装教程和完整使用指南,快速上手这款工具
🌐 原始信息
原始名称 playwright-mcp
原始描述 开源MCP工具:Playwright MCP server。⭐32.5k · TypeScript
Topics 浏览器自动化Web测试数据采集MCP协议TypeScript
GitHub https://github.com/microsoft/playwright-mcp
License Apache-2.0
语言 TypeScript
🔗 原始来源
🐙 GitHub 仓库  https://github.com/microsoft/playwright-mcp 🌐 官方网站  https://www.npmjs.com/package/@playwright/mcp

收录时间:2026-05-14 · 更新时间:2026-05-16 · License:Apache-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。