# 安装 Playwright

- 类型: MCP 工具
- 说明: 用于自动操作浏览器、截图并执行端到端测试流程
- 仓库: https://github.com/microsoft/playwright-mcp

## 方式一 · 一键代装（复制提示词让 AI 代劳）

### Claude Code
```
请帮我安装 askskill 上的 "Playwright" MCP 服务：
执行：claude mcp add playwright -- npx -y @playwright/mcp
```

### Codex
```
请帮我安装 askskill 上的 "Playwright" MCP 服务：
在 ~/.codex/config.toml 中添加：
[mcp_servers.playwright]
command = "npx"
args = ["-y","@playwright/mcp"]
然后重启 Codex 生效
```

### Cursor
```
请帮我安装 askskill 上的 "Playwright" MCP 服务：
在 .cursor/mcp.json 的 "mcpServers" 中添加：
"playwright": { "command": "npx", "args": ["-y","@playwright/mcp"] }
然后在 Cursor 设置 > MCP 中启用
```

## 方式二 · 命令行安装（原生命令与配置）

### Claude Code
```bash
claude mcp add playwright -- npx -y @playwright/mcp
```

### Codex
```bash
codex mcp add playwright -- npx -y @playwright/mcp
```
配置文件 ~/.codex/config.toml：
```toml
[mcp_servers.playwright]
command = "npx"
args = ["-y","@playwright/mcp"]
```

### Cursor
配置文件 .cursor/mcp.json：
```json
{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": [
        "-y",
        "@playwright/mcp"
      ]
    }
  }
}
```
一键安装：cursor://anysphere.cursor-deeplink/mcp/install?name=playwright&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBwbGF5d3JpZ2h0L21jcCJdfQ
