能力标签
Playwriter
🔌
MCP工具

Playwriter

基于 HTML · 让 AI 助手直接操作你的系统与工具
英文名:playwriter
⭐ 3.6k Stars 🍴 148 Forks 💻 HTML 📄 MIT 🏷 AI 8.0分
8.0AI 综合评分
playwrightmcp浏览器控制
✦ AI Skill Hub 推荐

Playwriter 是 AI Skill Hub 本期精选MCP工具之一。已获得 3.6k 颗 GitHub Star,综合评分 8.0 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。

📚 深度解析

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

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

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

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

📋 工具概览

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

GitHub Stars
⭐ 3.6k
开发语言
HTML
支持平台
Windows / macOS / Linux
维护状态
持续维护,定期更新
开源协议
MIT
AI 综合评分
8.0 分
工具类型
MCP工具
Forks
148

📖 中文文档

以下内容由 AI Skill Hub 根据项目信息自动整理,如需查看完整原始文档请访问底部「原始来源」。

Playwriter 是一款遵循 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/remorses/playwriter

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

# 配置文件位置
# 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 对话中直接使用
# 示例:
用户: 请帮我用 Playwriter 执行以下任务...
Claude: [自动调用 Playwriter MCP 工具处理请求]

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

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

简介


Playwriter - For browser automation MCP

Let your agents control your own Chrome, via CLI or MCP. Your logins, extensions, cookies — already there.


Other browser MCPs spawn a fresh Chrome — no logins, no extensions, instantly flagged by bot detectors, double the memory. Playwriter connects to your running browser instead. One Chrome extension, full Playwright API, everything you're already logged into.

Name a group the user can collapse when they don't care about it

playwriter session new --tab-group done --tab-group-color grey

Installation

  1. Install Extension from Chrome Web Store
  1. Click extension icon on a tab → turns green when connected
  1. Install the CLI and start automating the browser:
   npm i -g playwriter
   playwriter -s 1 -e 'state.page = await context.newPage(); await state.page.goto("https://example.com")'
   

4. Install the skill so your agent knows how to use Playwriter:

   npx -y skills add https://playwriter.dev -g -y
   

MCP Setup

Using the CLI with the skill (step 4 above) is the recommended approach. For direct MCP server configuration, see MCP.md.

Quick Start

playwriter browser start  # starts Chrome for Testing/Chromium with bundled Playwriter extension
playwriter session new  # creates stateful sandbox, outputs session id (e.g. 1)
playwriter -s 1 -e 'state.page = await context.newPage(); await state.page.goto("https://example.com")'
playwriter -s 1 -e 'console.log(await snapshot({ page: state.page }))'
playwriter -s 1 -e 'await state.page.locator("aria-ref=e5").click()'
Tip: Always use single quotes for -e to prevent bash from interpreting $, backticks, and \ in your JS code. Use double quotes for strings inside the JS.

CLI Usage

Each session has isolated state. Browser tabs are shared across sessions.

