fix: chrome dev tools mcp
This commit is contained in:
@@ -25,7 +25,7 @@ in {
|
||||
# Browser must be running with remote debugging on 127.0.0.1:9222.
|
||||
if ${config.home.homeDirectory}/.nix-profile/bin/claude mcp add --help >/dev/null 2>&1; then
|
||||
${config.home.homeDirectory}/.nix-profile/bin/claude mcp add --scope user chrome-devtools \
|
||||
-- npx -y chrome-devtools-mcp --browserUrl=http://127.0.0.1:9222 || true
|
||||
-- npx -y chrome-devtools-mcp --executablePath=${pkgs.ungoogled-chromium}/bin/chromium --isolated=true --headless=true --chromeArg=--ozone-platform=wayland --chromeArg=--enable-features=UseOzonePlatform --chromeArg=--force-device-scale-factor=1 || true
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -46,7 +46,24 @@ in
|
||||
environment.etc."codex/config.toml".text = ''
|
||||
[mcp_servers.chrome-devtools]
|
||||
command = "npx"
|
||||
args = ["-y", "chrome-devtools-mcp@latest", "--browserUrl=http://127.0.0.1:9222"]
|
||||
args = [
|
||||
# "-y", "chrome-devtools-mcp@latest", "--browserUrl=http://127.0.0.1:9222"
|
||||
"-y", "chrome-devtools-mcp@latest",
|
||||
|
||||
# Tell MCP exactly which Chromium to launch (Nix store path)
|
||||
"--executablePath=${pkgs.ungoogled-chromium}/bin/chromium",
|
||||
|
||||
# Make every run use a temporary profile (no shared state)
|
||||
"--isolated=true",
|
||||
|
||||
# Headful by default on Wayland
|
||||
"--headless=true",
|
||||
|
||||
# Pass Chromium flags for Wayland + scale
|
||||
"--chromeArg=--ozone-platform=wayland",
|
||||
"--chromeArg=--enable-features=UseOzonePlatform",
|
||||
"--chromeArg=--force-device-scale-factor=1"
|
||||
]
|
||||
startup_timeout_sec = 30
|
||||
tool_timeout_sec = 120
|
||||
'';
|
||||
|
||||
Reference in New Issue
Block a user