
A Model Context Protocol (MCP) server for controlling Chrome with debugging capabilities, userscript injection, and extension support.

基于 FastMCP 框架的浏览器自动化 MCP 服务器,为 LLM 应用提供网页交互与数据提取能力。
Playwright MCP Server is cataloged as an MCP server attributed to ma-pony. 基于 FastMCP 框架的浏览器自动化 MCP 服务器,为 LLM 应用提供网页交互与数据提取能力。 It is categorized under browser automation. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.
Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.
Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.
能力定义尚未审核。未核验的采集内容不会作为可信接口展示。
暂无可展示的已审核记录。这不表示上游不支持此能力。
暂无可展示的已审核记录。这不表示上游不支持此能力。
暂无可展示的已审核记录。这不表示上游不支持此能力。
Email delivery is not connected. This page does not collect email addresses or create subscriptions.
Browse the registry for current listings instead.
Reviews for Playwright MCP Server are not available yet
Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.
支持 Chromium、Firefox 和 WebKit 三种浏览器引擎。
提供独立的浏览器会话支持并发操作,并将最大会话数默认限制为 10。
提供 session://status 会话状态、browser://health 健康检查和 help://tools 工具帮助资源。
README.md · 0c85be489bd6 · 采集于 2026-11-13 12:52:39 UTC
保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。
当前显示最后一次成功采集的文档快照,请以来源页面为准。
一个基于 FastMCP 框架的专业级 Playwright 浏览器自动化 MCP 服务器,为 LLM 应用提供强大的网页交互和数据提取能力。
# 从 PyPI 安装(推荐)
pip install mcp-playwright
# 或使用 uv
uv add mcp-playwright
# 安装 Playwright 浏览器
playwright install
# 开发安装(从源码)
git clone https://github.com/ma-pony/mcp-playwright.git
cd mcp-playwright
# 使用 uv 安装依赖(推荐)
uv sync
# 或使用 pip
pip install -e .
# 安装 Playwright 浏览器
uv run playwright install
# 或
playwright install
# 使用已安装的包
mcp-playwright
# 或从源码运行
python main.py
# 或使用 uv
uv run python main.py
# 使用 MCP 开发工具
uv run mcp dev main.py
将以下配置添加到 Claude Desktop 的 MCP 配置文件中:
{
"mcpServers": {
"playwright": {
"command": "mcp-playwright"
}
}
}
或者如果从源码运行:
{
"mcpServers": {
"playwright": {
"command": "uv",
"args": ["run", "python", "/path/to/mcp-playwright/main.py"],
"env": {}
}
}
}
# 使用 create_browser_session 工具
await create_browser_session(
browser_type="chromium",
headless=True,
viewport_width=1280,
viewport_height=720
)
await navigate_to_url("https://example.com")
# 点击元素
await click_element("#login-button")
# 填写表单
await fill_input("#username", "your-username")
await fill_input("#password", "your-password")
# 等待元素
await wait_for_selector(".dashboard", state="visible")
# 获取文本内容
title = await get_page_title()
content = await get_text_content(".main-content")
# 获取属性值
href = await get_element_attribute("a.download", "href")
# 截取页面截图
screenshot = await take_screenshot(full_page=True)
# 执行 JavaScript
result = await execute_javascript("return document.readyState")
await close_browser_session()
所有工具都内置了完善的错误处理,会返回详细的错误信息:
# 如果元素不存在或超时,会返回描述性错误信息
result = await click_element("#non-existent", timeout=5000)
# 返回: "点击超时: #non-existent"
# 检查会话状态
status = await get_resource("session://status")
# 检查浏览器健康状态
health = await get_resource("browser://health")
┌─────────────────────────────────────────────┐
│ Playwright MCP 服务器 │
│ ┌─────────────┬─────────────┬─────────────┐ │
│ │ 会话管理 │ 工具层 │ 资源层 │ │
│ └─────────────┴─────────────┴─────────────┘ │
├─────────────────────────────────────────────┤
│ Playwright 管理器 │
│ ┌─────────────┬─────────────┬─────────────┐ │
│ │ 浏览器池 │ 页面管理 │ 生命周期 │ │
│ └─────────────┴─────────────┴─────────────┘ │
└─────────────────────────────────────────────┘
详细架构说明请参阅 TECHNICAL_ARCHITECTURE.md
create_browser_session - 创建新的浏览器会话close_browser_session - 关闭当前浏览器会话navigate_to_url - 导航到指定URLclick_element - 点击页面元素fill_input - 填写输入框wait_for_selector - 等待元素出现get_text_content - 获取元素文本内容get_element_attribute - 获取元素属性值get_page_title - 获取页面标题get_page_url - 获取当前页面URLtake_screenshot - 截取页面截图execute_javascript - 执行JavaScript代码session://status - 当前会话状态browser://health - 浏览器健康检查help://tools - 工具使用帮助browser_type: 浏览器类型(chromium, firefox, webkit)headless: 无头模式(默认: true)max_sessions: 最大会话数(默认: 10)default_timeout: 默认超时时间(默认: 30000ms)viewport_width: 视口宽度(默认: 1280)viewport_height: 视口高度(默认: 720)# 运行单元测试
uv run pytest tests/
# 运行特定测试
uv run pytest tests/test_browser_manager.py
# 运行集成测试
uv run pytest tests/integration/
欢迎贡献代码!请遵循以下步骤:
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)# 克隆你的 fork
git clone https://github.com/your-username/mcp-playwright.git
# 安装开发依赖
uv sync --dev
# 运行代码格式化
uv run black .
uv run isort .
# 运行类型检查
uv run mypy .
本项目采用 MIT 许可证 - 详情请参阅 LICENSE 文件。
如果您有任何问题或需要帮助:
Playwright MCP Server - 为 LLM 应用提供强大的浏览器自动化能力 🚀
Claim this server with your GitHub account to request manual ownership verification.
Link to the catalog listing for Playwright MCP Server from your README. This badge does not certify ownership, compatibility or security.
[](https://awesome-mcp.com/servers/mcp-playwright-ma-pony)Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.
来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。
尚无已审核的包 / 镜像标识,暂不展示下载统计。
Alternative and complementary servers in the same category

A Model Context Protocol (MCP) server for controlling Chrome with debugging capabilities, userscript injection, and extension support.

An MCP server that lets AI assistants browse websites and extract content using optional CSS selectors.

An MCP server that reads pages, fills forms, takes screenshots, and hands the browser to a person for logins or CAPTCHAs.