```bash

Examples

Variables in scope: context, state (persists between calls), cloud (local CLI sessions), require, importModule, native import(), and Node.js globals. Relative imports resolve from the session working directory. There is no default page; examples below assume state.page was set as shown above.

Persist data in state:

playwriter -e "state.users = await state.page.$$eval('.user', els => els.map(e => e.textContent))"
playwriter -e "console.log(state.users)"

Intercept network requests:

playwriter -e "state.requests = []; state.page.on('response', r => { if (r.url().includes('/api/')) state.requests.push(r.url()) })"
playwriter -e "await Promise.all([state.page.waitForResponse(r => r.url().includes('/api/')), state.page.click('button')])"
playwriter -e "console.log(state.requests)"

Set breakpoints and debug:

playwriter -e "state.cdp = await getCDPSession({ page: state.page }); state.dbg = createDebugger({ cdp: state.cdp }); await state.dbg.enable()"
playwriter -e "state.scripts = await state.dbg.listScripts({ search: 'app' }); console.log(state.scripts.map(s => s.url))"
playwriter -e "await state.dbg.setBreakpoint({ file: state.scripts[0].url, line: 42 })"

Live edit page code:

playwriter -e "state.cdp = await getCDPSession({ page: state.page }); state.editor = createEditor({ cdp: state.cdp }); await state.editor.enable()"
playwriter -e "await state.editor.edit({ url: 'https://example.com/app.js', oldString: 'const DEBUG = false', newString: 'const DEBUG = true' })"

Screenshot with labels:

playwriter -e "await screenshotWithAccessibilityLabels({ page: state.page })"

Live stream a tab to X Live / Twitch (RTMP, survives CLI exit):

playwriter -s 1 -e "state.page = await context.newPage(); await state.page.goto('https://example.com')"
playwriter stream start -s 1 --rtmp rtmp://va.pscp.tv:80/x/<stream-key>
playwriter stream status -s 1
playwriter stream stop -s 1

Remote tabs support the same title and color options

playwriter session new --remote <id> --tab-group support playwriter session update 1 --tab-group review --tab-group-color cyan


`--tab-group-color` accepts: `grey`, `blue`, `red`, `yellow`, `green`, `pink`, `purple`, `cyan`, `orange`. Without it, color is derived from the name. The default local `playwriter` group stays green.

Node programs should use `connectViaExtension()` instead of posting `/cli/session/new` themselves:
ts import { connectViaExtension } from 'playwriter'

await using connection = await connectViaExtension({ tabGroup: 'email-check', tabGroupColor: 'grey', }) // the page closes its tab when the scope ends, also on throw await using page = await connection.browser.contexts()[0].newPage() await page.goto('https://example.com')


`tabGroupColor` is typed as Chrome's tab group colors. `await using` calls `close()` at scope end: it disconnects CDP and deletes the session. It does **not** close tabs: close every tab your script opens with `await using page` or `page.close()`. Pass `closeTabsOnEnd: true` to make `close()` also close the tabs this connection opened (never other sessions' tabs). Without `await using`, call `await connection.close()` in `finally`.

A tab you do not close stays open, so a later process can reuse it:
ts // process A await using a = await connectViaExtension({ tabGroup: 'job' }) await (await a.browser.contexts()[0].newPage()).goto('https://example.com')

// process B, later await using b = await connectViaExtension({ tabGroup: 'job' }) const page = b.browser.contexts()[0].pages().findLast((p) => p.url() === 'https://example.com/')


Match tabs by their exact url: `context.pages()` also lists tabs other sessions opened.

Several processes can share one tab for `fetch` calls inside a signed-in site, and the last one closes it. See [Sharing one tab between processes](https://playwriter.dev/docs/sessions#sharing-one-tab-between-processes).

If the extension runs in more than one browser or profile, pass `selectBrowser`. It gets every connected browser and returns the one to use:
ts await using connection = await connectViaExtension({ selectBrowser: (browsers) => { // [{ id, browser: 'Brave', email: 'me@work.com', activeTabs, playwriterVersion }] return browsers.find((b) => b.email === 'me@work.com') }, })

`id` is stable, so you can save it and match on it later. `listBrowsers()` returns the same list without connecting.

Multiline:
bash playwriter -s 1 -e $' const title = await state.page.title(); console.log({ title, url: state.page.url() }); ' ```

Playwright API

Connect programmatically (without CLI):

import { chromium } from 'playwright-core'
import { startPlayWriterCDPRelayServer, getCdpUrl } from 'playwriter'

const server = await startPlayWriterCDPRelayServer()
const browser = await chromium.connectOverCDP(getCdpUrl())
const page = await browser.contexts()[0].newPage()

await page.goto('https://example.com')
await page.screenshot({ path: 'screenshot.png' })
// Don't call browser.close() - it closes the user's Chrome
server.close()

Or connect to a running server:

npx -y playwriter serve --host 127.0.0.1
const browser = await chromium.connectOverCDP('http://127.0.0.1:19988')

Comparison

vs Playwright MCP

PlaywriterPlaywright MCP
Browser**Uses your Chrome**Separate managed profile by default
ExtensionsYour existing onesNone by default
Login stateAlready logged inPersistent, but a separate profile
Attach to your ChromeCore design--extension mode
Bot handlingReal browser (disconnect to solve)Managed automation profile
Native video / raw CDPYesTrace-based / not exposed
Note: Playwriter video recording is 100x more efficient than Playwright video recording, which sends base64 images for every frame.
PlaywriterPlaywright CLI
Browser**Uses your Chrome**New browser by default
Login stateAlready logged inPersistent profile, separate
ExtensionsYour existing onesNone by default
CaptchasDisconnect extension to solveManaged automation profile
Programmable JSexecute with persistent staterun-code (no cross-call state)
Raw CDP accessFirst-classNot exposed
Video recordingCDP screencast + ffmpeg, page audioTrace / screencast based

vs BrowserMCP

PlaywriterBrowserMCP
Tools**1 execute tool**12+ dedicated tools
APIFull PlaywrightLimited actions
Context usageLowHigh (tool schemas)
LLM knowledgeAlready knows PlaywrightMust learn tools

vs agent-browser

Playwriteragent-browser
Browser**Uses your Chrome**Fresh Chrome for Testing
API surface1 execute + full Playwright50+ CLI commands, one per action
Actions per turnReal JS (loops, conditions)batch of command strings
Reusable logicImport a .js functionRe-run bash sequences
Skill recorderYesNo
Cloud browsersBuilt-in stealth + proxyPlugin only
Remote control tabYes (Devin, cloud bots)No

vs Antigravity (Jetski)

PlaywriterJetski
Tools**1 tool**17+ tools
SubagentDirect executionSpawns for each browser task
LatencyLowHigh (agent overhead)

