mcp-playwright测评

mcp-playwright介绍

mcp-playwright是一个使用 Playwright 提供浏览器自动化能力的模型上下文协议服务器。该服务器使 LLMs 能够与网页交互、截屏,并在真实的浏览器环境中执行 JavaScript。

GitHub地址:https://github.com/executeautomation/mcp-playwright。

image-20250319164041666

安装

npm install -g @executeautomation/playwright-mcp-server

Claude Desktop 配置:

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

但是这样配置在Cline中会报错,如下所示:

image-20250319164907655

修改为如下所示即可:

 "playwright": {
      "command": "cmd",
      "args": [
        "/c",
        "npx",
        "-y",
        "@executeautomation/playwright-mcp-server"
      ]
    }

现在看一下mcp-playwright提供的所有功能。

image-20250319165049167

image-20250319165127083

image-20250319165147734

实践

现在开始测试一下mcp-playwright提供的几个工具。

模型使用的是Qwen/Qwen2.5-72B-Instruct。

playwright_navigate

页面导航功能。

任务:“使用mcp服务器导航至https://github.com/executeautomation/mcp-playwright”

效果:

image-20250319165602152

image-20250319165630774

playwright_screenshot

屏幕截图功能。

效果:

image-20250319165854797

image-20250319165942580

playwright_click

点击元素功能。

比如点击Issues 按钮。

image-20250319170731784

image-20250319170753941

playwright_fill

填写输入字段功能。

Task:“使用MCP服务器导航至https://www.google.com.hk/index.html 并在搜索框输入你好。”

image-20250319181613849

playwright_evaluate

执行js代码。

Task:“使用MCP服务器导航至https://www.google.com.hk/index.html 并在控制台输出你好世界。”

image-20250319182114795

剩下的工具我就不一个个试了。

具体使用场景我也还不了解,但是毕竟是个新项目,看看这个项目的发展吧!!

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值