ChromeDevTools / chrome-devtools-mcp
ChromeDevTools / chrome-devtools-mcp
Chrome DevTools for Agents (chrome-devtools-mcp) lets your coding agent (such as Gemini, Claude, Cursor or Copilot) control and inspect a live Chrome browser. It acts as a Model-Context-Protocol (MCP) server, giving your AI coding assistant access to the full power of Chrome DevTools for reliable automation, in-depth debugging, and performance analysis. A CLI is also provided for use without MCP. Chrome DevTools for Agents (chrome-devtools-mcp) 让你的编程智能体(如 Gemini、Claude、Cursor 或 Copilot)能够控制并检查实时运行的 Chrome 浏览器。它作为一个模型上下文协议(MCP)服务器运行,使你的 AI 编程助手能够利用 Chrome DevTools 的强大功能,进行可靠的自动化操作、深度调试和性能分析。此外,它还提供了一个无需 MCP 即可使用的 CLI 工具。
Key features
核心功能
- Get performance insights: Uses Chrome DevTools to record traces and extract actionable performance insights. 获取性能洞察: 使用 Chrome DevTools 记录追踪信息并提取可操作的性能洞察。
- Advanced browser debugging: Analyze network requests, take screenshots and check browser console messages (with source-mapped stack traces). 高级浏览器调试: 分析网络请求、截取屏幕截图并检查浏览器控制台消息(支持源映射堆栈跟踪)。
- Reliable automation: Uses puppeteer to automate actions in Chrome and automatically wait for action results. 可靠的自动化: 使用 Puppeteer 在 Chrome 中自动执行操作,并自动等待操作结果。
Disclaimers
免责声明
chrome-devtools-mcp exposes content of the browser instance to the MCP clients allowing them to inspect, debug, and modify any data in the browser or DevTools. Avoid sharing sensitive or personal information that you don’t want to share with MCP clients. chrome-devtools-mcp 会将浏览器实例的内容暴露给 MCP 客户端,允许它们检查、调试和修改浏览器或 DevTools 中的任何数据。请避免分享你不希望与 MCP 客户端共享的敏感或个人信息。
chrome-devtools-mcp officially supports Google Chrome and Chrome for Testing only. Other Chromium-based browsers may work, but this is not guaranteed, and you may encounter unexpected behavior. Use at your own discretion. We are committed to providing fixes and support for the latest version of Extended Stable Chrome. chrome-devtools-mcp 仅官方支持 Google Chrome 和 Chrome for Testing。其他基于 Chromium 的浏览器可能可以使用,但不作保证,且可能会遇到意外行为。请自行斟酌使用。我们致力于为最新版本的 Extended Stable Chrome 提供修复和支持。
Performance tools may send trace URLs to the Google CrUX API to fetch real-user experience data. This helps provide a holistic performance picture by presenting field data alongside lab data. This data is collected by the Chrome User Experience Report (CrUX). To disable this, run with the --no-performance-crux flag.
性能工具可能会将追踪 URL 发送到 Google CrUX API 以获取真实用户体验数据。通过将现场数据与实验室数据结合展示,这有助于提供全面的性能图景。这些数据由 Chrome 用户体验报告 (CrUX) 收集。如需禁用此功能,请在运行时添加 --no-performance-crux 标志。
Usage statistics
使用统计
Google collects usage statistics (such as tool invocation success rates, latency, and environment information) to improve the reliability and performance of Chrome DevTools MCP. Data collection is enabled by default. You can opt-out by passing the --no-usage-statistics flag when starting the server: "args": ["-y", "chrome-devtools-mcp@latest", "--no-usage-statistics"]
Google 会收集使用统计信息(如工具调用成功率、延迟和环境信息)以提高 Chrome DevTools MCP 的可靠性和性能。数据收集默认开启。你可以通过在启动服务器时传递 --no-usage-statistics 标志来选择退出:"args": ["-y", "chrome-devtools-mcp@latest", "--no-usage-statistics"]
Google handles this data in accordance with the Google Privacy Policy. Google’s collection of usage statistics for Chrome DevTools MCP is independent from the Chrome browser’s usage statistics. Opting out of Chrome metrics does not automatically opt you out of this tool, and vice-versa. Collection is disabled if CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS or CI env variables are set.
Google 根据《Google 隐私政策》处理这些数据。Google 对 Chrome DevTools MCP 的使用统计收集与 Chrome 浏览器的使用统计是相互独立的。退出 Chrome 指标收集并不会自动让你退出此工具的统计收集,反之亦然。如果设置了 CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS 或 CI 环境变量,则会禁用数据收集。
Update checks
更新检查
By default, the server periodically checks the npm registry for updates and logs a notification when a newer version is available. You can disable these update checks by setting the CHROME_DEVTOOLS_MCP_NO_UPDATE_CHECKS environment variable.
默认情况下,服务器会定期检查 npm 注册表以获取更新,并在有新版本可用时记录通知。你可以通过设置 CHROME_DEVTOOLS_MCP_NO_UPDATE_CHECKS 环境变量来禁用这些更新检查。
Requirements
系统要求
- Node.js v20.19 or a newer latest maintenance LTS version. Node.js v20.19 或更新的最新维护版 LTS 版本。
- Chrome current stable version or newer. Chrome 当前稳定版或更新版本。
Getting started
快速入门
Add the following config to your MCP client: 将以下配置添加到你的 MCP 客户端:
{
"mcpServers": {
"chrome-devtools": {
"command": "npx",
"args": ["-y", "chrome-devtools-mcp@latest"]
}
}
}
Note: Using chrome-devtools-mcp@latest ensures that your MCP client will always use the latest version of the Chrome DevTools MCP server. If you are interested in doing only basic browser tasks, use the --slim mode.
注意: 使用 chrome-devtools-mcp@latest 可确保你的 MCP 客户端始终使用最新版本的 Chrome DevTools MCP 服务器。如果你只需要执行基本的浏览器任务,请使用 --slim 模式。