vs Claude Browser Extension

PlaywriterClaude Extension
Agent support**Any MCP client**Claude only
Windows WSLYesNo
Context methodA11y snapshots (5-20KB)Screenshots (100KB+)
Playwright APIFullNo
Debugger/breakpointsYesNo
Live code editingYesNo
Network interceptionFullLimited
Raw CDP accessYesNo

vs Built-in Chrome CDP (`--remote-debugging-port`)

PlaywriterBuilt-in CDP
Setup**Click extension icon**Relaunch Chrome with special flags
Your real profileYesBlocked on default profile since Chrome 136
Permission promptNone"Allow remote debugging?" dialog agents can't click
Autonomous agentsFully autonomousBlocked by dialog / throwaway profile
Existing sessionUses your running browserMust relaunch Chrome (lose state)
Chrome's --remote-debugging-port is ignored on your default profile since Chrome 136, so you must use a throwaway --user-data-dir with none of your logins. Connecting an external CDP client also shows an "Allow remote debugging?" dialog an agent cannot click. Playwriter uses an in-Chrome extension instead: no dialog, no flags, your real profile.

Troubleshooting

View relay server logs to debug issues:

```bash playwriter logfile # prints the log file path

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

高质量的MCP工具,自动化浏览器操作

📚 实用指南(长尾问题)
适合谁
  • 需要让 Claude / Cursor 操作本地工具的 AI 工程师
  • 构建多智能体协作系统的 Agent 开发者
最佳实践
  • 配置 MCP 服务器时建议使用 stdio 传输 + JSON-RPC,避免暴露公网
  • Agent 任务先做 dry-run 验证工具调用链,再开启自主执行
常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • MCP 配置路径拼错或权限不足,重启 Claude Desktop 才生效
部署方案
  • CLI:直接 npm install -g / pip install,命令行调用
  • 云端托管:可放在 Vercel / Railway / Fly.io 等 PaaS 平台
相关搜索
playwriter 中文教程playwriter 安装报错怎么办playwriter MCP 配置playwriter Agent 工作流playwriter 与同类工具对比playwriter 最佳实践playwriter 适合谁用

⚡ 核心功能

👥 适合谁
  • 需要让 Claude / Cursor 操作本地工具的 AI 工程师
  • 构建多智能体协作系统的 Agent 开发者
⭐ 最佳实践
  • 配置 MCP 服务器时建议使用 stdio 传输 + JSON-RPC,避免暴露公网
  • Agent 任务先做 dry-run 验证工具调用链,再开启自主执行
⚠️ 常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • MCP 配置路径拼错或权限不足,重启 Claude Desktop 才生效

👥 适合人群

Claude Desktop / Claude Code 用户AI 工具开发者需要扩展 AI 能力的专业人士自动化工程师

🎯 使用场景

  • 在 Claude Desktop 对话中直接调用本地工具,实现 AI 与系统的深度联动
  • 通过自然语言驱动复杂的多步骤自动化任务,代替繁琐手动操作
  • 将多个 MCP 工具组合使用,构建个人专属 AI 工作站

⚖️ 优点与不足

✅ 优点
  • +MIT 协议,可免费商用
  • +标准化 MCP 协议,生态互联性强
  • +与 Claude 官方生态无缝对接
  • +即插即用,配置简单快捷
⚠️ 不足
  • −依赖 Claude 客户端,非 Claude 用户无法使用
  • −MCP 协议仍在持续演进,接口可能变更
  • −需要一定的配置步骤
⚠️ 使用须知

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

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

📄 License 说明

✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。

🔗 相关工具推荐

📚 相关教程推荐
📰 相关 AI 新闻
🍿 AI 圈相关吃瓜
🗺️ 相关解决方案
🧩 你可能还需要
基于当前 Skill 的能力图谱,自动补全的工具组合

❓ 常见问题 FAQ

playwriter 是一款HTML开发的AI辅助工具。开源MCP工具:Chrome extension & CLI to let agents control your browser. Runs Playwright snipp。⭐3.6k · HTML 主要应用场景包括:自动化浏览器操作。
💡 AI Skill Hub 点评

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

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

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

📚 深入学习 Playwriter
查看分步骤安装教程和完整使用指南,快速上手这款工具
🌐 原始信息
原始名称 playwriter
原始描述 开源MCP工具:Chrome extension & CLI to let agents control your browser. Runs Playwright snipp。⭐3.6k · HTML
Topics playwrightmcp浏览器控制
GitHub https://github.com/remorses/playwriter
License MIT
语言 HTML
🔗 原始来源
🐙 GitHub 仓库  https://github.com/remorses/playwriter 🌐 官方网站  https://playwriter.dev

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

📺 订阅 AI Skill Hub Daily Telegram 频道
每天 8 条精选 AI Skill、MCP、Agent 与自动化工具推送
加入频道 →