Playwright Mcp
@microsoft
关于 Playwright Mcp
Playwright MCP server
基本信息
配置
使用下面的配置,将此服务器添加到你的 MCP 客户端。
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": [
"@playwright/mcp@latest"
]
}
}
}工具
15Navigate to a URL
Go back to the previous page
Go forward to the next page
Choose one or multiple files to upload
Capture accessibility snapshot of the current page, this is better than screenshot
Perform click on a web page
Hover over element on page
Type text into editable element
Select an option in a dropdown
Take a screenshot of the current page. You can't perform actions based on the screenshot, use browser_snapshot for actions.
Press a key on the keyboard
Wait for a specified time in seconds
Save page as PDF
Close the page
Install the browser specified in the config. Call this if you get an error about the browser not being installed.
概览
What is Playwright MCP?
A Model Context Protocol (MCP) server that provides browser automation capabilities using Playwright. It enables LLMs to interact with web pages through structured accessibility tree snapshots, bypassing the need for screenshots or visually-tuned models.
How to use Playwright MCP?
Install the server with your MCP‑compatible client (e.g., VS Code, Cursor, Claude Desktop). Use the standard JSON configuration: "command": "npx" and "args": ["@playwright/mcp@latest"]. Detailed setup guides for each client are in the README.
Key features of Playwright MCP
- Fast and lightweight – uses accessibility tree, not pixel input.
- LLM‑friendly – no vision models needed.
- Deterministic tool application – avoids ambiguity of screenshot‑based approaches.
- Runs on Node.js 18 or newer.
- Supports a wide range of MCP clients.
Use cases of Playwright MCP
- Exploratory automation with persistent browser state.
- Self‑healing tests that iterate over page structure.
- Long‑running autonomous workflows requiring continuous context.
- General browser automation driven by language models.
FAQ from Playwright MCP
How does Playwright MCP differ from the Playwright CLI?
The MCP variant is suited for agentic loops that benefit from persistent state, rich introspection, and iterative reasoning over page structure. The CLI + SKILLs approach is more token‑efficient for high‑throughput coding agents.
What are the system requirements?
Node.js 18 or newer is required. No additional runtime dependencies are mentioned.
Which clients can I use with Playwright MCP?
It works with VS Code, Cursor, Windsurf, Claude Desktop, Goose, Junie, Copilot, Gemini CLI, Warp, and many other MCP‑compatible tools. Detailed per‑client installation instructions are provided.
How do I install Playwright MCP?
Run the standard MCP configuration: npx @playwright/mcp@latest. Specific commands for each client (e.g., claude mcp add, code --add-mcp) are documented in the README.
Are there any security or host filtering options?
Yes, you can pass --allowed-hosts <hosts...> to limit which hosts the server can serve from. The environment variable PLAYWRIGHT_MCP_ALLOWED_HOSTS can also be used.
浏览器自动化 分类下的更多 MCP 服务器
Fetcher MCP
jae-jaeMCP server for fetch web page content using Playwright headless browser.
Fetch MCP Server
zcaceresA flexible HTTP fetching Model Context Protocol server.
X Twitter Scraper
Xquik-devTwitter scraper API skill for tweet search, advanced Twitter search, profile tweets, follower export, media download, monitors, webhooks, MCP, and posting automation: send tweets and replies.
Webpage Screenshot MCP Server
ananddtyagiAn MCP that gives your agent the ability to snap a screenshot of webpages. Useful when you want your agent to check its progress during development.
Fetch MCP
jae-jaeMCP server for fetch web page content using Playwright headless browser.
评论