Token导航 LogoToken导航TokenDH.com
Playwright Debug MCP logo
开发工具stdio官方级别未说明来源级核验

Playwright Debug MCP

MCP Server

playwright

一款基于Playwright和Claude的React应用调试工具,提供DOM检查、网络监控、React组件调试等功能,支持通过自然语言交互进行调试。

工具数

0

提示词数

0

GitHub Stars

1

资源数

0
开发工具TypeScriptClaude浏览器自动化Claude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

Lars-Albinsson

提供方

Lars-Albinsson

最后核验

2026/5/17 20:20

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

npx playwright install chromium

详细介绍

剧作家React调试MCP

](https://www.npmjs.com/package/playwright-react-debug-mcp) ![License: MIT](https://opensource.org/licenses/MIT) ](https://nodejs.org/)

使用Claude和Playwright在人工智能的帮助下调试React应用程序。

A. 模型上下文协议 (MCP)服务器,使Claude能够通过浏览器与实时web应用程序进行交互。导航页面、检查DOM、监视网络请求、调试React组件和分析错误——所有这些都是通过自然对话完成的。

______________________________________________________________________

为什么使用这个?

传统调试使用Playwright React调试MCP
手动重现问题“导航到/仪表板并检查错误”
截图并粘贴到聊天中克劳德看到实时页面并直接互动
复制粘贴控制台错误自动捕获控制台日志
手动打开React DevToolsClaude使用state/props查询组件树
检查“网络”选项卡是否存在故障所有HTTP流量都被监控和分析

______________________________________________________________________

特性

  • 40个调试工具 跨越10个类别
  • 浏览器控件 -导航、单击、填写表单、自动化用户流
  • DOM检查 -元素细节、计算样式、文本提取
  • 网络监控 -请求/响应正文、标头、时间
  • 控制台捕获 -错误、警告、带过滤的日志
  • React工具 -组件树、道具、状态、钩子检查
  • 状态管理 -Redux、Zustand、React查询、上下文检查
  • 演出 -渲染跟踪、慢速组件、Web重要信息
  • 错误检测 -水合错误、错误边界、内存泄漏
  • 无障碍 -WCAG风格审计、ARIA树检查
  • 误差分析 -基于人工智能的分析,并提出修复建议

______________________________________________________________________

快速开始

安装

npm install -g playwright-react-debug-mcp
npx playwright install chromium

配置Claude桌面

添加到 ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "playwright-debug": {
      "command": "npx",
      "args": ["playwright-react-debug-mcp"]
    }
  }
}

配置Claude代码

添加到您的项目 .mcp.json:

{
  "mcpServers": {
    "playwright-debug": {
      "command": "npx",
      "args": ["playwright-react-debug-mcp"],
      "transport": "stdio"
    }
  }
}

试试看

You: Navigate to https://example.com and take a screenshot

Claude: I'll navigate to the page and capture a screenshot.
[Browser opens, navigates, returns screenshot]

Done! The page shows...

______________________________________________________________________

示例会话

You: Navigate to my app at localhost:3000/login and try logging in
     with test@example.com

Claude: I'll navigate to the login page and fill in the credentials.

[Navigates, fills email/password, clicks submit]

The login failed. Let me check what happened:

- Console: "TypeError: Cannot read property 'token' of undefined"
- Network: POST /api/auth returned 200 but body is empty
- React: AuthProvider shows { isAuthenticated: false, error: null }

The API returns 200 without a token. The frontend expects response.data.token
but data is undefined. The error state isn't being set because the HTTP
status was 200.

Suggestions:
1. Backend should return { data: { token: "..." } } or proper error status
2. Frontend should validate response structure, not just HTTP status

______________________________________________________________________

可用工具

导航与交互(11个工具)

工具说明
navigate导航到具有等待条件的URL
click点击元素(左/右/双)
fill填写表单字段
select选择下拉选项
type逐个字符键入文本
hover将鼠标悬停在元素上
scroll滚动页面或元素进入视图
wait_for等待元素/导航
go_back浏览器返回
go_forward浏览器转发
reload重新加载页面

检查(3个工具)

工具说明
get_domDOM树摘要
get_element元素细节与风格
get_text_content提取可见文本

网络(3个工具)

工具说明
get_network使用筛选查看请求
get_request_detail完整的请求/响应详细信息
clear_network清除捕获的请求

控制台(2个工具)

工具说明
get_console通过筛选查看日志
clear_console清除捕获的日志

React(4个工具)

工具说明
get_react_tree带钩子的组件树
find_component按名称搜索组件
get_component_state详细状态/道具
collect_component_instances组件的所有实例

状态管理(4个工具)

工具说明
get_redux_state冗余存储状态+操作
get_zustand_stores状态 store inspection
get_react_query_cacheReact查询缓存
get_context_valuesReact上下文值

性能(3个工具)

工具说明
get_render_count组件渲染跟踪
get_slow_components组件检测缓慢
get_web_vitals核心网络生命体征(LCP、CLS等)

错误检测(3个工具)

工具说明
find_hydration_errorsSSR水合不匹配
get_error_boundariesReact错误边界
detect_memory_leaks内存泄漏指示器

可访问性(2个工具)

工具说明
run_accessibility_auditWCAG式审计
get_aria_tree可访问性树

高级(5个工具)

工具说明
screenshot捕获页面或元素
evaluate_js执行JavaScript
explain_errorAI错误分析
get_debug_summary页面状态概述

______________________________________________________________________

用例

交互式调试

What errors are on this page?
Why did the form submission fail?

自动化测试

Fill the registration form and verify it submits successfully
Click through the checkout flow and check for errors

React开发

Find the UserProfile component and show its state
What props are being passed to the Modal?
Collect all Button instances and compare their usage

API集成

What requests were made when I clicked submit?
Show me the response from the failed API call

______________________________________________________________________

配置

环境变量

变量默认值描述
MAX_CONSOLE_ENTRIES100控制台日志缓冲区大小
MAX_NETWORK_ENTRIES100网络请求缓冲区大小
PLAYWRIGHT_HEADLESSfalse无头运行浏览器
{
  "mcpServers": {
    "playwright-debug": {
      "command": "npx",
      "args": ["playwright-react-debug-mcp"],
      "env": {
        "PLAYWRIGHT_HEADLESS": "true"
      }
    }
  }
}

______________________________________________________________________

发展

# Clone
git clone https://github.com/Lars-Albinsson/playwright-react-debug-mcp
cd playwright-react-debug-mcp

# Install
npm install
npx playwright install chromium

# Build
npm run build

# Run
npm start

# Watch mode
npm run dev

______________________________________________________________________

文档

______________________________________________________________________

需求

  • Node.js 18+
  • 剧作家(铬)
  • 克劳德桌面或克劳德代码

______________________________________________________________________

贡献

欢迎投稿!看 贡献.md 作为指导方针。

______________________________________________________________________

许可证

MIT许可证-请参阅 许可证 了解详情。

______________________________________________________________________

相关

目录标签

目录标签

开发工具TypeScriptClaude浏览器自动化React调试本地部署自动化测试前端开发AI辅助调试

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

token

运行时(runtime,运行环境)

Node.js

来源包(packageName,安装包名)

playwright

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiotoken部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP