Skip to content

Commit 83410c9

Browse files
hyperpolymathclaude
andcommitted
feat(mcp-bridge): wire browser-mcp cartridge with 7 MCP tools
Add browser automation tools to the MCP bridge, routing to browser-mcp cartridge for Firefox automation via Marionette protocol: - boj_browser_navigate: Navigate to URL - boj_browser_click: Click by CSS selector - boj_browser_type: Type into element - boj_browser_read_page: Extract page text - boj_browser_screenshot: Capture screenshot - boj_browser_tabs: List/create/close tabs - boj_browser_execute_js: Run JavaScript Replaces the removed standalone playwright MCP server. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 96b4604 commit 83410c9

1 file changed

Lines changed: 94 additions & 0 deletions

File tree

mcp-bridge/main.js

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,88 @@ function cartridgeToTools(cartridges) {
296296
},
297297
});
298298

299+
// Browser automation (Firefox via Marionette)
300+
tools.push({
301+
name: "boj_browser_navigate",
302+
description: "Navigate Firefox to a URL",
303+
inputSchema: {
304+
type: "object",
305+
properties: {
306+
url: { type: "string", description: "URL to navigate to" },
307+
},
308+
required: ["url"],
309+
},
310+
});
311+
312+
tools.push({
313+
name: "boj_browser_click",
314+
description: "Click an element on the page by CSS selector",
315+
inputSchema: {
316+
type: "object",
317+
properties: {
318+
selector: { type: "string", description: "CSS selector of the element to click" },
319+
},
320+
required: ["selector"],
321+
},
322+
});
323+
324+
tools.push({
325+
name: "boj_browser_type",
326+
description: "Type text into an element on the page",
327+
inputSchema: {
328+
type: "object",
329+
properties: {
330+
selector: { type: "string", description: "CSS selector of the input element" },
331+
text: { type: "string", description: "Text to type" },
332+
},
333+
required: ["selector", "text"],
334+
},
335+
});
336+
337+
tools.push({
338+
name: "boj_browser_read_page",
339+
description: "Read the text content of the current page",
340+
inputSchema: {
341+
type: "object",
342+
properties: {},
343+
},
344+
});
345+
346+
tools.push({
347+
name: "boj_browser_screenshot",
348+
description: "Take a screenshot of the current page",
349+
inputSchema: {
350+
type: "object",
351+
properties: {},
352+
},
353+
});
354+
355+
tools.push({
356+
name: "boj_browser_tabs",
357+
description: "List, create, or close browser tabs",
358+
inputSchema: {
359+
type: "object",
360+
properties: {
361+
operation: { type: "string", enum: ["list", "create", "close"], description: "Tab operation" },
362+
url: { type: "string", description: "URL for new tab (create only)" },
363+
tab_id: { type: "number", description: "Tab ID (close only)" },
364+
},
365+
required: ["operation"],
366+
},
367+
});
368+
369+
tools.push({
370+
name: "boj_browser_execute_js",
371+
description: "Execute JavaScript in the current page context",
372+
inputSchema: {
373+
type: "object",
374+
properties: {
375+
script: { type: "string", description: "JavaScript code to execute" },
376+
},
377+
required: ["script"],
378+
},
379+
});
380+
299381
// Research
300382
tools.push({
301383
name: "boj_research",
@@ -421,6 +503,18 @@ async function handleMessage(line) {
421503
sendResult(id, { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] });
422504
break;
423505
}
506+
case "boj_browser_navigate":
507+
case "boj_browser_click":
508+
case "boj_browser_type":
509+
case "boj_browser_read_page":
510+
case "boj_browser_screenshot":
511+
case "boj_browser_tabs":
512+
case "boj_browser_execute_js": {
513+
const action = toolName.replace("boj_browser_", "");
514+
const result = await invokeCartridge("browser-mcp", { action, ...args });
515+
sendResult(id, { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] });
516+
break;
517+
}
424518
case "boj_research": {
425519
const result = await invokeCartridge("research-mcp", args);
426520
sendResult(id, { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] });

0 commit comments

Comments
 (0)