Skip to content

Commit 9785a73

Browse files
authored
fix(mcp): seed Control Chrome as chrome-devtools (anomalyco#876)
1 parent 6d3ba64 commit 9785a73

5 files changed

Lines changed: 9 additions & 7 deletions

File tree

‎.opencode/skills/browser-setup-devtools/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ description: Guide users through browser automation setup using Chrome DevTools
2424
4. If DevTools MCP calls fail:
2525
- Ask the user to open Chrome and keep it running.
2626
- Retry `chrome-devtools_list_pages`.
27-
- If it still fails, ensure `opencode.jsonc` includes `mcp.control-chrome` with command `['chrome-devtools-mcp']` and ask the user to restart OpenWork/OpenCode.
27+
- If it still fails, ensure `opencode.jsonc` includes `mcp["chrome-devtools"]` with command `['npx', '-y', 'chrome-devtools-mcp@latest']` and ask the user to restart OpenWork/OpenCode.
2828
- Retry the DevTools MCP check.
2929
5. If DevTools MCP is ready:
3030
- Offer a first task ("Let's try opening a webpage").

‎packages/app/src/app/app.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4619,7 +4619,7 @@ export default function App() {
46194619
return;
46204620
}
46214621

4622-
const slug = entry.name.toLowerCase().replace(/[^a-z0-9]+/g, "-");
4622+
const slug = entry.id ?? entry.name.toLowerCase().replace(/[^a-z0-9]+/g, "-");
46234623

46244624
try {
46254625
setMcpStatus(null);

‎packages/app/src/app/constants.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export const SUGGESTED_PLUGINS: SuggestedPlugin[] = [
2424
];
2525

2626
export type McpDirectoryInfo = {
27+
id?: string;
2728
name: string;
2829
description: string;
2930
url?: string;
@@ -69,10 +70,11 @@ export const MCP_QUICK_CONNECT: McpDirectoryInfo[] = [
6970
oauth: false,
7071
},
7172
{
73+
id: "chrome-devtools",
7274
name: "Control Chrome",
7375
description: "Drive Chrome tabs with browser automation.",
7476
type: "local",
75-
command: ["chrome-devtools-mcp"],
77+
command: ["npx", "-y", "chrome-devtools-mcp@latest"],
7678
oauth: false,
7779
},
7880
];

‎packages/desktop/scripts/chrome-devtools-mcp-shim.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ child.on("error", (error) => {
2121
const message = error instanceof Error ? error.message : String(error);
2222
if (message.includes("ENOENT")) {
2323
console.error(
24-
"Control Chrome requires npm (Node.js). Install Node.js or configure mcp.control-chrome.command to a local chrome-devtools-mcp binary."
24+
"Control Chrome requires npm (Node.js). Install Node.js or configure mcp.chrome-devtools.command to a local chrome-devtools-mcp binary."
2525
);
2626
} else {
2727
console.error(`Failed to start chrome-devtools-mcp via npm exec: ${message}`);

‎packages/desktop/src-tauri/src/workspace/files.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -511,12 +511,12 @@ pub fn ensure_workspace_files(workspace_path: &str, preset: &str) -> Result<(),
511511
_ => serde_json::Map::new(),
512512
};
513513

514-
if !mcp_obj.contains_key("control-chrome") {
514+
if !mcp_obj.contains_key("chrome-devtools") {
515515
mcp_obj.insert(
516-
"control-chrome".to_string(),
516+
"chrome-devtools".to_string(),
517517
serde_json::json!({
518518
"type": "local",
519-
"command": ["chrome-devtools-mcp"]
519+
"command": ["npx", "-y", "chrome-devtools-mcp@latest"]
520520
}),
521521
);
522522
config_changed = true;

0 commit comments

Comments
 (0)