
Playwright 模型上下文协议服务器——自动化 Claude 桌面、Cline、光标 IDE 🔌 等浏览器和 API 的工具
概览
一个模型上下文协议服务器,利用Playwright提供浏览器自动化功能。该服务器使LLM能够与网页交互、截图、生成测试代码、网页抓取页面并在真实浏览器环境中执行JavaScript。 用一个简单的命令测试你的网页应用: - “iPhone 13测试” - “切换到iPad视图” - “旋转为横向” iPhone、iPad、Pixel、Galaxy 和桌面浏览器,支持视口、用户代理、触摸事件和设备像素比例的正确模拟。 📚 查看设备快速参考 |提示指南 你可以用 npm、mcp-get 或 Smithery 安装该软件包: 通过Smithery自动安装Playwright MCP for Claude Desktop: 通过以下按钮之一在VS Code中安装Playwright MCP服务器:
概述(AI 翻译)
MseeP.ai 安全评估
剧作家MCP服务器 🎭
一个模型上下文协议服务器,利用Playwright提供浏览器自动化功能。该服务器使LLM能够与网页交互、截图、生成测试代码、网页抓取页面并在真实浏览器环境中执行JavaScript。
✨ v1.0.10 新增内容
🎯 设备模拟,包含143个真实设备预设!
用一个简单的命令在真实设备配置文件上测试你的网页应用:
人工智能助手的自然语言支持:
- “iPhone 13测试”
- “切换到iPad视图”
- “旋转到横向”
支持 143 种设备: iPhone、iPad、Pixel、Galaxy 和桌面浏览器,并具备视口、用户代理、触摸事件和设备像素比例的正确模拟。
📚 查看设备快速参考 |提示指南
截图
文档 |API 参考
安装
你可以用 npm、mcp-get 或 Smithery 安装该软件包:
使用npm:
使用 mcp-get:
使用 Smithery
通过Smithery自动安装Playwright MCP for Claude Desktop:
使用 Claude 代码:
在 VS Code 中的安装
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Playwright MCP Server 🎭
A Model Context Protocol server that provides browser automation capabilities using Playwright. This server enables LLMs to interact with web pages, take screenshots, generate test code, web scrapes the page and execute JavaScript in a real browser environment.
✨ What’s New in v1.0.10
🎯 Device Emulation with 143 Real Device Presets!
Test your web applications on real device profiles with a simple command:
// Test on iPhone 13 with automatic user-agent, touch support, and device pixel ratio
await playwright_resize({ device: "iPhone 13" });
// Switch to iPad with landscape orientation
await playwright_resize({ device: "iPad Pro 11", orientation: "landscape" });
// Test desktop view
await playwright_resize({ device: "Desktop Chrome" });
Natural Language Support for AI Assistants:
- “Test on iPhone 13”
- “Switch to iPad view”
- “Rotate to landscape”
Supports 143 devices: iPhone, iPad, Pixel, Galaxy, and Desktop browsers with proper emulation of viewport, user-agent, touch events, and device pixel ratios.
📚 View Device Quick Reference | Prompt Guide
Screenshot
Documentation | API reference
Installation
You can install the package using either npm, mcp-get, or Smithery:
Using npm:
npm install -g @executeautomation/playwright-mcp-server
Using mcp-get:
npx @michaellatman/mcp-get@latest install @executeautomation/playwright-mcp-server
Using Smithery
To install Playwright MCP for Claude Desktop automatically via Smithery:
安装
npx @executeautomation/playwright-mcp-server配置
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["-y", "@executeautomation/playwright-mcp-server"]
}
}
}