Playwright Server MCP
剧作家服务器 MCP 服务器
\带有剧作家工具的 MCP 服务器\
成分
资源
服务器实现了一个简单的笔记存储系统,其中包括:
用于访问单个笔记的自定义 note:// URI 方案
每个笔记资源都有一个名称、描述和文本/纯文本 mimetype
提示
服务器提供一个提示:
总结笔记:创建所有存储笔记的摘要
可选的“样式”参数用于控制详细程度(简要/详细)
生成提示,结合所有当前注释和样式偏好
工具
该服务器实现了以下工具:
playwright_navigate:导航到指定的 URL。如果没有活动会话,此操作将自动创建新会话。需要一个
url参数(字符串)。
playwright_screenshot:截取当前页面或特定元素的屏幕截图。需要一个
name参数(字符串)作为屏幕截图文件名。可选的
selector参数(字符串),用于指定要截取屏幕截图的元素的 CSS 选择器。如果未提供选择器,则截取整页屏幕截图。
playwright_click:使用 CSS 选择器单击页面上的元素。需要一个
selector参数(字符串)来指定要点击的元素的 CSS 选择器。
playwright_fill:填写输入字段。需要一个
selector参数(字符串)来指定输入字段的 CSS 选择器。需要一个
value参数(字符串)来指定要填充的值。
playwright_evaluate:在浏览器控制台中执行 JavaScript 代码。需要
script参数(字符串)来指定要执行的 JavaScript 代码。
playwright_click_text:通过文本内容点击页面上的元素。需要
text参数(字符串)来指定要点击的元素的文本内容。
playwright_get_text_content:获取所有可见元素的文本内容。playwright_get_html_content:获取页面的 HTML 内容。需要一个
selector参数(字符串)来指定元素的 CSS 选择器。
Related MCP server: Cloudflare Playwright MCP
配置
[TODO:添加特定于您的实现的配置详细信息]
快速入门
安装
克劳德桌面
在 MacOS 上: ~/Library/Application\ Support/Claude/claude_desktop_config.json在 Windows 上: %APPDATA%/Claude/claude_desktop_config.json
发展
构建和发布
准备分发包:
同步依赖项并更新锁文件:
uv sync构建软件包分发版:
uv build这将在dist/目录中创建源和轮子分布。
发布到 PyPI:
uv publish注意:您需要通过环境变量或命令标志设置 PyPI 凭据:
令牌:
--token或UV_PUBLISH_TOKEN或用户名/密码:
--username/UV_PUBLISH_USERNAME和--password/UV_PUBLISH_PASSWORD
调试
由于 MCP 服务器通过 stdio 运行,调试起来可能比较困难。为了获得最佳调试体验,我们强烈建议使用MCP Inspector 。
您可以使用以下命令通过npm启动 MCP Inspector:
npx @modelcontextprotocol/inspector uv --directory C:\Users\YUNYING\Documents\project\python\mcp\playwright-server run playwright-server启动后,检查器将显示一个 URL,您可以在浏览器中访问该 URL 以开始调试。
Available Tools
8 toolsplaywright_clickC
Click an element on the page using CSS selector
Inputs: selector (required).
playwright_click_textB
Click an element on the page by its text content
Inputs: text (required).
playwright_evaluateC
Execute JavaScript in the browser console
Inputs: script (required).
playwright_fillC
Fill out an input field
Inputs: selector (required), value (required).
playwright_get_html_contentC
Get the HTML content of the page
Inputs: selector (required).
playwright_get_text_contentB
Get the text content of all elements
Inputs: no named parameters.
playwright_screenshotC
Take a screenshot of the current page or a specific element
Inputs: name (required), selector.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Most tools have distinct purposes targeting different page interactions (clicking, filling, navigating, etc.), but 'playwright_get_html_content' and 'playwright_get_text_content' could potentially be confused as both retrieve content from the page, though their descriptions clarify the difference. Overall, the overlap is minimal and manageable.
All tool names follow a consistent 'playwright_' prefix with snake_case and clear verb_noun patterns (e.g., playwright_click, playwright_navigate). This predictability makes it easy for agents to understand and select tools without confusion.
With 8 tools, this server is well-scoped for a Playwright automation purpose, covering essential actions like navigation, interaction, content retrieval, and screenshots. Each tool serves a clear, necessary function without bloat or redundancy.
The toolset covers core web automation tasks effectively, including navigation, element interaction, content extraction, and screenshots. A minor gap exists in advanced operations like handling pop-ups, waiting for elements, or managing sessions explicitly, but agents can likely work around these with the provided tools.
Maintenance
Related MCP Connectors
Playwright browser automation — navigate, click, fill forms, extract, screenshot — 17 agent tools.
Control a real browser from AI agents: navigate, click, type, screenshot, read the page.
Hosted browser for agents: open pages, search the web, extract data, read PDFs and take screenshots.
Stealth web automation for AI agents. Login, signup, navigate, screenshot.
Related MCP Servers
- AlicenseBqualityDmaintenanceA server that enables browser automation using Playwright, allowing interaction with web pages, capturing screenshots, and executing JavaScript in a browser environment through LLMs.1213,391 npm1MIT
- AlicenseBqualityFmaintenanceA server that leverages Playwright for automated browser testing and integrates with Cloudflare Workers, enabling AI assistants to control web browsers for navigation, interaction, and screenshots.22261Apache 2.0
- AlicenseCqualityBmaintenanceA comprehensive MCP server that provides powerful web automation tools using Playwright, enabling web scraping, testing, and browser interaction through natural language commands.3815MIT
- AlicenseNot gradedqualityNot gradedmaintenanceA server that enables AI assistants to control a browser through tools, allowing them to perform web automation tasks like navigation, typing, clicking, and taking screenshots.Apache 2.0