Playwright MCP Server — Browser Automation for AI
Official Playwright MCP server for browser automation. Lets Claude Code, Cursor, and other AI tools navigate pages, fill forms, click buttons, take screenshots, and run end-to-end tests via natural la
这个资产会安全暂存
这个资产会先安全暂存。复制的指令会要求 Agent 读取暂存文件,并在激活脚本、MCP 配置或全局配置前先确认。
npx -y tokrepo@latest install 290f10c7-59c4-49aa-bfdd-56e8becfa222 --target codex先暂存文件;激活前需要读取暂存 README 和安装计划。
What it is
The Playwright MCP Server bridges AI coding tools with real browser automation. It lets Claude Code, Cursor, and other AI assistants navigate web pages, fill forms, click buttons, take screenshots, and run end-to-end tests via natural language instructions. The server implements the Model Context Protocol (MCP) on top of the Playwright browser automation library.
This tool targets developers who want their AI assistant to interact with web applications directly, whether for testing, scraping, or verifying UI changes during development.
How it saves time or tokens
Instead of manually writing Playwright test scripts, you describe what you want in natural language and the AI assistant executes browser actions through the MCP server. This is particularly useful for exploratory testing, where you want to verify a feature works without writing a formal test. The AI can take screenshots, read page content, and report back, acting as an automated QA assistant.
How to use
- Add the Playwright MCP server to your config:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@anthropic/mcp-playwright"]
}
}
}
- Add this to your
claude_desktop_config.jsonor.cursor/mcp.json.
- Ask your AI assistant to interact with web pages: navigate, click, fill forms, take screenshots, or run tests.
Example
# Install and run standalone for testing
npx @anthropic/mcp-playwright
# In Claude Code or Cursor, you can say:
# 'Navigate to localhost:3000 and check if the login form works'
# 'Take a screenshot of the dashboard page'
# 'Fill in the signup form with test data and submit'
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": [
"@anthropic/mcp-playwright",
"--browser", "chromium",
"--headless"
]
}
}
}
Related on TokRepo
- Browser Automation MCP — Chrome-based MCP server for browser control
- AI Tools for Testing — Testing and QA tools powered by AI
This tool integrates with standard development workflows and requires minimal configuration to get started. It is available as open-source software with documentation and community support through the official repository. The project follows semantic versioning for stable releases.
For teams evaluating this tool, the key advantage is reducing manual work in repetitive tasks. The automation provided by the built-in features means less custom code to maintain and fewer integration points to manage. This translates directly to lower maintenance costs and faster iteration cycles.
Common pitfalls
- The MCP server launches a browser process; in CI environments or containers, use the
--headlessflag to avoid display server requirements. - Browser automation can be slow for complex pages; set appropriate timeouts for pages with heavy JavaScript rendering.
- Some websites block automated browsers; the MCP server uses standard Playwright which may trigger anti-bot protections on certain sites.
常见问题
The Playwright MCP server works with any tool that supports the Model Context Protocol, including Claude Code, Claude Desktop, and Cursor. It exposes browser automation capabilities as MCP tools that AI assistants can invoke.
It supports Chromium, Firefox, and WebKit through the Playwright library. Chromium is the default. Specify the browser with the --browser flag.
Yes. The AI assistant can navigate your application, interact with UI elements, take screenshots, and verify page content. This is useful for exploratory testing and regression checks during development.
Yes. Pass the --headless flag to run without a visible browser window. This is required for server environments, CI pipelines, and Docker containers.
Yes. Both the MCP server and the underlying Playwright library are open-source and free to use. There are no API keys or usage fees for the MCP server itself.
引用来源 (3)
- Playwright Documentation— Playwright provides cross-browser automation for Chromium, Firefox, and WebKit
- MCP Specification— Model Context Protocol specification for AI tool integration
- Anthropic MCP Servers— Playwright MCP server for AI coding assistants
来源与感谢
Created by Microsoft. MCP integration by Anthropic. Playwright — Fast and reliable end-to-end testing.
讨论
相关资产
Playwright MCP — Browser Automation for AI Agents
Official Playwright MCP server that gives AI agents full browser control — navigate pages, fill forms, click buttons, take screenshots, and run end-to-end tests. 3,000+ stars.
Notte — Browser Automation MCP for AI Agents
MCP server that turns web browsers into AI agent tools. Notte provides structured browser actions like click, type, navigate, and extract for LLM-driven automation.
Playwright MCP — Browser Automation Server
Playwright MCP is an MCP server for browser automation via Playwright snapshots. Add via npx in Claude Code/Codex to run deterministic actions.
charlotte — Token-Efficient Browser MCP Server
Charlotte is a token-efficient browser MCP server: agents get a compact page summary by default, then query only the elements they need.