# Playwright日志监控
## 基本信息
- Slug: `operative-sh-playwright-consolelogs-mcp`
- Source: modelscope
- Publisher: @Operative-Sh/playwright-consolelogs-mcp
- Categories: browser-automation / monitoring
- Hosted: No
- License: Unknown
- Source URL: https://www.modelscope.cn/mcp/servers/@Operative-Sh/playwright-consolelogs-mcp
## 简介
打开一个浏览器，用于监控和检索控制台日志和网络请求，向大型语言模型（LLMs）提供有关网页行为的结构化数据。
## MCP Server 详情

# 控制台和网络日志 Playwright MCP 服务器

[![smithery 徽章](https://smithery.ai/badge/@Lumeva-AI/playwright-consolelogs-mcp)](https://smithery.ai/server/@Lumeva-AI/playwright-consolelogs-mcp)

此 MCP（模型上下文协议）服务器使用 Playwright 打开浏览器、监控控制台日志并跟踪网络请求。它将这些功能作为工具暴露出来，供 MCP 客户端使用。

## 功能

- 在指定的 URL 打开浏览器
- 监控并检索控制台日志
- 跟踪并检索网络请求
- 完成后关闭浏览器

## 要求

- Python 3.8+
- Playwright
- 模型上下文协议 (MCP) Python SDK

## 在 Claude 中安装

编辑文件：
`~/Library/Application\ Support/Claude/claude_desktop_config.json`

添加以下内容：

```json
"playwright": {
   "command": "/Users/christophersettles/.local/bin/uv",
   "args": [
      "--directory",
      "/ABSOLUTE/PATH/TO/playwrightdebugger/",
      "run",
      "mcp_playwright.py"
   ]
}
```


（将 `/ABSOLUTE/PATH/TO/playwrightdebugger/` 替换为你克隆仓库的绝对路径）

## 命令

打开 localhost:3000/dashboard 并查看控制台日志和网络请求

关闭浏览器

## 工作原理

服务器使用 Playwright 的事件监听器来捕获控制台消息和网络活动。当客户端请求这些信息时，服务器会以结构化的格式返回这些信息，以便 LLM 使用。

