让你的编码代理使用 Chrome DevTools MCP 调试浏览器会话。
Chrome DevTools MCP

原始链接: https://developer.chrome.com/blog/chrome-devtools-mcp-debug-your-browser-session

## Chrome DevTools 现在集成编码代理 Chrome DevTools 的一项新增强功能(通过 Chrome M144 的 Beta 版本提供)允许编码代理直接连接并与*活动*浏览器会话交互。 这简化了调试过程,使代理能够重用现有登录信息,并在 DevTools 中访问实时调试信息——例如调查失败的网络请求或选定的元素。 该功能通过请求远程调试访问来实现,这需要通过 Chrome 对话框获得明确的用户权限,并显示一个指示自动控制的横幅。 用户必须首先在 `chrome://inspect/#remote-debugging` 中启用远程调试,并使用 `--autoConnect` 选项配置 Chrome DevTools MCP 服务器。 这种集成促进了手动和 AI 辅助调试之间的无缝过渡。 用户可以先自行调查问题,然后将其交给编码代理解决,选择特定元素或请求进行重点分析。 这只是第一步,未来计划向编码代理公开更多 DevTools 面板数据。

## Chrome开发者工具现已对AI代理开放 新的Chrome开发者工具MCP(消息通信协议)API允许AI代理直接调试浏览器会话,引发了Hacker News上的讨论。虽然Chrome已经有开发者工具API,但这个新版本的设计更便于AI使用。 用户对“巨大的工作流程优势”感到兴奋,特别是状态持久化功能——消除了调试时重新认证或重新填充会话的需要。一位用户重点介绍了预构建的代理技能([https://github.com/pasky/chrome-cdp-skill](https://github.com/pasky/chrome-cdp-skill)),用于自动化音乐库管理等任务。 然而,也存在安全方面的担忧,特别是提示注入可能导致未经授权的访问的风险。用户建议使用专用、隔离的Chrome配置文件等缓解策略。这个新API也与`agent-browser` ([https://github.com/vercel-labs/agent-browser](https://github.com/vercel-labs/agent-browser))等工具集成良好。
相关文章

原文

Published: December 11, 2025

We shipped an enhancement to the Chrome DevTools MCP server that many of our users have been asking for: the ability for coding agents to directly connect to active browser sessions.

With this enhancement, coding agents are able to:

  1. Re-use an existing browser session: Imagine you want your coding agent to fix an issue that is gated behind a sign-in. Your coding agent can now directly access your current browsing session not requiring an additional sign-in.
  2. Access active debugging sessions: Coding agents can now access an active debugging session in the DevTools UI. For example, when you discover a failing network request in the Chrome DevTools network panel, select the request and ask your coding agent to investigate it. The same also works with elements selected in the Elements panel. We are excited about this new ability to seamlessly transition between manual and AI-assisted debugging.

See it in action:

The auto connection feature is an addition to the existing ways for the Chrome DevTools MCP to connect to a Chrome instance. Note that you can still:

  • Run Chrome with a Chrome DevTools MCP server-specific user profile (current default).
  • Connect to a running Chrome instance with a remote debug port.
  • Run multiple Chrome instances in isolation with each instance running in a temporary profile.

How it works

We've added a new feature to Chrome M144 (currently in Beta) that allows the Chrome DevTools MCP server to request a remote debugging connection. This new flow builds on top of the existing remote debugging capabilities of Chrome. By default, remote debugging connections are disabled in Chrome. Developers have to explicitly enable the feature first by going to chrome://inspect#remote-debugging.

When the Chrome DevTools MCP server is configured with the --autoConnect option, the MCP server will connect to an active Chrome instance and request a remote debugging session. To avoid misuse by malicious actors, every time the Chrome DevTools MCP server requests a remote debugging session, Chrome will show a dialog to the user and ask for their permission to allow the remote debugging session. In addition to that, while a debugging session is active, Chrome displays the "Chrome is being controlled by automated test software" banner at the top.

Remote debugging flow: First enable the remote debugging features. Then confirm a remote debug connection request. The debug session will be indicated by a banner text.
The new remote debugging flow and UI in Chrome.

Get started

To use the new remote debugging capabilities. You have to first enable remote debugging in Chrome and then configure the Chrome DevTools MCP server to use the new auto connection feature.

Step 1: Set up remote debugging in Chrome

In Chrome (>=144), do the following to set up remote debugging:

  1. Navigate to chrome://inspect/#remote-debugging to enable remote debugging.
  2. Follow the dialog UI to allow or disallow incoming debugging connections.
Screenshot showing how to enable remote debugging in Chrome
Remote debugging needs to be enabled, before clients can request a remote debugging connection.

Step 2: Configure Chrome DevTools MCP server to automatically connect to a running Chrome Instance

To connect the chrome-devtools-mcp server to the running Chrome instance, use --autoConnect command line argument for the MCP server set.

The following code snippet is an example configuration for gemini-cli:

{
   "mcpServers": {
    "chrome-devtools": {
      "command": "npx",
      "args": [
        "chrome-devtools-mcp@latest",
        "--autoConnect",
        "--channel=beta"
      ]
    }
  }
}

Step 3: Test your setup

Now open gemini-cli and run the following prompt:

Check the performance of https://developers.chrome.com

The Chrome DevTools MCP server will try to connect to your running Chrome instance. It shows a dialog asking for user permission:

Chrome dialog asking the user to enable a remote debugging session.
Chrome asking for user permission to start a remote debugging session.

Clicking Allow results in the Chrome DevTools MCP server opening developers.chrome.com and taking a performance trace.

For full instructions, check out the README on GitHub.

Let your coding agent take over your debugging session

Being able to connect to a live Chrome instance means you don't have to choose between automation and manual control. You can use DevTools yourself or hand over a debugging task to your coding agent. If you discover a problem on your website, you can open DevTools to take a look to identify the element that's causing the issue. If you want your coding agent to fix the issue, you can now do so with Chrome DevTools MCP Server. You can select the element in the Elements panel and ask the coding agent to investigate the issue.

The same also works for the Network panel. You can select a network request and ask your coding agent to investigate it.

But this is just a first step. We plan to incrementally expose more and more panel data to coding agents through the Chrome DevTools MCP Server. Stay tuned!

联系我们 contact @ memedata.com