Playwright MCP
Enables AI assistants to interact with web browsers in real-time through Playwright, providing DOM access, screenshots, and interaction recording to generate accurate, context-aware test scripts.
README
How to Use playwright-mcp?
Introduction
Ever tried using Cursor or Claude to write Playwright tests? Yeah, it's kind of a mess.
Why? Because your AI assistant has no clue what's on your web page. It's like trying to describe a painting to someone who's blindfolded. The result?
- Flaky tests → The AI is guessing selectors, and it gets them wrong.
- Broken scripts → You spend more time fixing tests than writing them.
- Debugging nightmares → The AI can't "see" what's happening, so you end up doing all the heavy lifting.
Wouldn't it be nice if your AI could actually understand your web page instead of just making educated guesses?
Enter playwright-mcp !
playwright-mcp gives your AI assistant superpowers by making the browser fully visible to it. Instead of working in the dark, your AI assistant now has real-time access to the page DOM, elements, and interactions.
How playwright-mcp Works (AKA How We Fix This Mess)
Once installed, playwright-mcp spins up a Playwright-controlled browser and gives your AI assistant full access to it. This unlocks:
- Recording interactions → Click, type, scroll—let playwright-mcp turn your actions into fully functional Playwright test cases.
- Taking screenshots → Capture elements or full pages so your AI gets actual visual context (no more guessing).
- Extracting the DOM → Grab the entire HTML structure so the AI can generate rock-solid selectors.
- Executing JavaScript → Run custom JS inside the browser for debugging, automation, or just for fun.
Why You'll Love playwright-mcp
🚀 AI-generated tests that actually work → No more flaky selectors, broken tests, or guesswork.
⏳ Massive time savings → Write and debug Playwright tests 5x faster.
🛠️ Fewer headaches → Your AI assistant gets live page context, so it can generate real test cases.
🔌 Works out of the box → Plug it into Cursor, Claude, WindSurf, or whatever you use—it just works.
Give Your AI the Context It Deserves
Tired of fixing AI-generated tests? Stop debugging AI's bad guesses—start writing flawless Playwright tests. Use the guide below to install playwright-mcp and let your AI assistant actually help you for once.
Installation: Get Up and Running in No Time
Prerequisites (a.k.a. What You Need Before You Start)
Before you install playwright-mcp, make sure you have:
✅ Node.js installed on your system (because, well… it's an npm package)
✅ Playwright and its Chromium browser installed
✅ An IDE that supports MCP, like Cursor
✅ A brain that's ready to automate Playwright tests like a pro
Setting Up playwright-mcp (It's Easy, I Promise)
Connect It to Your IDE (Cursor Setup)
If you're using Cursor, follow these steps to connect playwright-mcp like a boss:
-
Open Cursor IDE
-
Navigate to Settings (⚙️)
-
Select Cursor Settings → Go to the MCP tab
-
Click "Add new MCP server"
-
Fill in the following details:

- Name →
playwright-mcp - Command →
npx -y playwright-mcp
- Name →
-
Click "Add", and boom—you're connected! 🚀
Note: If clicking on "Add new MCP server", opens a file(.cursor/mcp.json), Paste the following code and save:
{
"mcpServers": {
"playwright-mcp": {
"command": "npx",
"args": [
"-y",
"playwright-mcp"
]
}
}
}
Now Cursor actually understands your web pages. No more random test suggestions based on zero context! Head to the Claude tutorial or Cursor tutorial to understand it in details.
Connect It to Claude desktop
Wait… Does It Work with Other AI Assistants? Yes! While playwright-mcp is a match made in heaven for IDEs, you can use it with Claude desktop to write tests as well.
-
Install
playwright-mcp(The Easy Part)- First things first, fire up your terminal and run:
npm install -g playwright-mcp
-
Hook It Up to Claude Desktop
- Find the Configuration File
- On windows
%APPDATA%\Claude\claude_desktop_config.json
- On macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Update the config file
{ "mcpServers": { "playwright": { "command": "npx", "args": ["-y", "playwright-mcp"] } } } -
Restart Claude Desktop (Because It's a New Day)
- Close and reopen Claude Desktop to apply the changes.
-
Verify That It's Working
- Once everything is set up, let's test if Claude can actually talk to Playwright now.
- Open Claude and ask: "List all available MCP tools."
- If
playwright-mcpis installed correctly, it should list tools like:get-contextget-full-domget-screenshotexecute-codeinit-browservalidate-selectors
- Ask Claude to init browser and a browser should open up after your approval!
Now that the Calude has access to the web pages. You can ask it write highly contextual tests! Head to the Claude tutorial or Cursor tutorial to understand it in details.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。