Chrome DevTools MCP 是官方的吗?
是的。它由 Google 的 Chrome DevTools 团队发布在 ChromeDevTools GitHub 组织下,npm 包名为 `chrome-devtools-mcp`。
@ChromeDevTools
基本信息
Google 官方的 Chrome DevTools MCP 服务器,让编码智能体能够控制、调试并分析一个真实运行的 Chrome 浏览器。
使用下面的配置,将此服务器添加到你的 MCP 客户端。
{
"mcpServers": {
"chrome-devtools": {
"command": "npx",
"args": [
"-y",
"chrome-devtools-mcp@latest"
]
}
}
}Clicks on the provided element
Drag an element onto another element
Type text into an input, text area or select an option from a <select> element.
Fill out multiple form elements (inputs, selects, checkboxes, radios) at once. ALWAYS prefer this tool over multiple individual 'fill' or 'click' calls when interacting with forms. It is significantly faster, more reliable, and reduces turn count. Example: Fill username, password, and check "Remember Me" in one call.
If a browser dialog was opened, use this command to handle it
Hover over the provided element
Press a key or key combination. Use this when other input methods like fill() cannot be used (e.g., keyboard shortcuts, navigation keys, or special key combinations).
Type text using keyboard into a previously focused input
Upload a file through a provided element.
Clicks at the provided coordinates (requires flag: --experimentalVision=true)
Closes the page by its index. The last open page cannot be closed.
Get a list of pages including extension service workers open in the browser.
Go to a URL, or back, forward, or reload. Use project URL if not specified otherwise.
Open a new tab and load a URL. Use project URL if not specified otherwise.
Select a page as a context for future tool calls.
Wait for the specified text to appear on the selected page.
Emulates various features on the target page. Each call replaces all emulation settings (except extraHttpHeaders), so pass all desired settings in a single call.
Resizes the page's window so that the page has specified dimension
Provides more detailed information on a specific Performance Insight of an insight set that was highlighted in the results of a trace recording.
Start a performance trace on the target webpage. Use to find frontend performance issues, Core Web Vitals (LCP, INP, CLS), and improve page load speed.
Stop the active performance trace recording on the target webpage.
Gets a network request by an optional reqid, if omitted returns the currently selected request in the DevTools Network panel. Useful for inspecting request headers (including 'Cookie') and response headers (including 'Set-Cookie' and directives).
Lists the most recent requests for the target page since the last navigation.
Evaluate JavaScript inside the target page or service worker. The source can be provided inline or loaded from a local file. Returns the response as JSON, so returned values have to be JSON-serializable.
Gets a console message by its ID. You can get all messages by calling list_console_messages.
Retrieve matched CSS rules, inline styles (element.style), inherited styles, custom properties, and cascade wrappers (@layer, @media, @container, @scope) for an element identified by its UID.
Get Lighthouse scores, failing audits, and the DOM nodes they flag for accessibility, SEO, best practices, and agentic browsing. Full reports are saved to disk. This excludes performance. For performance audits, run performance_start_trace
List all console messages for the target page since the last navigation. This includes console messages originating from extensions content scripts.
Starts recording a screencast (video) of the target page.
Stops the active screencast recording on the target page.
Take a screenshot of the page or element.
Take a text snapshot of the target page based on the a11y tree. The snapshot lists page elements along with a unique
Capture a heap snapshot of the target page. Use to analyze the memory distribution of JavaScript objects and debug memory leaks.
Loads and caches a memory heapsnapshot to identify and rank closure contexts holding dead captured fields—variables no remaining live closure can read. Scopes are ranked globally by the retained size of these dead values to provide a prioritizing heuristic, rather than an exact measure of reclaimable bytes. (requires flag: --memoryDebugging=true)
Closes a previously loaded and cached memory heapsnapshot, freeing its memory. (requires flag: --memoryDebugging=true)
Loads and caches two memory heapsnapshots and returns the comparison. If classIndex is provided, returns detailed diff for that class, otherwise returns summary diff. (requires flag: --memoryDebugging=true)
Loads and caches a memory heapsnapshot and returns instances of a specific class with their IDs. (requires flag: --memoryDebugging=true)
Loads and caches a memory heapsnapshot and returns all available information including statistics, static data, and aggregated node information. Supports pagination for aggregates. (requires flag: --memoryDebugging=true)
Loads and caches a memory heapsnapshot and returns the dominator chain for a specific node ID. This helps to identify which objects are keeping the target node alive. (requires flag: --memoryDebugging=true)
Loads and caches a memory heapsnapshot and returns duplicate strings grouped by their value. (requires flag: --memoryDebugging=true)
Loads and caches a memory heapsnapshot and returns outgoing edges (references) for a specific node ID. (requires flag: --memoryDebugging=true)
Loads and caches a memory heapsnapshot and returns detailed information about a specific object by its node ID, including size, type, distance, and DOM detachedness. (requires flag: --memoryDebugging=true)
Loads and caches a memory heapsnapshot and returns retainers for a specific node ID. (requires flag: --memoryDebugging=true)
Loads and caches a memory heapsnapshot and returns retaining paths for a specific node ID. This helps to understand why a node is not being garbage collected. (requires flag: --memoryDebugging=true)
Loads and caches a memory heapsnapshot and returns snapshot summary stats, including native contexts and their sizes, and retained by context summary. (requires flag: --memoryDebugging=true)
Loads and caches a memory heapsnapshot and queries objects matching specific filters (className, propertyName, nodeType, retainedSize, selfSize, isDetached, sortBy). (requires flag: --memoryDebugging=true)
Installs a Chrome extension from the given path. (requires flag: --categoryExtensions=true)
Lists all the Chrome extensions installed in the browser. This includes their name, ID, version, and enabled status. (requires flag: --categoryExtensions=true)
Reloads an unpacked Chrome extension by its ID. (requires flag: --categoryExtensions=true)
Triggers the default action of an extension by its ID. (requires flag: --categoryExtensions=true)
Uninstalls a Chrome extension by its ID. (requires flag: --categoryExtensions=true)
Executes a third-party developer tool exposed by the page. (requires flag: --categoryExperimentalThirdParty=true)
Lists all third-party developer tools the page exposes for providing runtime information (including debugging WebMCP tools and tools exposed via the 'devtoolstooldiscovery' event).
Executes a WebMCP tool exposed by the page (for debugging tools, use 'execute_3p_developer_tool'). (requires flag: --categoryExperimentalWebmcp=true)
Lists all WebMCP tools the page exposes (excluding debugging tools, which are exposed via 'list_3p_developer_tools'). (requires flag: --categoryExperimentalWebmcp=true)
Returns the OS integration state (badge count and registered file handlers) for an installed web app, identified by its manifest ID. (requires flag: --categoryPwa=true)
Installs a Progressive Web App (PWA) identified by its manifest ID. This installs through the PWA CDP domain without a user gesture or install dialog. DevTools installs default to browser display mode. (requires flag: --categoryPwa=true)
Launches an installed Progressive Web App using its saved display mode. Optionally opens a specific URL within the same app instead of the default start URL. (requires flag: --categoryPwa=true)
Uninstalls a Progressive Web App identified by its manifest ID and closes any open app windows. (requires flag: --categoryPwa=true)
Chrome DevTools MCP 是 Google 官方的 MCP 服务器(chrome-devtools-mcp),让 Claude、Cursor、Copilot、Gemini 等编码智能体能够控制并检查一个真实运行的 Chrome 浏览器,用于自动化、调试和性能分析。
该项目由 Chrome DevTools 团队在 ChromeDevTools/chrome-devtools-mcp 仓库中维护,采用 Apache-2.0 许可证。它使用 Puppeteer 驱动 Chrome,并借助 DevTools 前端录制 trace、提取性能洞察。它通过 stdio 在本地运行,免费使用,无需 API key。项目还提供了一个无需 MCP 即可使用的 CLI。
前置条件:
^20.19.0 || ^22.12.0 || >=23)在 MCP 客户端中添加标准配置:
{
"mcpServers": {
"chrome-devtools": {
"command": "npx",
"args": ["-y", "chrome-devtools-mcp@latest"]
}
}
}
如果只需要基础浏览器任务,可以使用 slim 模式,它只暴露 3 个工具(导航、脚本执行和截图):
"args": ["-y", "chrome-devtools-mcp@latest", "--slim", "--headless"]
当某个工具首次需要浏览器时,服务器会自动启动 Chrome。可以用提示词 “Check the performance of https://developers.chrome.com” 来验证配置是否生效。
只安装 MCP 服务器:
claude mcp add chrome-devtools --scope user npx chrome-devtools-mcp@latest
或者以插件方式安装,同时包含 MCP 服务器和 skills:
/plugin marketplace add ChromeDevTools/chrome-devtools-mcp
/plugin install chrome-devtools-mcp@chrome-devtools-plugins
安装后重启 Claude Code。如果之前手动安装过,请先将其移除。
官方客户端指南没有单独列出 Claude Desktop。它的 claude_desktop_config.json 使用同样的 mcpServers 格式,因此粘贴上面的标准配置并重启应用即可。
使用 README 中的一键安装按钮,或者进入 Cursor Settings -> MCP -> New MCP Server,填入标准配置。
推荐以智能体插件方式安装:打开命令面板,运行 Chat: Install Plugin From Source,粘贴 ChromeDevTools/chrome-devtools-mcp。如果只想在 macOS 或 Linux 上添加 MCP 服务器:
code --add-mcp '{"name":"io.github.ChromeDevTools/chrome-devtools-mcp","command":"npx","args":["-y","chrome-devtools-mcp"],"env":{}}'
codex mcp add chrome-devtools -- npx chrome-devtools-mcp@latest
官方客户端指南还覆盖了 Gemini CLI(gemini mcp add chrome-devtools npx chrome-devtools-mcp@latest)、Windsurf、Cline、JetBrains、Kiro、Warp、OpenCode 等客户端。
默认情况下,服务器会使用专用配置文件启动一个新的 Chrome 实例。如果要复用已经登录的浏览器,可以在 chrome://inspect/#remote-debugging 开启远程调试(Chrome 144+)并添加 --autoConnect;或者以调试端口启动 Chrome,并传入 --browser-url=http://127.0.0.1:9222。
--slim、--headless、--isolated、按类别开关工具,以及 URL 允许/阻止列表。click、fill、fill_form、type_text、press_key、hover、drag、upload_file 和 handle_dialog,作用于页面快照中标识出的元素。new_page、navigate_page、list_pages、select_page、close_page 和 wait_for,用于管理标签页和页面加载。performance_start_trace、performance_stop_trace 和 performance_analyze_insight,录制 trace 并深入分析单个洞察。list_network_requests、get_network_request、list_console_messages、evaluate_script、get_css_styles、lighthouse_audit、take_screenshot 和 take_snapshot。emulate 和 resize_page。take_heapsnapshot;更深入的堆分析工具需要 --memoryDebugging=true。--categoryExtensions=true)、渐进式 Web 应用工具(--categoryPwa=true)以及实验性的 WebMCP 工具。--autoConnect 连接到你自己的 Chrome。npx chrome-devtools-mcp@latest --help,并确认客户端使用的 Node 和 npm 版本与终端一致。ERR_MODULE_NOT_FOUND:通常是 Node 版本不受支持或 npx 缓存损坏。运行 rm -rf ~/.npm/_npx 和 npm cache clean --force 清理缓存后重新安装。Target closed 错误:浏览器无法启动。关闭正在运行的 Chrome 实例,并安装最新稳定版 Chrome。"command": "cmd",并设置 "args": ["/c", "npx", "-y", "chrome-devtools-mcp@latest"],或者指向 npx 的绝对路径。是的。它由 Google 的 Chrome DevTools 团队发布在 ChromeDevTools GitHub 组织下,npm 包名为 `chrome-devtools-mcp`。
免费。它以 Apache-2.0 许可证开源,不需要账号或 API key,只需要 Node.js 和 Chrome。
可以。官方客户端指南提供了 Claude Code、Cursor、VS Code/Copilot、Codex、Gemini CLI、Windsurf 以及许多其他客户端的配置步骤。
可以。在 `chrome://inspect/#remote-debugging` 开启远程调试(Chrome 144+),并用 `--autoConnect` 启动服务器;或者通过 `--browser-url` 连接到调试端口。
Google 默认收集使用统计,可用 `--no-usage-statistics` 关闭。性能工具可能会把 trace 的 URL 发送到 CrUX API 获取真实用户数据,可用 `--no-performance-crux` 关闭。
服务器会把浏览器中的内容暴露给 MCP 客户端,因此请避免涉及敏感数据。可以用 `--isolated` 使用临时配置文件,用 URL 允许/阻止规则限制访问范围,并用 `--javascriptEvaluation=false` 关闭脚本执行类工具。
官方只支持 Google Chrome 和 Chrome for Testing。其他 Chromium 内核浏览器可能可用,但不保证。
可以。在 args 中添加 `--headless`,也可以配合 `--viewport` 设置窗口尺寸。
Monitor browser logs directly from Cursor and other MCP compatible IDEs.
Fast, lightweight Firecrawl/Tavily alternative in Rust. Web scraper, crawler & search API with MCP server for AI agents. Drop-in Firecrawl-compatible API (/scrape, /crawl, /search). 2.3x faster than Tavily, 1.5x faster than Firecrawl in 1K-URL benchmarks. 6 MB RAM, single binary.
Give your AI agent the live web. One MCP server for Search, Fetch, Browser, and Agent: browse real sites, extract structured data, fill forms, and run multi-step workflows. Search and Fetch are free.
MCP server for fetch web page content using Playwright headless browser.
评论