HomeMCP / ToolingClaude Code に Chrome DevTools for Agents(chrome-devtools-mcp)を繋ぐ実践ガイド
MCP / Tooling ⚠ 古い情報の可能性

Claude Code に Chrome DevTools for Agents(chrome-devtools-mcp)を繋ぐ実践ガイド A hands-on guide to connecting Claude Code to Chrome's DevTools via the chrome-devtools-mc…

元記事を読む 古い情報の可能性
AI 3 行サマリ
  • Chrome DevTools for Agents v1 を使い、Claude Code を MCP サーバー経由で Chrome の DevTools に接続する手順を解説。
  • Lighthouse 監査やデバイスエミュレーション、メモリリーク検出などをエージェントから実行でき、Web 開発のデバッグを自動化できる。
English summary
  • A hands-on guide to connecting Claude Code to Chrome's DevTools via the chrome-devtools-mcp server, letting AI agents run Lighthouse audits, emulate devices, and detect memory leaks to automate web debugging.

Webアプリケーションのデバッグや性能改善は、これまで開発者がブラウザの開発者ツールを手動で操作しながら進めるのが一般的だった。こうした作業をAIエージェントに委ねる動きが、MCP(Model Context Protocol)の普及とともに広がりつつある。今回取り上げる「Chrome DevTools for Agents(chrome-devtools-mcp)」は、AnthropicのコーディングエージェントであるClaude CodeをChromeの開発者ツールにMCPサーバー経由で接続するための実装だ。

MCPは、AIモデルと外部ツールやデータソースを標準化された方法でつなぐためのプロトコルで、Anthropicが2024年に公開した。対応するMCPサーバーを用意すれば、Claude Codeのようなクライアントから一貫したインターフェースで多様な機能を呼び出せる。chrome-devtools-mcpはその一つとして、ブラウザの内部機能をエージェントから操作可能にする位置づけといえる。

具体的には、Lighthouseによるパフォーマンスやアクセシビリティの監査、スマートフォンなどを想定したデバイスエミュレーション、メモリリークの検出といった操作をClaude Codeから指示できるとされる。エージェントが実際にページを読み込み、計測結果を取得して改善案を提示するワークフローが想定され、人間がDevToolsの各タブを行き来する手間を減らせる可能性がある。

Chrome DevTools for Agents v1 を使い、Claude Code を MCP サーバー経由で Chrome の DevTools に接続する手順を解説。
🔗 MCP / Tooling · 本記事のポイント

導入にあたっては、Node.js環境やChromeの実行環境を整え、Claude Code側の設定ファイルにMCPサーバーを登録するのが一般的な手順となる。MCPサーバーはローカルで動作するものが多く、対象ブラウザを制御する都合上、ヘッドレスモードや専用のデバッグポートを利用する構成が採られることが多い。

同種の取り組みとしては、Microsoftが主導するPlaywrightのMCP対応や、ブラウザ操作を自動化する各種エージェント向けツールが登場しており、ブラウザとAIをつなぐ周辺エコシステムは急速に拡大している。一方で、エージェントにブラウザ操作を任せる際は、認証情報や閲覧データの扱いに注意が必要との指摘もある。実際の運用では、対象環境を限定しつつ挙動を確認しながら段階的に導入することが現実的と見られる。

Chrome DevTools for Agents, distributed as the chrome-devtools-mcp package, has reached its v1 release and gives agentic coding tools like Claude Code direct access to a real Chrome instance through the Model Context Protocol (MCP). For developers who already rely on Claude Code for editing and refactoring, this integration matters because it closes a long-standing gap: the assistant can observe how a page actually behaves in a browser rather than reasoning only about static source code.

At a high level, MCP is an open protocol introduced by Anthropic that standardizes how language-model clients talk to external tools and data sources. An MCP server exposes a set of callable tools, and a client such as Claude Code discovers those tools and lets the model invoke them. The chrome-devtools-mcp server fills that role, translating model requests into commands for the Chrome DevTools Protocol (CDP), the same low-level interface that powers the DevTools panel and automation libraries such as Puppeteer and Playwright.

Once connected, the agent gains a set of browser-grade capabilities. It can run Lighthouse audits to measure performance, accessibility, SEO, and best-practice scores, then use the structured results to suggest concrete fixes. It can apply device emulation to reproduce mobile viewports and throttled network conditions, which is useful for diagnosing layout or loading issues that only appear on constrained devices. It can also capture heap snapshots and performance traces, supporting workflows such as memory-leak detection where the agent compares allocations over time. Other typical tools include navigating to URLs, reading console output, inspecting network requests, evaluating JavaScript, and taking screenshots.

Setup follows the standard MCP pattern. Because the server is published to npm, it is commonly launched with npx, so a working Node.js installation is the main prerequisite alongside a local Chrome or Chromium binary. In practice you register the server with Claude Code, either through the claude mcp add command or by editing the client's JSON configuration, pointing it at the chrome-devtools-mcp executable. After Claude Code restarts and discovers the tools, you can prompt it in natural language, for example asking it to audit a running development server or to profile a page that feels slow. The server can drive an existing browser session or start its own, and depending on configuration it may run headless or with a visible window.

The practical workflow tends to be iterative. A developer might ask Claude Code to load a local build, run an audit, and report the largest performance regressions. The agent then reads the results, proposes edits to the codebase, applies them, and re-runs the audit to confirm the change. This loop of observe, change, and verify is where browser-connected agents appear to add the most value, because the model can ground its recommendations in measured data instead of assumptions.

It helps to place this release in a broader context. Browser automation for AI is a crowded and fast-moving area: Playwright ships its own MCP server, and projects such as browser-use and various computer-use agents pursue similar goals of letting models drive a browser. Chrome DevTools for Agents is notable mainly because it surfaces DevTools-specific diagnostics such as Lighthouse, tracing, and heap profiling, rather than focusing only on clicking and typing. That positioning makes it complementary to end-to-end testing tools rather than a direct replacement.

A few caveats are worth keeping in mind. Granting an agent control of a browser means it can navigate to arbitrary pages and execute scripts, so it is prudent to run it against trusted local environments and to review actions before pointing it at sensitive sites or authenticated sessions. Audit results and traces can be large, which may consume significant context tokens if returned verbatim, so well-designed tools typically summarize or paginate output. As with most MCP servers in this period, the project is evolving quickly, so exact tool names, flags, and defaults are likely to shift between versions, and consulting the project's current documentation remains the safest approach.

For teams already standardized on Claude Code, the integration offers a low-friction way to bring real browser feedback into an existing agentic workflow, turning front-end performance and quality checks into something the assistant can run, interpret, and act on directly.

  • SourceZenn MCPT2
  • Source Avg ★ 2.0
  • Typeブログ
  • Importance ★ 通常 (top 99% in MCP / Tooling)
  • Half-life 📘 中期 (チュートリアル)
  • LangJA
  • Collected2026/06/20 12:00

本ページの本文・要約は AI による自動生成です。正確性は元記事 (zenn.dev) をご確認ください。

🔗 MCP / Tooling の他の記事 もっと見る →

URL をコピーしました