p

playwright

albertjiang/playwright
Hosted
4 Stars 3.7k 次浏览 更新于 2026-08-23

MCP 服务配置

复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用

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

可用工具 (24 个)

该服务在 MCP 协议中暴露的工具,AI 可按需调用

browser_close

Close the page

该工具无需必填参数,直接调用即可

browser_resize 2 个参数 需填 2 项

Resize the browser window

必填参数:width、height

browser_console_messages

Returns all console messages

该工具无需必填参数,直接调用即可

browser_handle_dialog 2 个参数 需填 1 项

Handle a dialog

必填参数:accept

browser_evaluate 3 个参数 需填 1 项

Evaluate JavaScript expression on page or element

必填参数:function

browser_file_upload 1 个参数 需填 1 项

Upload one or multiple files

必填参数:paths

browser_install

Install the browser specified in the config. Call this if you get an error about the browser not being installed.

该工具无需必填参数,直接调用即可

browser_press_key 1 个参数 需填 1 项

Press a key on the keyboard

必填参数:key

browser_type 5 个参数 需填 3 项

Type text into editable element

必填参数:element、ref、text

browser_navigate 1 个参数 需填 1 项

Navigate to a URL

必填参数:url

browser_navigate_back

Go back to the previous page

该工具无需必填参数,直接调用即可

browser_navigate_forward

Go forward to the next page

该工具无需必填参数,直接调用即可

browser_network_requests

Returns all network requests since loading the page

该工具无需必填参数,直接调用即可

browser_take_screenshot 5 个参数

Take a screenshot of the current page. You can't perform actions based on the screenshot, use browser_snapshot for actions.

该工具无需必填参数,直接调用即可

browser_snapshot

Capture accessibility snapshot of the current page, this is better than screenshot

该工具无需必填参数,直接调用即可

browser_click 4 个参数 需填 2 项

Perform click on a web page

必填参数:element、ref

browser_drag 4 个参数 需填 4 项

Perform drag and drop between two elements

必填参数:startElement、startRef、endElement、endRef

browser_hover 2 个参数 需填 2 项

Hover over element on page

必填参数:element、ref

browser_select_option 3 个参数 需填 3 项

Select an option in a dropdown

必填参数:element、ref、values

browser_tab_list

List browser tabs

该工具无需必填参数,直接调用即可

browser_tab_new 1 个参数

Open a new tab

该工具无需必填参数,直接调用即可

browser_tab_select 1 个参数 需填 1 项

Select a tab by index

必填参数:index

browser_tab_close 1 个参数

Close a tab

该工具无需必填参数,直接调用即可

browser_wait_for 3 个参数

Wait for text to appear or disappear or a specified time to pass

该工具无需必填参数,直接调用即可

服务介绍

看起来您可能忘记附上需要翻译的英文技术文档内容了。请提供具体的文档文本,以便我能够帮助您进行翻译。

相关 MCP 服务