0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

2026年7月1日時点の情報です

この記事では、CodexでWebMCPを有効化する際に詰まった点と、その解決方法をまとめます。
webmcpは、デフォルト設定ではそもそも利用可能なツール一覧になく、さらにchromeを自動起動する場合は起動するchromeに対してmcp構成側で実験的フラグを設定する必要があります。

前提

  • この記事では、WebMCPをChrome DevTools MCP経由で利用します。
  • WebMCPを利用するには、Chrome DevTools MCPだけでなく、起動するChrome側でもWebMCP関連のフラグが有効になっている必要があります。
    • これは、chromeを自動起動する場合は、mcp構成引数側でchromeの実験的フラグを有効化する必要があることを意味します。
  • Webページ側の実装によっては、@mcp-b/webmcp-polyfill や @mcp-b/global などのライブラリが必要になる場合があります。
  • CodexおよびClaude Desktopはセットアップ済みであることを前提とします。

Chrome DevTools MCPをWebMCP対応で登録する

以下のコマンドは、外部プログラムをMCPサーバーとして登録します。
つまり、下記のコマンドは、パソコンに新規プログラムを実行することと同等です。
信頼できるソフトウェアであることを確認した上で実行してください。

2026年7月1日時点

Chrome DevTools MCP

現時点(2026年7月1日)では、Chrome DevTools MCPでWebMCPを利用するには、MCPサーバー側でWebMCP機能を有効化する設定と、使用するChrome側でWebMCP関連の機能フラグを有効化する設定の両方が必要です。
公式READMEでは、それぞれ --categoryExperimentalWebmcp=trueと--enable-features=WebMCPTesting,DevToolsWebMCPSupportを指定するよう案内されています

Codex

codex mcp add chrome-devtools -- npx chrome-devtools-mcp@latest --categoryExperimentalWebmcp=true "--chromeArg=--enable-features=WebMCPTesting,DevToolsWebMCPSupport"

登録後の設定例です。

%USERPROFILE%.codex\config.toml
[mcp_servers.chrome-devtools]
command = "npx"
args = [
  "chrome-devtools-mcp@latest",
  "--categoryExperimentalWebmcp=true",
  "--chromeArg=--enable-features=WebMCPTesting,DevToolsWebMCPSupport"
]
enabled = true

Claude Desktop

claude mcp add chrome-devtools --scope user npx chrome-devtools-mcp@latest --categoryExperimentalWebmcp=true "--chromeArg=--enable-features=WebMCPTesting,DevToolsWebMCPSupport"

設定ファイル(mcp.json)の例です。

{
  "mcpServers": {
    "chrome-devtools": {
      "command": "npx",
      "args": [
        "-y",
        "chrome-devtools-mcp@latest",
        "--categoryExperimentalWebmcp=true",
        "--chromeArg=--enable-features=WebMCPTesting,DevToolsWebMCPSupport"
      ]
    }
  }
}

WebMCPを利用する

WebMCPツールの実装方法や利用方法については、以下の記事が参考になります。

おまけ

最近のPull RequestによりCodexからchrome-devtools-mcpで任意のパスのファイルをブラウザにアップロードするには、--allow-unrestricted-pathsの指定が必要になりました。

%USERPROFILE%.codex\config.toml
[mcp_servers.chrome-devtools]
command = "npx"
args = [
  "chrome-devtools-mcp@latest",
  "--categoryExperimentalWebmcp=true",
  "--chromeArg=--enable-features=WebMCPTesting,DevToolsWebMCPSupport",
  "--allow-unrestricted-paths"
]
enabled = true
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?